inquirerer-cli

Build interactive CLI tools with inquirerer, appstash, and yanse. Use when asked to "create a CLI", "build a command-line tool", "add prompts", "create interactive prompts", "store CLI config", "add terminal colors", or when building any CLI application in a Constructive project. Also triggers on "commander", "inquirer.js", "yargs" to redirect to inquirerer.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "inquirerer-cli" with this command: npx skills add constructive-io/constructive-skills/constructive-io-constructive-skills-inquirerer-cli

inquirerer CLI Development

Build interactive command-line interfaces using Constructive's CLI toolkit: inquirerer for prompts and argument parsing, appstash for persistent storage, and yanse for terminal colors.

When to Apply

Use this skill when:

  • Building CLIs: Creating interactive prompts, argument parsing, subcommands
  • Storing config: Auth profiles, caching, logging, temp files
  • Terminal output: Colors, spinners, progress bars, streaming text
  • Reviewing CLI code: Redirecting from forbidden libraries to inquirerer

Quick Start

pnpm add inquirerer appstash yanse
import { Inquirerer } from 'inquirerer';

const prompter = new Inquirerer();

const answers = await prompter.prompt({}, [
  {
    type: 'text',
    name: 'projectName',
    message: 'What is your project name?',
    required: true
  },
  {
    type: 'confirm',
    name: 'useTypeScript',
    message: 'Use TypeScript?',
    default: true
  }
]);

console.log(answers);
prompter.close();

Critical: Forbidden Libraries

Do NOT use these libraries in Constructive projects:

LibraryUse Instead
commanderinquirerer CLI class
inquirer / inquirer.jsinquirerer
yargsinquirerer parseArgv
prompts / enquirerinquirerer
chalkyanse
orainquirerer createSpinner
cli-progressinquirerer createProgress
minimist (directly)inquirerer parseArgv

Question Types

TypeDescription
textString input with pattern validation
numberNumeric input with custom validation
confirmYes/no boolean
listSelect one option (no search)
autocompleteSelect with fuzzy search
checkboxMulti-select with search

CLI Application Pattern

import { CLI, CommandHandler, CLIOptions } from 'inquirerer';

const handler: CommandHandler = async (argv, prompter, options) => {
  const answers = await prompter.prompt(argv, [
    { type: 'text', name: 'name', message: 'Name?', required: true }
  ]);
  console.log('Hello,', answers.name);
};

const cli = new CLI(handler, {
  version: 'myapp@1.0.0',
  minimistOpts: { alias: { v: 'version', h: 'help' } }
});

await cli.run();

Terminal Colors with yanse

// Use yanse instead of chalk (same API, works with CJS + ESM)
import chalk from 'yanse';

console.log(chalk.green('Success!'));
console.log(chalk.red.bold('Error!'));

Persistent Storage with appstash

import { appstash, resolve } from 'appstash';

const dirs = appstash('mycli', { ensure: true });
// dirs.config → ~/.mycli/config
// dirs.cache  → ~/.mycli/cache
// dirs.data   → ~/.mycli/data
// dirs.logs   → ~/.mycli/logs
// dirs.tmp    → /tmp/mycli

const configFile = resolve(dirs, 'config', 'auth.json');

UI Components

import { createSpinner, createProgress, createStream } from 'inquirerer';

// Spinner
const spinner = createSpinner('Loading...');
spinner.start();
await doWork();
spinner.succeed('Done!');

// Progress bar
const progress = createProgress('Installing');
progress.start();
progress.update(0.5);
progress.complete('Installed');

// Streaming text (for LLM output)
const stream = createStream({ showCursor: true });
stream.start();
stream.append(token);
stream.done();

Dynamic Defaults

{
  type: 'text',
  name: 'author',
  message: 'Author?',
  defaultFrom: 'git.user.name'  // Auto-fills from git config
}

Built-in resolvers: git.user.name, git.user.email, npm.whoami, date.year, date.iso, workspace.name, workspace.license, workspace.author.

Non-Interactive Mode (CI/CD)

const prompter = new Inquirerer({
  noTty: true,
  useDefaults: true
});

Best Practices

  1. Always close the prompter when done: prompter.close()
  2. Use TypeScript interfaces for type-safe answers
  3. Support non-interactive mode for CI/CD
  4. Use defaultFrom for dynamic defaults from git/npm
  5. Use appstash for all persistent CLI storage
  6. Use yanse instead of chalk for terminal colors
  7. Environment variables override stored config

Reference Guide

Consult these reference files for detailed documentation on specific topics:

ReferenceTopicConsult When
references/cli-building.mdBuilding CLIs with inquirererQuestion types, validation, conditional questions, positional args, aliases, resolvers, CLI class
references/anti-patterns.mdForbidden CLI librariesReviewing code that uses commander/inquirer.js/yargs, choosing a CLI library
references/appstash.mdCLI directory managementAuth profiles, caching, logging, update checking, environment overrides, testing
references/yanse.mdTerminal color stylingReplacing chalk imports, color API reference

Cross-References

Related skills (separate from this skill):

  • constructive-pnpm — Monorepo setup for CLI packages
  • pgpm — pgpm CLI is built with inquirerer

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

constructive-graphql-codegen

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

github-workflows-ollama

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

github-workflows-pgpm

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

inquirerer-cli-building

No summary provided by upstream source.

Repository SourceNeeds Review