본문으로 건너뛰기
cccskills
무료GitHub에 공개

commander-js-scaffolder

Generate Commander.js CLI project structure with TypeScript, commands, options, and best practices. Creates a complete scaffolded CLI application ready for development.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md5.2 KB
  • README.md5.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Commander.js Scaffolder

Generate a complete Commander.js CLI application with TypeScript, proper project structure, and best practices.

Capabilities

  • Generate TypeScript-based Commander.js CLI projects
  • Create command structure with subcommands and options
  • Set up proper argument parsing with type coercion
  • Configure help text generation
  • Implement version management
  • Set up build and development workflows

Usage

Invoke this skill when you need to:

  • Bootstrap a new CLI application using Commander.js
  • Create a TypeScript CLI with proper structure
  • Set up command hierarchies with subcommands
  • Configure CLI options and arguments

Inputs

ParameterTypeRequiredDescription
projectNamestringYesName of the CLI project (kebab-case)
descriptionstringYesShort description of the CLI
commandsarrayNoList of commands to scaffold
typescriptbooleanNoUse TypeScript (default: true)
packageManagerstringNonpm, yarn, or pnpm (default: npm)

Command Structure

{
  "commands": [
    {
      "name": "init",
      "description": "Initialize a new project",
      "options": [
        { "flags": "-t, --template <name>", "description": "Template to use" },
        { "flags": "-f, --force", "description": "Overwrite existing files" }
      ],
      "arguments": [
        { "name": "<directory>", "description": "Target directory" }
      ]
    }
  ]
}

Output Structure

<projectName>/
├── package.json
├── tsconfig.json
├── .gitignore
├── README.md
├── src/
│   ├── index.ts              # Entry point with shebang
│   ├── cli.ts                # Main CLI setup
│   ├── commands/
│   │   ├── index.ts          # Command exports
│   │   └── <command>.ts      # Individual commands
│   ├── utils/
│   │   ├── logger.ts         # Logging utilities
│   │   └── config.ts         # Configuration helpers
│   └── types/
│       └── index.ts          # Type definitions
├── bin/
│   └── <projectName>         # Compiled binary entry
└── tests/
    └── commands/
        └── <command>.test.ts

Generated Code Patterns

Main CLI Entry (src/cli.ts)

import { Command } from 'commander';
import { version } from '../package.json';

const program = new Command();

program
  .name('<projectName>')
  .description('<description>')
  .version(version, '-v, --version', 'Display version number');

// Register commands
program.addCommand(initCommand);
program.addCommand(buildCommand);

// Global options
program
  .option('-d, --debug', 'Enable debug mode')
  .option('-q, --quiet', 'Suppress output');

// Error handling
program.exitOverride();

try {
  program.parse();
} catch (err) {
  // Handle gracefully
}

Command Template (src/commands/<name>.ts)

import { Command } from 'commander';

export const <name>Command = new Command('<name>')
  .description('<description>')
  .argument('<required>', 'Required argument description')
  .argument('[optional]', 'Optional argument description')
  .option('-o, --option <value>', 'Option description', 'default')
  .action(async (required, optional, options) => {
    // Command implementation
  });

Dependencies

{
  "dependencies": {
    "commander": "^12.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "typescript": "^5.0.0",
    "tsx": "^4.0.0",
    "vitest": "^1.0.0"
  }
}

Workflow

  1. Validate inputs - Check project name, commands structure
  2. Create directory structure - Set up folders and base files
  3. Generate package.json - Configure project metadata and scripts
  4. Generate tsconfig.json - TypeScript configuration
  5. Create CLI entry point - Main program setup
  6. Generate commands - Individual command files
  7. Create utilities - Logger, config helpers
  8. Set up tests - Test structure for commands
  9. Initialize git - Optional git initialization

Best Practices Applied

  • TypeScript strict mode enabled
  • Proper error handling with exitOverride
  • Consistent command naming conventions
  • Help text formatting standards
  • Version flag configuration
  • Debug/verbose mode support
  • Graceful error messages

References

Target Processes

  • cli-application-bootstrap
  • cli-command-structure-design
  • argument-parser-setup

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Provide implementations of advanced data structures

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

a5c-ai/babysitter1.9천2026년 9월 17일 업데이트

Fresh adversarial code review with binary PASS/FAIL verdicts, evidence citations, and anchoring bias prevention via fresh reviewer spawning.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

a5c-ai/babysitter1.9천2026년 9월 17일 업데이트

WASM-based instant code transforms for simple tasks, achieving 352x speedup over LLM inference with zero cost.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

a5c-ai/babysitter1.9천2026년 9월 17일 업데이트

Coordinate Crew (persistent) and Polecat (transient) agents using Gas Town's hook-based work distribution and GUPP principle.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

a5c-ai/babysitter1.9천2026년 9월 17일 업데이트

Generate visual representations of algorithm execution

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

a5c-ai/babysitter1.9천2026년 9월 17일 업데이트

Hierarchical coordination and drift detection with frequent checkpoints, shared memory coherence validation, role specialization enforcement, and short task cycles.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

a5c-ai/babysitter1.9천2026년 9월 17일 업데이트

a5c-ai의 스킬 모두 보기

이 스킬의 문제 신고