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.
More coding prompts
- CursorAdd File Upload with Cloud StorageMulti-file upload with type checking, size limits, virus scanning, cloud storage, and progress tracking.
- CursorAdd Redis Caching LayerCache-aside Redis caching with typed get/set helpers, TTL management, pattern-based invalidation, and monitoring.
- CursorAdd Stripe Payment IntegrationComplete Stripe checkout, webhooks, subscription management, and billing portal with idempotent webhook handling.
- LovableBooking and Scheduling SystemCalendar-based booking with availability management, confirmations, reminders, and payment collection.
- CursorBuild Admin Dashboard with CRUDData table with server-side CRUD, column sorting and filtering, bulk actions, and role-protected admin panel.
- CursorBuild Data Export FeatureExport large datasets to CSV or Excel with streaming for memory efficiency, background jobs, and signed download links.

