Add colors, progress bars, spinners, and styled tables to your CLI applications with an easy-to-use API and zero dependencies.
Everything you need to create beautiful and informative command-line interfaces
Multiple built-in themes with easy customization to match your application style.
Visual indicators for long-running operations with customizable appearance.
Animated spinners with customizable frames and styles for async operations.
Express intent with semantic methods like success, error, warning, and info.
Display data in well-formatted tables with styled headers for better readability.
Structured logging for complex operations with steps and status reporting.
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');
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
Common questions about using @open-utils/cli-colorize in your projects