Overview

This section provides an overview of development on the cli package.

This is the UMI CLI package development overview. Below there are guides for getting setup, understanding the project structure, its dependencies and how it works.

Table of Contents

Getting Started

To begin using the UMI CLI, follow these simple steps:

  • Start by cloning the monorepo repository to your local machine.
1

Installing PNPM

The UMI CLI uses PNPM as its package manager. To install PNPM, follow the instructions provided in the PNPM documentation.

I would recommend using brew to install PNPM on macOS:

brew install pnpm
2

Cloning the Repository

I would recommend using SSH to clone the repository. To do this, run the following command:

git clone git@github.com:umi-labs/umi.git

Ensure that you have set up your SSH keys and have configured your GitHub account to use SSH. If not, follow the instructions provided in the GitHub documentation.

SSH Keys within an Organisation:

As repo is within an organisation you may need to configure your SSH key to allow yourself to clone. If you have any problems please contact the project lead.

3

Installing Dependencies

pnpm install

Ensure that you have set up your SSH keys and have configured your GitHub account to use SSH. If not, follow the instructions provided in the GitHub documentation.

4

Running the Development Server

Once the installation is complete, you can start the development server by running the following command:

turbo dev

The monorepo uses Turborepo to manage the development environment. Turborepo is a monorepo management tool that allows you to run multiple packages in parallel, making it easier to manage and develop your project.

Whilst the CLI doesn't use a development server it is useful to run this to make sure that the project is running correctly.

Project Structure

The project structure is as follows:

Note:

This is just a rough structure of the project, it is not a complete representation - additionally this is subject to change as the project evolves

Dependencies

Note:

This is not an extensive list of dependencies, it is just a list of the most important ones.

The project uses the following dependencies:

PackageUsage
ChalkChalk is a simple terminal coloring library, allowing you to add color to your terminal output.
CommanderCommander is a complete solution for node.js command-line interfaces.
cosmiconfigcosmiconfig is a complete solution for finding and loading configuration from JSON, YAML, TOML, and JavaScript files.
execaexeca is a cross-platform child_process replacement that works on top of the Node.js APIs.
kleurkleur is a styling library for terminal output.
oraora is a Node.js library for creating terminal spinners.
pathpath is a Node.js module that provides utilities for working with file and directory paths.
promptsprompts is a collection of reusable prompt objects.
simple-gitsimple-git is a simple, lightweight, and opinionated Git client for Node.js.
tsuptsup is a zero-config CLI for fast bundlerless TypeScript libraries and applications.
zodzod is a TypeScript-first schema validation library with static type inference.