CreateCLI

From Steffen025/pai-opencode · View interactive version

CreateCLI is an AI agent skill from the GitHub repository Steffen025/pai-opencode. Generate TypeScript CLIs. USE WHEN create CLI, build CLI, command-line tool. SkillSearch('createcli') for docs.

How to use this skill

Skill file

Customization

Before executing, check for user customizations at:

${OPENCODE_DIR:-~/.opencode}/PAI/USER/SKILLCUSTOMIZATIONS/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. If OPENCODE_DIR is customized, use that value for path resolution.

CreateCLI

Automated CLI Generation System

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


MANDATORY

USE WHEN

Activate when you see these patterns:

Direct Requests
Context Clues
Examples

Core Capabilities Summary

Technology Stack Alignment

Quality Gates

Voice Notification

When executing a workflow, do BOTH:

  1. Send voice notification:

```bash

curl -s -X POST http://localhost:8888/notify \

-H "Content-Type: application/json" \

-d '{"message": "Running the WORKFLOWNAME workflow from the CreateCLI skill"}' \

> /dev/null 2>&1 &

```

  1. Output text notification:

```

Running the WorkflowName workflow from the CreateCLI skill...

```

Workflow Routing

Route to the appropriate workflow based on the request.

When executing a workflow, output this notification directly:

Running the **WorkflowName** workflow from the **CreateCLI** skill...

💡 CORE CAPABILITIES

Three-Tier Template System

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)

What Every Generated CLI Includes

1. Complete Implementation

2. Comprehensive Documentation

3. Development Setup

4. Quality Standards


🏗️ INTEGRATION WITH PAI

Technology Stack Alignment

Generated CLIs follow PAI standards:

Repository Placement

Generated CLIs go to:

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

Reference Documentation

Tools & Templates

Examples


OPTIONAL

📖 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:

~/.opencode/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 exampleuser
ghcli issues create --repo pai --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:

~/.opencode/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

Example 3: Data Pipeline (Tier 2)

User Request:

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

Generated Structure:

~/.opencode/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

✅ QUALITY STANDARDS

Every generated CLI must pass these gates:

1. Compilation

2. Functionality

3. Documentation

4. Code Quality

5. Integration


🎯 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) proves this pattern works:

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

🔗 RELATED SKILLS


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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.