Beautiful Terminal Output for Node.js CLI Applications

Add colors, progress bars, spinners, and styled tables to your CLI applications with an easy-to-use API and zero dependencies.

Features That Enhance Your CLI

Everything you need to create beautiful and informative command-line interfaces

🎨

Theme Support

Multiple built-in themes with easy customization to match your application style.

📊

Progress Bars

Visual indicators for long-running operations with customizable appearance.

⏱️

Spinners

Animated spinners with customizable frames and styles for async operations.

📝

Semantic Logging

Express intent with semantic methods like success, error, warning, and info.

📋

Enhanced Tables

Display data in well-formatted tables with styled headers for better readability.

🔀

Workflow Logging

Structured logging for complex operations with steps and status reporting.

Simple and Expressive API

Designed to be intuitive and easy to use while providing powerful capabilities

// Import the library
const { logger } = require('@open-utils/cli-colorize');

// Use semantic logging methods
logger.success('Operation completed successfully!');
logger.error('Something went wrong');
logger.warning('This might be a problem');
logger.info('Just FYI');

// Create a progress bar
const progress = logger.createProgressBar(100, {
  width: 40,
  completeChar: '█',
  incompleteChar: '░',
  style: { color: 'cyan', style: 'bright' }
});

// Update progress during operations
progress.update(50, 'Processing data...');

// Create a spinner for async operations
const spinner = logger.createSpinner('Loading...', {
  frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'],
  interval: 80
});

spinner.start();
// Later when done:
spinner.success('Data loaded successfully!');

// Chain methods for compact code
logger
  .info('Processing started')
  .success('Step 1 completed')
  .success('Step 2 completed')
  .info('All steps finished');

Installation

Get started in seconds with npm, yarn, or pnpm

// With npm
npm install @open-utils/cli-colorize

// With yarn
yarn add @open-utils/cli-colorize

// With pnpm
pnpm add @open-utils/cli-colorize

Frequently Asked Questions

Common questions about using @open-utils/cli-colorize in your projects

Does it work in all terminals? +
The library uses standard ANSI escape sequences that work in most modern terminals. Colors and styles will automatically be disabled in environments where they aren't supported.
How does it compare to chalk or colors.js? +
While chalk and colors.js focus primarily on colors, @open-utils/cli-colorize provides a complete CLI styling solution including progress bars, spinners, themes, tables, and workflow logging - all with a consistent, easy-to-use API.
Can I use it with TypeScript? +
Yes! The library includes full TypeScript definitions and was built with type safety in mind.
Does it work with ESM and CommonJS? +
Yes, the library supports both module systems out of the box. You can use either require() or import syntax depending on your project setup.