make-cli is a declarative framework for building command-line interfaces in Node.js, distinguished by its streamlined approach that centers around a single configuration object and a single function call. It aims to simplify CLI development by abstracting away much of the boilerplate often associated with argument parsing and command definition. The current stable version is 6.0.2, with major versions typically aligned with Node.js LTS releases (e.g., v5 required Node.js >= 20, v6 requires Node.js >= 22). Patch and minor releases occur regularly to address bugs and introduce minor enhancements. Built on top of Commander.js, make-cli leverages its robust parsing capabilities while offering a more functional and declarative API. This design makes it particularly appealing for developers who prefer a concise and config-driven style for their CLI tools, differentiating it from more imperative or class-based alternatives by providing a highly approachable entry point for creating complex command structures.
npm install make-cliVerified import paths — ran on the pinned version, not inferred.
This example demonstrates defining a CLI with global arguments and options, an main action handler, and a subcommand. It includes TypeScript types, async operations, and option validation with 'choices'.
Upgrade your Node.js environment to version 22 or newer, or downgrade make-cli to a compatible major version (e.g., v5 for Node.js >= 20).
Upgrade your Node.js environment to version 20 or newer, or stick to make-cli v4.x.
Update to make-cli version 6.0.2 or newer to ensure CLI actions correctly wait for all promises to resolve before the process exits. Ensure your action/handler functions are `async` and `await` all relevant promises.
Ensure your project's `package.json` includes `"type": "module"`, or rename your file to `.mjs`. Alternatively, ensure your Node.js version meets the minimum requirement for `make-cli` (v6 requires Node.js >= 22).
If publishing, add `"bin": "./cli.js"` (or your script path) to `package.json`. Locally, run `npm link` in your project directory for development, or ensure your script has execution rights with `chmod +x ./cli.js`.
Ensure the argument passed for the option (`--value` in this example) is one of the predefined `choices`. For example, use `--value bar` instead of `--value invalid`.
No dependency data recorded yet.