Shell.js is a declarative command-line argument parser and stringifier for Node.js, currently at version 0.12.0, with its latest update published approximately a year ago. It's designed to simplify the creation of complex CLI applications by providing a structured way to define options, commands, and their associated routing logic. Key features include automatic argument discovery, support for multi-level commands (e.g., `git pull origin main`), built-in type conversion for arguments (string, boolean, integer, array), and auto-generated help messages. It differentiates itself through a declarative API that integrates parsing, stringifying, and routing into a single configuration object, making CLI development more intuitive than some imperative alternatives. The package is actively maintained and currently requires Node.js version 20 or later.
npm install shellVerified import paths — ran on the pinned version, not inferred.
This quickstart defines a CLI with global options, subcommands, and subcommand-specific options, demonstrating the declarative API for parsing and routing with `shell.js`.
Ensure your project runs on Node.js v20 or a newer compatible version. Update your runtime environment if necessary.
Always use named imports for ESM (`import { shell } from 'shell';`) and destructuring for CommonJS (`const { shell } = require('shell');`).Structure your CLI definition using the configuration object and call `myCli.route()` to activate parsing and command execution. Refer to the official documentation for the complete declarative API pattern.
Change your import statement to `import { shell } from 'shell';` to correctly access the named export.If working in an ES module environment, use `import { shell } from 'shell';`. If you must use CommonJS, ensure your file is `.cjs` or your `package.json` does not specify `"type": "module"` for that context.Ensure that the command you are trying to run is explicitly defined within the `commands` object when you initialize your `shell` instance, or check for typos in the command name.
No dependency data recorded yet.