// Generate production-quality TypeScript CLIs with full documentation, error handling, and best practices. Creates deterministic, type-safe command-line tools following PAI's CLI-First Architecture. USE WHEN user says "create a CLI", "build a command-line tool", "make a CLI for X", or requests CLI generation. (user)
| name | system-createcli |
| description | Generate production-quality TypeScript CLIs with full documentation, error handling, and best practices. Creates deterministic, type-safe command-line tools following PAI's CLI-First Architecture. USE WHEN user says "create a CLI", "build a command-line tool", "make a CLI for X", or requests CLI generation. (user) |
| location | user |
Automated CLI Generation System
Generate production-ready TypeScript CLIs with comprehensive documentation, type safety, error handling, and PAI's CLI-First Architecture principles.
When user requests CLI creation, follow this routing:
Triggers: "create CLI", "build command-line tool", "make CLI for X", "generate CLI"
Route to: workflows/create-cli.md
Action: Generate complete CLI from requirements
Triggers: "add command to CLI", "extend CLI with", "add feature to existing CLI"
Route to: workflows/add-command.md
Action: Add new command to existing CLI
Triggers: "upgrade CLI", "migrate to Commander", "CLI needs more complexity"
Route to: workflows/upgrade-tier.md
Action: Migrate Tier 1 โ Tier 2 (manual โ Commander.js)
Triggers: "add tests to CLI", "test scaffolding", "need CLI tests"
Route to: workflows/add-testing.md
Action: Generate comprehensive test suite
Triggers: "publish CLI", "distribute CLI", "make standalone binary"
Route to: workflows/setup-distribution.md
Action: Configure npm publishing or binary distribution
Activate when you see these patterns:
Tier 1: llcli-Style (DEFAULT - 80% of use cases)
When to use Tier 1:
Tier 2: Commander.js (ESCALATION - 15% of use cases)
When to use Tier 2:
Tier 3: oclif (REFERENCE ONLY - 5% of use cases)
1. Complete Implementation
2. Comprehensive Documentation
3. Development Setup
4. Quality Standards
Generated CLIs follow PAI's standards:
Generated CLIs go to:
${PAI_DIR}/bin/[cli-name]/ - Personal CLIs (like llcli)~/Projects/[project-name]/ - Project-specific CLIs~/Projects/PAI/examples/clis/ - Example CLIs (PUBLIC repo)SAFETY: Always verify repository location before git operations
Every generated CLI follows:
For detailed information, read these files:
workflows/create-cli.md - Main CLI generation workflow (decision tree, 10-step process)workflows/add-command.md - Add commands to existing CLIsworkflows/upgrade-tier.md - Migrate simple โ complexworkflows/add-testing.md - Test suite generationworkflows/setup-distribution.md - Publishing configurationframework-comparison.md - Manual vs Commander vs oclif (with research)patterns.md - Common CLI patterns (from llcli analysis)testing-strategies.md - CLI testing approaches (Jest, Vitest, Playwright)distribution.md - Publishing strategies (npm, standalone binaries)typescript-patterns.md - Type safety patterns (from tsx, vite, bun research)tools/templates/tier1/ - llcli-style templates (default)tools/templates/tier2/ - Commander.js templates (escalation)tools/generators/ - Generation scripts (TypeScript)tools/validators/ - Quality gates (validation)examples/api-cli/ - API client (reference: llcli)examples/file-processor/ - File operationsexamples/data-transform/ - Complex CLI (Commander.js)User Request: "Create a CLI for the GitHub API that can list repos, create issues, and search code"
Generated Structure:
${PAI_DIR}/bin/ghcli/
โโโ ghcli.ts # 350 lines, complete implementation
โโโ package.json # Bun + TypeScript
โโโ tsconfig.json # Strict mode
โโโ .env.example # GITHUB_TOKEN=your_token
โโโ README.md # Full documentation
โโโ QUICKSTART.md # Common use cases
Usage:
ghcli repos --user danielmiessler
ghcli issues create --repo pai --title "Bug fix"
ghcli search "typescript CLI"
ghcli --help
User Request: "Build a CLI to convert markdown files to HTML with frontmatter extraction"
Generated Structure:
${PAI_DIR}/bin/md2html/
โโโ md2html.ts
โโโ package.json
โโโ README.md
โโโ QUICKSTART.md
Usage:
md2html convert input.md output.html
md2html batch *.md output/
md2html extract-frontmatter post.md
User Request: "Create a CLI for data transformation with multiple formats, validation, and analysis commands"
Generated Structure:
${PAI_DIR}/bin/data-cli/
โโโ data-cli.ts # Commander.js with subcommands
โโโ package.json
โโโ README.md
โโโ QUICKSTART.md
Usage:
data-cli convert json csv input.json
data-cli validate schema data.json
data-cli analyze stats data.csv
data-cli transform filter --column=status --value=active
Every generated CLI must pass these gates:
any types except justifiedDaniel repeatedly creates CLIs for APIs and tools. Each time:
This skill automates steps 1-7.
The llcli CLI (Limitless.ai API) proves this pattern works:
This skill replicates that success.
This skill turns "I need a CLI for X" into production-ready tools in minutes, following proven patterns from llcli and PAI's CLI-First Architecture.