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.
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
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.
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.
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:
Package | Usage |
---|---|
Chalk | Chalk is a simple terminal coloring library, allowing you to add color to your terminal output. |
Commander | Commander is a complete solution for node.js command-line interfaces. |
cosmiconfig | cosmiconfig is a complete solution for finding and loading configuration from JSON, YAML, TOML, and JavaScript files. |
execa | execa is a cross-platform child_process replacement that works on top of the Node.js APIs. |
kleur | kleur is a styling library for terminal output. |
ora | ora is a Node.js library for creating terminal spinners. |
path | path is a Node.js module that provides utilities for working with file and directory paths. |
prompts | prompts is a collection of reusable prompt objects. |
simple-git | simple-git is a simple, lightweight, and opinionated Git client for Node.js. |
tsup | tsup is a zero-config CLI for fast bundlerless TypeScript libraries and applications. |
zod | zod is a TypeScript-first schema validation library with static type inference. |