Back to Skills

inquirer-patterns

verified

Interactive prompt patterns for CLI tools with text, list, checkbox, password, autocomplete, and conditional questions. Use when building CLIs with user input, creating interactive prompts, implementing questionnaires, or when user mentions inquirer, prompts, interactive input, CLI questions, user prompts.

View on GitHub

Marketplace

cli-builder

vanman2024/cli-builder

Plugin

cli-builder

development

Repository

vanman2024/cli-builder

plugins/cli-builder/skills/inquirer-patterns/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/vanman2024/cli-builder/blob/main/plugins/cli-builder/skills/inquirer-patterns/SKILL.md -a claude-code --skill inquirer-patterns

Installation paths:

Claude
.claude/skills/inquirer-patterns/
Powered by add-skill CLI

Instructions

# Inquirer Patterns

Comprehensive interactive prompt patterns for building CLI tools with rich user input capabilities. Provides templates for text, list, checkbox, password, autocomplete, and conditional questions in both Node.js and Python.

## Instructions

### When Building Interactive CLI Prompts

1. **Identify prompt type needed:**
   - Text input: Simple string input
   - List selection: Single choice from options
   - Checkbox: Multiple selections
   - Password: Secure input (hidden)
   - Autocomplete: Type-ahead suggestions
   - Conditional: Questions based on previous answers

2. **Choose language:**
   - **Node.js**: Use templates in `templates/nodejs/`
   - **Python**: Use templates in `templates/python/`

3. **Select appropriate template:**
   - `text-prompt.js/py` - Basic text input
   - `list-prompt.js/py` - Single selection list
   - `checkbox-prompt.js/py` - Multiple selections
   - `password-prompt.js/py` - Secure password input
   - `autocomplete-prompt.js/py` - Type-ahead suggestions
   - `conditional-prompt.js/py` - Dynamic questions based on answers
   - `comprehensive-example.js/py` - All patterns combined

4. **Install required dependencies:**
   - **Node.js**: Run `scripts/install-nodejs-deps.sh`
   - **Python**: Run `scripts/install-python-deps.sh`

5. **Test prompts:**
   - Use examples in `examples/nodejs/` or `examples/python/`
   - Run validation script: `scripts/validate-prompts.sh`

6. **Customize for your CLI:**
   - Copy relevant template sections
   - Modify questions, choices, validation
   - Add custom conditional logic

### Node.js Implementation

**Library**: `inquirer` (v9.x)

**Installation**:
```bash
npm install inquirer
```

**Basic Usage**:
```javascript
import inquirer from 'inquirer';

const answers = await inquirer.prompt([
  {
    type: 'input',
    name: 'username',
    message: 'Enter your username:',
    validate: (input) => input.length > 0 || 'Username required'
  }
]);

console.log(`Hello, ${answers.username}!`)

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
11189 chars