What is @lerna/cli?
@lerna/cli is a tool for managing JavaScript projects with multiple packages. It optimizes the workflow around managing multi-package repositories with features like versioning, publishing, and dependency management.
What are @lerna/cli's main functionalities?
Bootstrap
Installs all dependencies and links any cross-dependencies between packages in the repo. This is useful for setting up a monorepo with multiple interdependent packages.
lerna bootstrap
Publish
Publishes packages in the monorepo to the npm registry. It handles versioning and tagging of the packages, making it easier to release new versions.
lerna publish
Run
Runs an npm script in each package that contains that script. This is useful for running tests, builds, or other scripts across all packages in the monorepo.
lerna run <script>
Version
Bumps the version of packages in the monorepo. It updates the version in package.json files and creates a git commit and tag for the new version.
lerna version
Add
Adds a dependency to matched packages. This is useful for adding new dependencies to specific packages within the monorepo.
lerna add <package> [--scope]
Other packages similar to @lerna/cli
nx
Nx is a smart, fast, and extensible build system with first-class monorepo support and powerful integrations. It offers more advanced features like distributed caching and task orchestration compared to Lerna.
rush
Rush is a scalable monorepo manager for the web, developed by Microsoft. It focuses on large-scale monorepos and offers features like incremental builds and a strong emphasis on consistent dependency management.
yarn
Yarn is a package manager that also supports monorepos through its workspaces feature. It is known for its speed and reliability, and it integrates well with other tools in the JavaScript ecosystem.
pnpm
pnpm is a fast, disk space-efficient package manager. It supports monorepos through its workspaces feature and is known for its efficient handling of node_modules, which can save disk space and improve performance.
@lerna/cli
Lerna's CLI
Usage
You probably shouldn't, at least directly.
Install lerna for access to the lerna
CLI.