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 GitHubvanman2024/cli-builder
cli-builder
plugins/cli-builder/skills/inquirer-patterns/SKILL.md
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/vanman2024/cli-builder/blob/main/plugins/cli-builder/skills/inquirer-patterns/SKILL.md -a claude-code --skill inquirer-patternsInstallation paths:
.claude/skills/inquirer-patterns/# 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}!`)