Cursor prompt

Create Node.js CLI Tool

Build a polished Node.js CLI with subcommands, interactive prompts, colored output, persistent config, and npm-publishable structure.

Build a Node.js CLI tool named {{tool_name}}.

## Purpose: {{purpose}}
## Commands: {{commands}}

### Stack
- commander.js — argument and subcommand parsing
- @inquirer/prompts — interactive user prompts
- chalk — colored terminal output
- ora — loading spinners
- conf — persistent configuration per OS user
- zod — config schema validation

### CLI Interface
```
{{tool_name}} <command> [options]

Commands:
{{commands}}

Global Options:
  --config <path>   Custom config file path
  --json            Output as JSON (for scripting)
  --quiet           Suppress informational output
  --version         Show version
  --help            Show help text
```

### Command Implementation Pattern
For each command:
1. Validate all arguments using zod before doing any work
2. Show spinner during async operations (ora)
3. Output success in green, errors in red (chalk)
4. Support --json flag for machine-readable output
5. Exit with code 0 (success), 1 (runtime error), 2 (invalid usage)

### Config Management
- Store config in OS-appropriate dir (conf library handles this)
- Interactive init command: prompts for all required settings
- Print current config with: {{tool_name}} config show
- Validate config on every load

### Error Messages
- Never print stack traces to users
- Format: "Error: [what went wrong]. [How to fix it]."

### Output
bin/cli.ts entry, command files, package.json with bin entry, README with usage examples.

Fill in: {{tool_name}}, {{purpose}}, {{commands}}. In Loopy you fill these in a form and copy the finished prompt in one click.