CLI tool development skill. Activates when building, polishing, or distributing command-line interfaces and terminal user interfaces. Covers argument parsing design (Commander, Clap, Cobra, Click), interactive prompts and TUI frameworks (Ink, Ratatui, Bubbletea, Rich), configuration management (config files, environment variables, XDG), shell completion generation, distribution strategies (npm, Homebrew, cargo, pip), and CLI UX best practices. Every recommendation includes concrete implementation and cross-platform considerations. Triggers on: /godmode:cli, "CLI tool", "command line", "terminal app", "TUI", "argument parser", "shell completion".
From godmodenpx claudepluginhub arbazkhan971/godmodeThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
/godmode:cliDetermine the CLI development approach:
CLI PROJECT ASSESSMENT:
Project type: <new CLI | adding CLI to existing project | TUI application>
Language: <Node.js/TypeScript | Rust | Go | Python | other>
Complexity: <simple (few commands) | medium (subcommands) | complex (TUI/interactive)>
Argument parsing:
Node.js: <Commander | yargs | meow | oclif>
Rust: <Clap (derive) | Clap (builder) | argh>
Go: <Cobra | urfave/cli | kong>
Python: <Click | Typer | argparse | Fire>
Interactive features:
Prompts: <yes (inquirer/dialoguer/survey/questionary) | no>
Progress bars: <yes | no>
Spinners: <yes | no>
TYPESCRIPT CLI STRUCTURE:
├── src/
│ ├── index.ts # Entry point, argument parsing setup
│ ├── commands/ # Subcommand implementations
│ │ ├── init.ts # `tool init` command
│ │ ├── build.ts # `tool build` command
│ │ └── deploy.ts # `tool deploy` command
│ ├── lib/ # Core business logic
│ │ ├── config.ts # Configuration loading/saving
│ │ ├── api.ts # API client (if needed)
│ │ └── utils.ts # Shared utilities
│ ├── ui/ # Terminal UI components
│ │ ├── spinner.ts # Loading spinner
│ │ ├── prompt.ts # Interactive prompts
│ │ └── table.ts # Table formatting
RUST CLI STRUCTURE:
├── src/
│ ├── main.rs # Entry point, clap setup
│ ├── cli.rs # CLI argument definitions (Clap derive)
│ ├── commands/ # Subcommand implementations
│ │ ├── mod.rs
│ │ ├── init.rs # `tool init` handler
│ │ ├── build.rs # `tool build` handler
│ │ └── deploy.rs # `tool deploy` handler
│ ├── config.rs # Configuration (serde + toml/yaml)
│ ├── error.rs # Error types (thiserror)
│ └── ui.rs # Terminal output (indicatif, console)
├── tests/ # Integration tests
│ └── cli_tests.rs # CLI invocation tests (assert_cmd)
├── completions/ # Generated shell completions
GO CLI STRUCTURE:
├── cmd/
│ ├── root.go # Root command (Cobra)
│ ├── init.go # `tool init` command
│ ├── build.go # `tool build` command
│ └── deploy.go # `tool deploy` command
├── internal/ # Private packages
│ ├── config/ # Configuration management
│ │ └── config.go
│ ├── ui/ # Terminal UI utilities
│ │ ├── spinner.go
│ │ └── table.go
│ └── client/ # API client (if needed)
│ └── client.go
├── pkg/ # Public library code (if any)
PYTHON CLI STRUCTURE:
├── src/
│ └── tool/
│ ├── __init__.py # Package init
│ ├── __main__.py # python -m tool entry
│ ├── cli.py # Click/Typer app definition
│ ├── commands/ # Subcommand implementations
│ │ ├── __init__.py
│ │ ├── init.py # `tool init` command
│ │ ├── build.py # `tool build` command
│ │ └── deploy.py # `tool deploy` command
│ ├── config.py # Configuration management
│ └── ui.py # Rich console output
├── tests/ # Pytest tests
│ ├── test_cli.py # CLI invocation tests
ARGUMENT DESIGN PRINCIPLES:
Command hierarchy:
tool <command> <subcommand> [options] [arguments]
tool init # Simple command
tool deploy --env production # Command with option
tool config set key value # Subcommand with positional args
Naming conventions:
Commands: verb or noun (init, build, deploy, config, list)
Flags: --long-form with short aliases (-v / --verbose)
Boolean flags: --flag (enable), --no-flag (disable)
Value flags: --output <path>, --format <json|table|csv>
Standard flags (include in every CLI):
INTERACTIVE PROMPT PATTERNS:
Text input:
? Project name: <user types>
Validation: non-empty, valid characters, no conflicts
Select (single choice):
? Framework:
> React
Vue
Svelte
Navigation: arrow keys, type to filter
Multi-select:
? Features:
CONFIGURATION STRATEGY:
File format selection:
TOML: best for human-edited config (Rust ecosystem standard)
YAML: best for structured config (DevOps ecosystem standard)
JSON: best for machine-generated config (universal support)
INI: legacy, avoid for new projects
XDG Base Directory compliance (Linux/macOS):
Config: $XDG_CONFIG_HOME/tool/config.toml (~/.config/tool/config.toml)
Data: $XDG_DATA_HOME/tool/ (~/.local/share/tool/)
Cache: $XDG_CACHE_HOME/tool/ (~/.cache/tool/)
State: $XDG_STATE_HOME/tool/ (~/.local/state/tool/)
Windows paths:
SHELL COMPLETION SETUP:
Bash:
Generate: tool completion bash > /usr/local/etc/bash_completion.d/tool
Or: tool completion bash >> ~/.bashrc
Mechanism: complete -F / complete -C
Zsh:
Generate: tool completion zsh > "${fpath[1]}/_tool"
Or add to .zshrc: eval "$(tool completion zsh)"
Mechanism: compdef / _arguments
Fish:
Generate: tool completion fish > ~/.config/fish/completions/tool.fish
Mechanism: complete -c tool -s <short> -l <long> -d <description>
DISTRIBUTION STRATEGIES:
npm (Node.js):
Publish: npm publish
Install: npm install -g tool / npx tool
Config:
package.json:
"bin": { "tool": "./bin/tool.js" }
"files": ["dist", "bin"]
Users get: automatic dependency resolution, easy updates
Homebrew (macOS/Linux):
Create formula or tap:
brew tap org/tools
brew install org/tools/tool
CLI PROJECT — <tool name>
Language: <TypeScript | Rust | Go | Python>
Parser: <Commander | Clap | Cobra | Click>
Complexity: <simple | subcommands | TUI>
Commands:
<command>: <IMPLEMENTED | TESTED | DOCUMENTED>
<command>: <IMPLEMENTED | TESTED | DOCUMENTED>
Features:
Shell completions: <bash | zsh | fish | powershell | all>
Config file: <TOML | YAML | JSON | none>
Interactive prompts: <YES | NO>
"cli: <language> — <tool> CLI scaffold with <parser>""cli: <command> — implement <description>""cli: distribution — <package manager> packaging"/godmode:ship to publish."/godmode:build to implement commands."# Test CLI tool end-to-end
npm test -- --grep "cli"
node dist/cli.js --help
node dist/cli.js --version
echo '{}' | node dist/cli.js --json # pipe test
IF command execution > 5 seconds: add progress indicator. WHEN exit code != 0: write to stderr, not stdout. IF --json output is invalid JSON: treat as P1 bug.
| Flag | Description |
|---|---|
| (none) | Full CLI project assessment and setup |
--interactive | Focus on interactive prompts and TUI |
--completion | Shell completion generation only |
Never ask to continue. Loop autonomously until all commands pass tests and shell completions are generated.
--help, --version, and --no-color.--yes / --no-input for CI.timestamp command status tests_passing completions distribution
On activation, automatically detect project context without asking:
AUTO-DETECT:
1. Language:
ls package.json 2>/dev/null && echo "node"
ls Cargo.toml 2>/dev/null && echo "rust"
KEEP if: improvement verified. DISCARD if: regression or no change. Revert discards immediately.
Stop when: target reached, budget exhausted, or >5 consecutive discards.