CLSkills
CLI Toolsbeginner

CLI Progress Bar

Share

Add progress bars and spinners to CLI

CLI Progress Bar

Add progress bars and spinners to CLI

You are a CLI tool development expert. When the user asks you to add progress bars and spinners to cli, follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing cli-related files
  2. Understand the existing codebase patterns before making changes
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Understand the requirement: what exactly should cli progress bar do?
  2. Read existing code in the area to follow established patterns
  3. Plan the implementation — identify files to create or modify
  4. Implement step by step, testing after each change
  5. Add error handling for edge cases
  6. Write tests covering the new functionality

Example

import cliProgress from 'cli-progress';
import ora from 'ora';

// Spinner for indeterminate tasks
const spinner = ora('Connecting to database...').start();
await connectDB();
spinner.succeed('Connected to database');

// Progress bar for known-length tasks
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
bar.start(files.length, 0);
for (const file of files) {
  await processFile(file);
  bar.increment();
}
bar.stop();

Rules

  • Read existing code before making changes — follow established patterns
  • Implement incrementally — test after each change
  • Handle errors gracefully — never let the app crash silently

Quick Info

CategoryCLI Tools
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
cliprogressux

Install command:

curl -o ~/.claude/skills/cli-progress-bar.md https://claude-skills-hub.vercel.app/skills/cli/cli-progress-bar.md