cli-ux

A toolkit of CLI IO utilities for Node.js: prompts, spinners, progress bars, tables, and styled output.

Library
npm
v6.0.9
541stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
46/100Fair
Development Activity0
Maintenance44
Community52
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture76
Code Quality75
Innovation74
Learning Curve78

cli-ux is a collection of terminal input and output utilities originally built for the oclif CLI framework. It exposes a single cli object with helpers for prompting users (including masked and password input), showing spinner-style actions while long tasks run, rendering progress bars, printing styled tables and JSON, opening URLs, and emitting colored, hyperlinked output.

The library has been deprecated and its functionality folded into @oclif/core, so it is no longer maintained. It remains widely installed across the Node.js CLI ecosystem and is documented here for reference and for teams maintaining tools that still depend on it.

What You Get

  • Prompt helpers for plain, masked, password, and confirmation input
  • cli.action spinners and cli.progress bars for reporting long-running work
  • Styled output helpers including tables, JSON, object trees, and headers
  • Terminal niceties like clickable hyperlinks, colors, and cli.open for URLs

Common Use Cases

  • Prompting for user input and secrets in an interactive CLI
  • Showing progress and spinner feedback during long operations
  • Rendering tabular or structured data cleanly in the terminal

Under The Hood

Architecture - src/index.ts assembles a single default cli object whose methods map to focused modules: prompt.ts for input, the action/ directory for spinner-style progress, list.ts and the styled/ directory for tables, JSON, trees and headers, open.ts for launching URLs, wait.ts for delays, and exit.ts/config.ts for process control and configuration. Each concern is isolated in its own file and composed onto the exported object, so callers use one ergonomic entry point while the implementation stays modular.

Tech Stack - Written in TypeScript and published as CommonJS in lib/. It leans on a broad set of well-known terminal libraries — chalk, ansi-styles, ansi-escapes, strip-ansi, string-width, and supports-color for styling; cli-progress for progress bars; password-prompt for secrets; hyperlinker/supports-hyperlinks for clickable links; plus lodash, fs-extra, js-yaml, and @oclif/core utilities.

Code Quality - The code is organized into small, single-purpose modules with a matching test directory (index.test.ts, prompt.test.ts, a styled/ suite, and a fancy test harness). It is fully typed and was production-hardened as the UX layer of the Heroku and Salesforce CLIs, though it now sits in maintenance-only status.

API Design - The API is deliberately approachable: import cli and call cli.prompt, cli.action.start, cli.progress, or cli.table. Method names read like the tasks they perform and options objects cover the less common cases, giving a gentle learning curve. Its successor lives on as the ux namespace in @oclif/core with a nearly identical surface.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search