Createcli skill

Generates production-ready TypeScript CLIs via a 3-tier template system (manual arg parsing, Commander.js, oclif), each shipping full implementation, docs, package.json, strict config, JSON output, and exit-code compliance.

by danielmiessler·MIT license·★ 19,269 Stars on the repo·GitHub ↗

Use now

Files of Createcli

danielmiessler/main1 file shown
SKILL.md
Show the full text379 lines

Customization

Before executing, check for user customizations at: ~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/CreateCLI/

If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.

🚨 MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)

You MUST send this notification BEFORE doing anything else when this skill is invoked.

  1. Send voice notification:

    curl -s -X POST http://localhost:31337/notify \
      -H "Content-Type: application/json" \
      -d '{"message": "Running the WORKFLOWNAME workflow in the CreateCLI skill to ACTION"}' \
      > /dev/null 2>&1 &
    
  2. Output text notification:

    Running the **WorkflowName** workflow in the **CreateCLI** skill to ACTION...
    

This is not optional. Execute this curl command immediately upon skill invocation.

CreateCLI

What It Does

Generates production-ready TypeScript CLIs. Every CLI ships with full implementation, README and QUICKSTART, a Bun package.json, strict tsconfig, JSON output, and correct exit codes. A three-tier template system picks the right complexity: Tier 1 manual arg parsing with zero deps (most cases), Tier 2 Commander.js for subcommands, Tier 3 oclif as a reference for enterprise scale.

The Problem

People build the same CLI from scratch over and over. It starts as a bash script, then needs error handling, then help text, then type safety, and ends up rewritten in TypeScript with docs bolted on at the end. Each round repeats the same boilerplate and the same mistakes. This skill takes that whole arc and produces a clean, typed, documented CLI in one pass, at the tier the job actually needs.

How It Works

Generate production-ready TypeScript CLIs with documentation, type safety, error handling, and CLI-First Architecture principles.


Workflow Routing

Route to the appropriate workflow based on the request.

When executing a workflow, output this notification directly:

Running the **WorkflowName** workflow in the **CreateCLI** skill to ACTION...
Workflow Trigger File
CreateCli Create a new CLI tool from scratch Workflows/CreateCli.md
AddCommand Add a new command to existing CLI Workflows/AddCommand.md
UpgradeTier Upgrade CLI to higher tier Workflows/UpgradeTier.md

🚀 WHEN TO ACTIVATE THIS SKILL

Activate when you see these patterns:

Direct Requests
  • "Create a CLI for [API/service/tool]"
  • "Build a command-line interface for X"
  • "Make a CLI that does Y"
  • "Generate a TypeScript CLI"
  • "I need a CLI tool for Z"
Context Clues
  • User describes repetitive API calls → Suggest CLI
  • User mentions "I keep typing this command" → Suggest CLI wrapper
  • User has bash script doing complex work → Suggest TypeScript CLI replacement
  • User working with API that lacks official CLI → Suggest creating one
Examples
  • ✅ "Create a CLI for the GitHub API"
  • ✅ "Build a command-line tool to process CSV files"
  • ✅ "Make a CLI for my database migrations"
  • ✅ "Generate a CLI that wraps this API"
  • ✅ "I need a tool like llcli but for Notion API"

💡 CORE CAPABILITIES

Three-Tier Template System

Tier 1: llcli-Style (DEFAULT - 80% of use cases)

  • Manual argument parsing (process.argv)
  • Zero framework dependencies
  • Bun + TypeScript
  • Type-safe interfaces
  • ~300-400 lines total
  • Perfect for: API clients, data transformers, simple automation

When to use Tier 1:

  • ✅ 2-10 commands
  • ✅ Simple arguments (flags, values)
  • ✅ JSON output
  • ✅ No subcommands
  • ✅ Fast development

Tier 2: Commander.js (ESCALATION - 15% of use cases)

  • Framework-based parsing
  • Subcommands + nested options
  • Auto-generated help
  • Plugin-ready
  • Perfect for: Complex multi-command tools

When to use Tier 2:

  • ❌ 10+ commands needing grouping
  • ❌ Complex nested options
  • ❌ Plugin architecture
  • ❌ Multiple output formats

Tier 3: oclif (REFERENCE ONLY - 5% of use cases)

  • Documentation only (no templates)
  • Enterprise-grade plugin systems
  • Perfect for: Heroku CLI, Salesforce CLI scale (rare)
What Every Generated CLI Includes

1. Complete Implementation

  • TypeScript source with full type safety
  • All commands functional and tested
  • Error handling with proper exit codes
  • Configuration management

2. Comprehensive Documentation

  • README.md with philosophy, usage, examples
  • QUICKSTART.md for common patterns
  • Inline help text (--help)
  • API response documentation

3. Development Setup

  • package.json (Bun configuration)
  • tsconfig.json (strict mode)
  • .env.example (configuration template)
  • File permissions configured

4. Quality Standards

  • Type-safe throughout
  • Deterministic output (JSON)
  • Composable (pipes to jq, grep)
  • Error messages with context
  • Exit code compliance

🏗️ INTEGRATION WITH LifeOS

Technology Stack Alignment

Generated CLIs follow LifeOS standards:

  • ✅ Runtime: Bun (NOT Node.js)
  • ✅ Language: TypeScript (NOT JavaScript or Python)
  • ✅ Package Manager: Bun (NOT npm/yarn/pnpm)
  • ✅ Testing: Vitest (when tests added)
  • ✅ Output: Deterministic JSON (composable)
  • ✅ Documentation: README + QUICKSTART (llcli pattern)
Repository Placement

Generated CLIs go to:

  • ~/.claude/LIFEOS/TOOLS/[cli-name]/ - Personal CLIs (like llcli)
  • ~/Projects/[project-name]/ - Project-specific CLIs
  • ${PROJECTS_DIR}/LIFEOS/Examples/clis/ - Example CLIs (PUBLIC repo)

SAFETY: Always verify repository location before git operations

CLI-First Architecture Principles

Every generated CLI follows:

  1. Deterministic - Same input → Same output
  2. Clean - Single responsibility
  3. Composable - JSON output pipes to other tools
  4. Documented - Comprehensive help and examples
  5. Testable - Predictable behavior

📚 EXTENDED CONTEXT

For detailed information, read these files:

Workflow Documentation
  • Workflows/CreateCli.md - Main CLI generation workflow (decision tree, 10-step process)
  • Workflows/AddCommand.md - Add commands to existing CLIs
  • Workflows/UpgradeTier.md - Migrate simple → complex
Reference Documentation
  • FrameworkComparison.md - Manual vs Commander vs oclif (with research)
  • Patterns.md - Common CLI patterns (from llcli analysis)
  • TypescriptPatterns.md - Type safety patterns (from tsx, vite, bun research)

📖 EXAMPLES

Example 1: API Client CLI (Tier 1)

User Request: "Create a CLI for the GitHub API that can list repos, create issues, and search code"

Generated Structure:

~/.claude/LIFEOS/TOOLS/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 exampleuser
ghcli issues create --repo myrepo --title "Bug fix"
ghcli search "typescript CLI"
ghcli --help

Example 2: File Processor (Tier 1)

User Request: "Build a CLI to convert markdown files to HTML with frontmatter extraction"

Generated Structure:

~/.claude/LIFEOS/TOOLS/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

Example 3: Data Pipeline (Tier 2)

User Request: "Create a CLI for data transformation with multiple formats, validation, and analysis commands"

Generated Structure:

~/.claude/LIFEOS/TOOLS/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

✅ QUALITY STANDARDS

Every generated CLI must pass these gates:

1. Compilation
  • ✅ TypeScript compiles with zero errors
  • ✅ Strict mode enabled
  • ✅ No any types except justified
2. Functionality
  • ✅ All commands work as specified
  • ✅ Error handling comprehensive
  • ✅ Exit codes correct (0 success, 1 error)
3. Documentation
  • ✅ README explains philosophy and usage
  • ✅ QUICKSTART has common examples
  • ✅ --help text comprehensive
  • ✅ All flags/options documented
4. Code Quality
  • ✅ Type-safe throughout
  • ✅ Clean function separation
  • ✅ Error messages actionable
  • ✅ Configuration externalized
5. Integration
  • ✅ Follows LifeOS tech stack (Bun, TypeScript)
  • ✅ CLI-First Architecture principles
  • ✅ Deterministic output (JSON)
  • ✅ Composable with other tools

🎯 PHILOSOPHY

Why This Skill Exists

Developers repeatedly create CLIs for APIs and tools. Each time:

  1. Starts with bash script
  2. Realizes it needs error handling
  3. Realizes it needs help text
  4. Realizes it needs type safety
  5. Rewrites in TypeScript
  6. Adds documentation
  7. Now has production CLI

This skill automates steps 1-7.

The llcli Pattern

The llcli CLI (Limitless.ai API; retired 2026-07-15 when the backend moved to Bee — the pattern it proved lives on here) demonstrated this pattern works:

  • 327 lines of TypeScript
  • Zero dependencies (no framework)
  • Complete error handling
  • Comprehensive documentation
  • Production-ready immediately

This skill replicates that success.

Design Principles
  1. Start Simple - Default to Tier 1 (llcli-style)
  2. Escalate When Needed - Tier 2 only when justified
  3. Complete, Not Scaffold - Every CLI is production-ready
  4. Documentation First - README explains "why" not just "how"
  5. Type Safety - TypeScript strict mode always

  • development - For complex feature development (not CLI-specific)
  • mcp - For web scraping CLIs (Bright Data, Apify wrappers)
  • a lifelog skill - Example of a skill built on an official vendor CLI (bee)

This skill turns "I need a CLI for X" into production-ready tools in minutes, following proven patterns from llcli and CLI-First Architecture.

Gotchas

  • Always use bun, never npm/npx. Zero exceptions per system prompt.
  • TypeScript only. Never generate Python CLIs unless the user explicitly approves.
  • 3-tier system: Start with the simplest tier that fits. Don't over-engineer a Tier 3 CLI when Tier 1 suffices.

Execution Log

After completing any workflow, append a single JSONL entry:

echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"CreateCLI","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/LIFEOS/MEMORY/SKILLS/execution.jsonl

Replace WORKFLOW_USED with the workflow executed, 8_WORD_SUMMARY with a brief input description, and SECONDS with approximate wall-clock time. Log status: "error" if the workflow failed.

1---
2name: CreateCLI
3version: 1.1.25
4description: "Generates production-ready TypeScript CLIs via a 3-tier template system (manual arg parsing, Commander.js, oclif), each shipping full implementation, docs, package.json, strict config, JSON output, and exit-code compliance. USE WHEN create CLI, build CLI, command-line tool, wrap API, add command, upgrade tier, TypeScript CLI. NOT FOR LifeOS skill scaffolding (use CreateSkill)."
5---
6 
7## Customization
8 
9**Before executing, check for user customizations at:**
10`~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/CreateCLI/`
11 
12If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.
13 
14 
15## 🚨 MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)
16 
17**You MUST send this notification BEFORE doing anything else when this skill is invoked.**
18 
191. **Send voice notification**:
20 ```bash
21 curl -s -X POST http://localhost:31337/notify \
22 -H "Content-Type: application/json" \
23 -d '{"message": "Running the WORKFLOWNAME workflow in the CreateCLI skill to ACTION"}' \
24 > /dev/null 2>&1 &
25 ```
26 
272. **Output text notification**:
28 ```
29 Running the **WorkflowName** workflow in the **CreateCLI** skill to ACTION...
30 ```
31 
32**This is not optional. Execute this curl command immediately upon skill invocation.**
33 
34# CreateCLI
35 
36## What It Does
37 
38Generates production-ready TypeScript CLIs. Every CLI ships with full implementation, README and QUICKSTART, a Bun package.json, strict tsconfig, JSON output, and correct exit codes. A three-tier template system picks the right complexity: Tier 1 manual arg parsing with zero deps (most cases), Tier 2 Commander.js for subcommands, Tier 3 oclif as a reference for enterprise scale.
39 
40## The Problem
41 
42People build the same CLI from scratch over and over. It starts as a bash script, then needs error handling, then help text, then type safety, and ends up rewritten in TypeScript with docs bolted on at the end. Each round repeats the same boilerplate and the same mistakes. This skill takes that whole arc and produces a clean, typed, documented CLI in one pass, at the tier the job actually needs.
43 
44## How It Works
45 
46Generate production-ready TypeScript CLIs with documentation, type safety, error handling, and CLI-First Architecture principles.
47 
48---
49 
50 
51## Workflow Routing
52 
53Route to the appropriate workflow based on the request.
54 
55**When executing a workflow, output this notification directly:**
56 
57```
58Running the **WorkflowName** workflow in the **CreateCLI** skill to ACTION...
59```
60 
61| Workflow | Trigger | File |
62|----------|---------|------|
63| CreateCli | Create a new CLI tool from scratch | `Workflows/CreateCli.md` |
64| AddCommand | Add a new command to existing CLI | `Workflows/AddCommand.md` |
65| UpgradeTier | Upgrade CLI to higher tier | `Workflows/UpgradeTier.md` |
66 
67---
68 
69## 🚀 WHEN TO ACTIVATE THIS SKILL
70 
71Activate when you see these patterns:
72 
73### Direct Requests
74- "Create a CLI for [API/service/tool]"
75- "Build a command-line interface for X"
76- "Make a CLI that does Y"
77- "Generate a TypeScript CLI"
78- "I need a CLI tool for Z"
79 
80### Context Clues
81- User describes repetitive API calls → Suggest CLI
82- User mentions "I keep typing this command" → Suggest CLI wrapper
83- User has bash script doing complex work → Suggest TypeScript CLI replacement
84- User working with API that lacks official CLI → Suggest creating one
85 
86### Examples
87- ✅ "Create a CLI for the GitHub API"
88- ✅ "Build a command-line tool to process CSV files"
89- ✅ "Make a CLI for my database migrations"
90- ✅ "Generate a CLI that wraps this API"
91- ✅ "I need a tool like llcli but for Notion API"
92 
93---
94 
95## 💡 CORE CAPABILITIES
96 
97### Three-Tier Template System
98 
99**Tier 1: llcli-Style (DEFAULT - 80% of use cases)**
100- Manual argument parsing (process.argv)
101- Zero framework dependencies
102- Bun + TypeScript
103- Type-safe interfaces
104- ~300-400 lines total
105- **Perfect for:** API clients, data transformers, simple automation
106 
107**When to use Tier 1:**
108- ✅ 2-10 commands
109- ✅ Simple arguments (flags, values)
110- ✅ JSON output
111- ✅ No subcommands
112- ✅ Fast development
113 
114**Tier 2: Commander.js (ESCALATION - 15% of use cases)**
115- Framework-based parsing
116- Subcommands + nested options
117- Auto-generated help
118- Plugin-ready
119- **Perfect for:** Complex multi-command tools
120 
121**When to use Tier 2:**
122- ❌ 10+ commands needing grouping
123- ❌ Complex nested options
124- ❌ Plugin architecture
125- ❌ Multiple output formats
126 
127**Tier 3: oclif (REFERENCE ONLY - 5% of use cases)**
128- Documentation only (no templates)
129- Enterprise-grade plugin systems
130- **Perfect for:** Heroku CLI, Salesforce CLI scale (rare)
131 
132### What Every Generated CLI Includes
133 
134**1. Complete Implementation**
135- TypeScript source with full type safety
136- All commands functional and tested
137- Error handling with proper exit codes
138- Configuration management
139 
140**2. Comprehensive Documentation**
141- README.md with philosophy, usage, examples
142- QUICKSTART.md for common patterns
143- Inline help text (--help)
144- API response documentation
145 
146**3. Development Setup**
147- package.json (Bun configuration)
148- tsconfig.json (strict mode)
149- .env.example (configuration template)
150- File permissions configured
151 
152**4. Quality Standards**
153- Type-safe throughout
154- Deterministic output (JSON)
155- Composable (pipes to jq, grep)
156- Error messages with context
157- Exit code compliance
158 
159---
160 
161## 🏗️ INTEGRATION WITH LifeOS
162 
163### Technology Stack Alignment
164 
165Generated CLIs follow LifeOS standards:
166- ✅ **Runtime:** Bun (NOT Node.js)
167- ✅ **Language:** TypeScript (NOT JavaScript or Python)
168- ✅ **Package Manager:** Bun (NOT npm/yarn/pnpm)
169- ✅ **Testing:** Vitest (when tests added)
170- ✅ **Output:** Deterministic JSON (composable)
171- ✅ **Documentation:** README + QUICKSTART (llcli pattern)
172 
173### Repository Placement
174 
175Generated CLIs go to:
176- `~/.claude/LIFEOS/TOOLS/[cli-name]/` - Personal CLIs (like llcli)
177- `~/Projects/[project-name]/` - Project-specific CLIs
178- `${PROJECTS_DIR}/LIFEOS/Examples/clis/` - Example CLIs (PUBLIC repo)
179 
180**SAFETY:** Always verify repository location before git operations
181 
182### CLI-First Architecture Principles
183 
184Every generated CLI follows:
1851. **Deterministic** - Same input → Same output
1862. **Clean** - Single responsibility
1873. **Composable** - JSON output pipes to other tools
1884. **Documented** - Comprehensive help and examples
1895. **Testable** - Predictable behavior
190 
191---
192 
193## 📚 EXTENDED CONTEXT
194 
195**For detailed information, read these files:**
196 
197### Workflow Documentation
198- `Workflows/CreateCli.md` - Main CLI generation workflow (decision tree, 10-step process)
199- `Workflows/AddCommand.md` - Add commands to existing CLIs
200- `Workflows/UpgradeTier.md` - Migrate simple → complex
201 
202### Reference Documentation
203- `FrameworkComparison.md` - Manual vs Commander vs oclif (with research)
204- `Patterns.md` - Common CLI patterns (from llcli analysis)
205- `TypescriptPatterns.md` - Type safety patterns (from tsx, vite, bun research)
206 
207---
208 
209## 📖 EXAMPLES
210 
211### Example 1: API Client CLI (Tier 1)
212 
213**User Request:**
214"Create a CLI for the GitHub API that can list repos, create issues, and search code"
215 
216**Generated Structure:**
217```
218~/.claude/LIFEOS/TOOLS/ghcli/
219├── ghcli.ts # 350 lines, complete implementation
220├── package.json # Bun + TypeScript
221├── tsconfig.json # Strict mode
222├── .env.example # GITHUB_TOKEN=your_token
223├── README.md # Full documentation
224└── QUICKSTART.md # Common use cases
225```
226 
227**Usage:**
228```bash
229ghcli repos --user exampleuser
230ghcli issues create --repo myrepo --title "Bug fix"
231ghcli search "typescript CLI"
232ghcli --help
233```
234 
235---
236 
237### Example 2: File Processor (Tier 1)
238 
239**User Request:**
240"Build a CLI to convert markdown files to HTML with frontmatter extraction"
241 
242**Generated Structure:**
243```
244~/.claude/LIFEOS/TOOLS/md2html/
245├── md2html.ts
246├── package.json
247├── README.md
248└── QUICKSTART.md
249```
250 
251**Usage:**
252```bash
253md2html convert input.md output.html
254md2html batch *.md output/
255md2html extract-frontmatter post.md
256```
257 
258---
259 
260### Example 3: Data Pipeline (Tier 2)
261 
262**User Request:**
263"Create a CLI for data transformation with multiple formats, validation, and analysis commands"
264 
265**Generated Structure:**
266```
267~/.claude/LIFEOS/TOOLS/data-cli/
268├── data-cli.ts # Commander.js with subcommands
269├── package.json
270├── README.md
271└── QUICKSTART.md
272```
273 
274**Usage:**
275```bash
276data-cli convert json csv input.json
277data-cli validate schema data.json
278data-cli analyze stats data.csv
279data-cli transform filter --column=status --value=active
280```
281 
282---
283 
284## ✅ QUALITY STANDARDS
285 
286Every generated CLI must pass these gates:
287 
288### 1. Compilation
289- ✅ TypeScript compiles with zero errors
290- ✅ Strict mode enabled
291- ✅ No `any` types except justified
292 
293### 2. Functionality
294- ✅ All commands work as specified
295- ✅ Error handling comprehensive
296- ✅ Exit codes correct (0 success, 1 error)
297 
298### 3. Documentation
299- ✅ README explains philosophy and usage
300- ✅ QUICKSTART has common examples
301- ✅ --help text comprehensive
302- ✅ All flags/options documented
303 
304### 4. Code Quality
305- ✅ Type-safe throughout
306- ✅ Clean function separation
307- ✅ Error messages actionable
308- ✅ Configuration externalized
309 
310### 5. Integration
311- ✅ Follows LifeOS tech stack (Bun, TypeScript)
312- ✅ CLI-First Architecture principles
313- ✅ Deterministic output (JSON)
314- ✅ Composable with other tools
315 
316---
317 
318## 🎯 PHILOSOPHY
319 
320### Why This Skill Exists
321 
322Developers repeatedly create CLIs for APIs and tools. Each time:
3231. Starts with bash script
3242. Realizes it needs error handling
3253. Realizes it needs help text
3264. Realizes it needs type safety
3275. Rewrites in TypeScript
3286. Adds documentation
3297. Now has production CLI
330 
331**This skill automates steps 1-7.**
332 
333### The llcli Pattern
334 
335The `llcli` CLI (Limitless.ai API; retired 2026-07-15 when the backend moved to Bee — the pattern it proved lives on here) demonstrated this pattern works:
336- 327 lines of TypeScript
337- Zero dependencies (no framework)
338- Complete error handling
339- Comprehensive documentation
340- Production-ready immediately
341 
342**This skill replicates that success.**
343 
344### Design Principles
345 
3461. **Start Simple** - Default to Tier 1 (llcli-style)
3472. **Escalate When Needed** - Tier 2 only when justified
3483. **Complete, Not Scaffold** - Every CLI is production-ready
3494. **Documentation First** - README explains "why" not just "how"
3505. **Type Safety** - TypeScript strict mode always
351 
352---
353 
354## 🔗 RELATED SKILLS
355 
356- **development** - For complex feature development (not CLI-specific)
357- **mcp** - For web scraping CLIs (Bright Data, Apify wrappers)
358- **a lifelog skill** - Example of a skill built on an official vendor CLI (bee)
359 
360---
361 
362**This skill turns "I need a CLI for X" into production-ready tools in minutes, following proven patterns from llcli and CLI-First Architecture.**
363 
364## Gotchas
365 
366- **Always use bun, never npm/npx.** Zero exceptions per system prompt.
367- **TypeScript only.** Never generate Python CLIs unless the user explicitly approves.
368- **3-tier system:** Start with the simplest tier that fits. Don't over-engineer a Tier 3 CLI when Tier 1 suffices.
369 
370## Execution Log
371 
372After completing any workflow, append a single JSONL entry:
373 
374```bash
375echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"CreateCLI","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/LIFEOS/MEMORY/SKILLS/execution.jsonl
376```
377 
378Replace `WORKFLOW_USED` with the workflow executed, `8_WORD_SUMMARY` with a brief input description, and `SECONDS` with approximate wall-clock time. Log `status: "error"` if the workflow failed.
379 

Discussion