Communitygithub.com

YepAPI/skills

Commander.js, @clack/prompts를 활용한 대화형 프롬프트, 스피너, 색상, 설정 파일, 종료 코드, npm 배포를 포함한 CLI 도구

skills란 무엇인가요?

이 스킬은 Node.js 기반 CLI 도구를 구축하기 위한 포괄적인 가이드와 패턴을 제공합니다. Commander.js로 강력한 인수 파싱을, @clack/prompts로 아름다운 대화형 프롬프트를, ora로 장기 실행 작업의 진행 상태를 시각화하며, chalk로 일관된 색상 스타일을 적용합니다. 또한 cosmiconfig를 통한 자동 설정 파일 탐색, 표준화된 종료 코드(0/1/2), CI 및 스크립트 환경에서도 대비한 `--flag` 대체 입력, 그리고 npm 배포를 위한 `bin` 필드와 shebang 설정까지 다룹니다. Claude Code, Cursor, Codex 등 에이전트가 이 포맷을 따르면 사용자에게 직관적이고 오류에 강한 CLI를 신속하게 생성할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/cli-tools

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

CLI 도구

규칙

  • Commander.js를 사용한 인수 파싱 — .command(), .option(), .argument()와 설명을 포함할 것
  • 대화형 프롬프트: @clack/prompts(현대적이고 아름다운) 또는 inquirer — 인수가 제공되지 않을 때 사용자 입력을 위해 사용
  • 스피너: 장기 실행 작업에는 ora — 시작, 메시지 업데이트, 성공/실패
  • 색상: 스타일 출력에는 chalk — 절제하여 사용: 오류는 빨간색, 성공은 초록색, 경고는 노란색, 부가 정보는 희미하게(dim)
  • 설정 파일: cosmiconfig — .toolrc, .toolrc.json, tool.config.js, package.json 키를 자동으로 검색
  • 종료 코드: 성공은 0, 일반 오류는 1, 사용법 오류는 2 — 항상 process.exit(code) 사용
  • --help 및 --version 플래그: Commander가 자동으로 추가 — 모든 옵션에 명확한 설명을 작성할 것
  • 오류 처리: 최상위 수준에서 오류를 잡고, 사용자 친화적인 메시지를 stderr에 출력한 후 코드 1로 종료
  • 배포: package.json의 bin 필드, #!/usr/bin/env node shebang, ESM을 위한 "type": "module"

패턴

#!/usr/bin/env node
import { Command } from "commander";
import * as p from "@clack/prompts";
import ora from "ora";
import chalk from "chalk";

const program = new Command()
  .name("my-tool")
  .description("유용한 일을 하는 CLI")
  .version("1.0.0");

program
  .command("init")
  .description("새 프로젝트 초기화")
  .option("-t, --template <name>", "사용할 템플릿", "default")
  .action(async (options) => {
    p.intro(chalk.bold("프로젝트 설정"));

    const name = await p.text({ message: "프로젝트 이름?", placeholder: "my-app" });
    if (p.isCancel(name)) { p.cancel("취소되었습니다."); process.exit(0); }

    const spinner = ora("프로젝트 생성 중...").start();
    await createProject(name, options.template);
    spinner.succeed(chalk.green("프로젝트 생성 완료!"));

    p.outro(`다음 명령 실행: ${chalk.cyan(`cd ${name} && npm install`)}`);
  });

program.parse();

// package.json: { "bin": { "my-tool": "./dist/index.js" } }

피해야 할 것

  • 오류를 stdout에 출력 금지 — 오류는 console.error() 또는 process.stderr.write() 사용
  • 실패 시 종료 코드 없이 종료 금지 — 항상 process.exit(1)을 사용하여 스크립트와 CI가 실패를 감지할 수 있도록 함
  • 서식 없는 긴 텍스트 금지 — 가독성을 위해 chalk 색상, 섹션, 공백 사용
  • 플래그 대안 없이 대화형 입력만 요구 금지 — CI/스크립트 환경을 위해 항상 --flag 오버라이드 지원
  • shebang #!/usr/bin/env node 누락 금지 — 이것이 없으면 npx 및 전역 설치가 작동하지 않음

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Tenant isolation (row-level vs schema), subdomain routing, per-tenant config, and data partitioning.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬