Generate a complete CLI tool project with argument parsing, interactive prompts, colored output, configuration files, and npm/pip publishing setup.
## ROLE You are a developer tools engineer who has built and published CLI tools used by thousands of developers. You understand that great CLI tools are discoverable (helpful --help), forgiving (suggest corrections for typos), fast (instant startup), and beautiful (colored output, progress bars, spinners). You build CLIs that feel as polished as tools from Vercel, GitHub, or Stripe. ## CONTEXT CLI tools are experiencing a renaissance — developers increasingly prefer well-designed CLI interfaces over web dashboards for development workflows. But building a polished CLI from scratch requires surprising effort: argument parsing with validation, subcommand routing, interactive prompts for missing arguments, configuration file loading from multiple locations, colored and formatted output, progress indication for long operations, and graceful error handling. A good boilerplate provides all of this out of the box. ## TASK Generate a complete CLI tool boilerplate: 1. **Argument Parsing**: Set up a CLI argument parser (Commander.js, yargs, or Clap) with: typed arguments and options, subcommand support, automatic --help generation with examples, argument validation, and default values from environment variables or config files. 2. **Interactive Mode**: Add interactive prompts (Inquirer.js, Prompts, or Dialoguer) that activate when required arguments are missing: text input, single select, multi-select, confirmation, and password input. The CLI should work both interactively and non-interactively (for scripting). 3. **Output Formatting**: Configure beautiful terminal output: colored text (chalk/kleur), tables for structured data (cli-table3), progress bars and spinners for long operations, success/warning/error formatting, and JSON output mode for machine consumption. 4. **Configuration System**: Implement configuration file loading: look for config in current directory (.toolrc, .tool.json, tool.config.js), then home directory, then XDG config directory. Support merging configs (project overrides global). Show the configuration schema. 5. **Error Handling**: Implement user-friendly error handling: catch all errors, display formatted error messages with suggested fixes, exit with appropriate codes (0 for success, 1 for user error, 2 for system error), and debug mode (--debug) that shows stack traces. 6. **Logging**: Add structured logging: different verbosity levels (--quiet, default, --verbose, --debug), log to stderr (not stdout, to preserve pipe compatibility), and file logging for debugging. 7. **Update Notifications**: Add a check for newer versions (update-notifier pattern) that notifies the user non-intrusively when a new version is available. 8. **Publishing Setup**: Configure for publishing: package.json with bin field, README with usage examples, changelog, semantic versioning, GitHub Actions for automated publishing on tag, and npm/crates.io/PyPI configuration. ## INFORMATION ABOUT ME - [CLI TOOL PURPOSE — WHAT IT DOES] - [PROGRAMMING LANGUAGE] (TypeScript/Node.js, Rust, Python, Go) - [KEY COMMANDS/SUBCOMMANDS] - [DISTRIBUTION METHOD] (npm, pip, homebrew, standalone binary) ## RESPONSE FORMAT Deliver: complete project structure, CLI entry point with argument parsing, example subcommand implementation, configuration system, and publishing workflow. Include a README template with installation and usage instructions.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[PROGRAMMING LANGUAGE][DISTRIBUTION METHOD]