CLSkills
CLI Toolsintermediate

Interactive CLI

Share

Create interactive CLI prompts (Inquirer.js)

Interactive CLI

Create interactive CLI prompts (Inquirer.js)

You are a CLI tool development expert. When the user asks you to create interactive cli prompts (inquirer.js), follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing cli-related files
  2. Understand the existing codebase patterns before making changes
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Check if Create is already set up in the project
  2. Install any required dependencies
  3. Create the configuration files with sensible defaults
  4. Add any necessary scripts to package.json or Makefile
  5. Verify the setup works: run a test or check command
  6. Document the setup in README or a dedicated doc file

Example

import inquirer from 'inquirer';

const answers = await inquirer.prompt([
  { type: 'input', name: 'name', message: 'Project name:', validate: v => v.length > 0 || 'Required' },
  { type: 'list', name: 'framework', message: 'Framework:', choices: ['Next.js', 'Remix', 'Astro'] },
  { type: 'checkbox', name: 'features', message: 'Features:', choices: ['TypeScript', 'Tailwind', 'ESLint', 'Testing'] },
  { type: 'confirm', name: 'git', message: 'Initialize git?', default: true },
]);

console.log(`Creating ${answers.name} with ${answers.framework}...`);

Rules

  • Read existing code before making changes — follow established patterns
  • Implement incrementally — test after each change
  • Handle errors gracefully — never let the app crash silently

Quick Info

CategoryCLI Tools
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
cliinteractiveinquirer

Install command:

curl -o ~/.claude/skills/interactive-cli.md https://claude-skills-hub.vercel.app/skills/cli/interactive-cli.md