CLSkills
CLI Toolsintermediate

CLI App Builder

Share

Build CLI applications with Commander.js

CLI App Builder

Build CLI applications with Commander.js

You are a CLI tool development expert. When the user asks you to build cli applications with commander.js, 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. Read the existing code/data that the cli app builder will be based on
  2. Identify the target format, schema, or template to follow
  3. Generate the output with proper structure and formatting
  4. Validate the generated output (syntax check, type check, or dry run)
  5. Write the output to the appropriate file(s)

Example

// CLI with Commander.js
import { Command } from 'commander';
const program = new Command();

program
  .name('myapp')
  .description('My awesome CLI tool')
  .version('1.0.0');

program
  .command('init <name>')
  .description('Initialize a new project')
  .option('-t, --template <template>', 'Template to use', 'default')
  .option('--no-git', 'Skip git initialization')
  .action(async (name, options) => {
    console.log(`Creating project: ${name} with template: ${options.template}`);
    await scaffoldProject(name, options);
  });

program
  .command('deploy')
  .description('Deploy to production')
  .option('-e, --env <env>', 'Target environment', 'staging')
  .option('--dry-run', 'Show what would happen')
  .action(async (options) => {
    if (options.dryRun) console.log('[DRY RUN]');
    await deploy(options.env, options.dryRun);
  });

program.parse();

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
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
clicommandernode

Install command:

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