$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
CLI Toolsbeginner

CLI Progress Bar

Share

Add progress bars and spinners to CLI

Works with OpenClaude

You are a CLI UX developer. The user wants to add visual progress indicators (progress bars and spinners) to terminal applications.

What to check first

  • Verify Node.js version supports your chosen library (check node --version — most progress libraries need Node 12+)
  • Confirm terminal supports ANSI escape sequences with echo $TERM (most modern terminals do)

Steps

  1. Install a progress library like cli-progress or ora using npm install cli-progress ora
  2. Import the library at the top of your script: const cliProgress = require('cli-progress');
  3. Create a progress bar instance with new cliProgress.SingleBar() and pass configuration object with format, barCompleteChar, barIncompleteChar
  4. Start the progress bar with .start(totalValue, startValue) where totalValue is the max count
  5. Update progress in your loop with .update(currentValue) after each iteration
  6. Call .stop() when the operation completes
  7. For spinners, use ora library: create spinner with ora('Loading text') and call .start(), then .succeed() or .fail() when done
  8. Chain multiple progress operations by stopping one bar and starting another in sequence

Code

const cliProgress = require('cli-progress');
const ora = require('ora');

// Example 1: Progress Bar
async function downloadFiles() {
  const progressBar = new cliProgress.SingleBar({
    format: 'Download Progress |{bar}| {percentage}% || {value}/{total} files',
    barCompleteChar: '\u2588',
    barIncompleteChar: '\u2591',
    hideCursor: true,
    stopOnComplete: true
  });

  const totalFiles = 50;
  progressBar.start(totalFiles, 0);

  for (let i = 1; i <= totalFiles; i++) {
    // Simulate file download
    await new Promise(resolve => setTimeout(resolve, 100));
    progressBar.update(i);
  }

  progressBar.stop();
  console.log('✓ Download complete!');
}

// Example 2: Spinner
async function processData() {
  const spinner = ora('Processing data...').start();

  try {
    // Simulate async work
    await new Promise(resolve => setTimeout(resolve, 2000));
    spinner.succeed('Data processed successfully');
  } catch (error) {
    spinner.fail('Processing failed: ' + error.message);
  }
}

// Example 3: Multi-bar with spinners
async function complexOperation() {
  const bars = new cliProgress.MultiBar({
    clearOnComplete: false,
    format: '{name} |{bar}| {percentage}% || {value}/{total}',
    barCompleteChar: '█',
    barIncompleteChar: '░',
    hideCursor: true

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

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

Related CLI Tools Skills

Other Claude Code skills in the same category — free to download.

Want a CLI Tools skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.