Registry / devops / cli
library1.0.1jsnpmunverified

A full-featured command-line application toolkit for Node.js (v1.0.1, latest, infrequently updated). Provides argument parsing, plugin support, colored output, progress bars, spinners, auto-completion, and stdin helpers. Differentiates from yargs and commander by its inclusive feature set and mature legacy API.

npm install cli
INSTALL
IMPORT
SIG · CLI
C
cli
devopsjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
const cli = require('cli')
CommonJS only; this package predates ESM and has no ESM entry.
cli.parse
cli.parse(options)
const { parse } = require('cli'); parse(options)
Main module is a function; parse is a method on it.
cli.withStdin
cli.withStdin(callback)
withStdin(callback)
Must be called on the cli object.

Shows parsing CLI arguments with descriptions and defaults, then processing stdin lines and using parsed options.

const cli = require('cli'); cli.parse({ file: ['f', 'A file to process', 'file', 'temp.log'], time: ['t', 'An access time', 'time', false], work: [false, 'What kind of work to do', 'string', 'sleep'] }); cli.withStdinLines((lines, newline) => { if (cli.options.file) { cli.output(`File option: ${cli.options.file}`); } cli.output(lines.join(newline)); });
Debug
Known issues
gotchaThe package is old and uses CommonJS only; there is no ESM version.
fix
Use require('cli') instead of import.
affects: >=0.2.5
gotchaThe default export is a function; calling require('cli')() is incorrect.
fix
Assign to a variable and use its methods.
affects: >=0.2.5
deprecatedThe package is not actively maintained; newer alternatives like yargs or commander exist.
fix
Consider migrating to a maintained library.
affects: >=1.0.0
gotchaAuto-completion feature may not work in all environments.
fix
Test on target shells.
affects: >=0.2.5
Errors
Common errors & fixes
TypeError: cli.withStdin is not a function
Attempting to call withStdin without requiring cli correctly.
fix
const cli = require('cli'); then cli.withStdin(...)
Error: Cannot find module 'cli'
Missing npm install or incorrect require path.
fix
Run 'npm install cli' and ensure it is in node_modules.
ReferenceError: cli is not defined
Trying to use cli without requiring it.
fix
Add 'const cli = require('cli');' at the top.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
cli — npm install cli · libregistry