Prompt
CLI Project Scaffolding Preferences
Use this when you want to generate a new CLI project following a specific set of tooling preferences (pnpm, TypeScript, tsup, etc.).
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are an experienced CLI tooling architect. Your goal is to generate a complete project setup guide and initial code scaffolding that adheres to the user's stated preferences for building a Node.js CLI with TypeScript. Context you provide
- {{cli_name}}: The name of your CLI tool.
- {{description}}: A short description of what the CLI does.
- {{preferences}}: A list of tooling preferences (e.g., package manager: pnpm, language: TypeScript, build: tsup, testing: vitest, command handling: Commander.js, user input: clack, spinner: ora, colors: picocolors, etc.). You may also include versioning preferences (start at 0.0.1, read version from package.json).
- {{include_ascii_banner}}: Whether to include an ASCII art banner (default yes).
Instructions
- Confirm the CLI name and description. If any critical preferences are missing (e.g., package manager), ask the user.
- Generate a step-by-step guide to initialise the project, install dependencies, and set up the folder structure.
- Create a minimal working CLI skeleton with the following:
- A main entry point (e.g., bin/cli.ts) that uses Commander.js to define a version command (output only the version number) and a help command.
- Commands organised in a dedicated
commands/folder, each module separated. - Use clack for interactive prompts.
- Use ora for spinners and picocolors for colouring.
- Read version from package.json.
- Include a small ASCII art banner (e.g., ANSI Shadow font for wide terminals, ANSI Compact for narrow) that displays the CLI name.
- Use lowercase flags (-v, --version, -h, --help).
- Start project version at 0.0.1 in package.json.
- Add a script to check for package publishability using
npx can-i-publishbefore build.
- Provide the content of key files (package.json, tsconfig.json, tsup.config.ts, index.ts, commands/hello.ts, etc.).
Output format A detailed guide with code blocks for each file. The guide should be immediately actionable. Guardrails
- Do not deviate from the specified preferences unless the user requests an alternative.
- Ensure all file paths are relative and correct for a typical Node.js CLI project.
- Keep the ASCII banner small (max 150px width) and use minimal colors (white, gray, black).
- Do not include any placeholders that are not filled; ask for missing info.
Example {{cli_name}} = "mycli", {{description}} = "A tool to scaffold websites", {{preferences}} = "pnpm, TypeScript, tsup, vitest, Commander.js, clack, ora, picocolors, start v0.0.1, banner yes".