jpskill.com
🛠️ 開発・MCP コミュニティ

inquirer

Inquirer.jsを使って、ユーザーが対話的に操作できるコマンドラインツールを作り、設定や入力フォームなどを簡単に作成して、CLI上でスムーズなユーザー体験を提供するSkill。

📜 元の英語説明(参考)

Build interactive CLI prompts with Inquirer.js. Use when creating interactive terminal UIs, multi-step wizards, form-like CLI inputs, or configuration generators with user input.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Inquirer.jsを使って、ユーザーが対話的に操作できるコマンドラインツールを作り、設定や入力フォームなどを簡単に作成して、CLI上でスムーズなユーザー体験を提供するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o inquirer.zip https://jpskill.com/download/15010.zip && unzip -o inquirer.zip && rm inquirer.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15010.zip -OutFile "$d\inquirer.zip"; Expand-Archive "$d\inquirer.zip" -DestinationPath $d -Force; ri "$d\inquirer.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して inquirer.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → inquirer フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Inquirer.js

概要

Inquirer は CLI のためのインタラクティブなプロンプトを提供します — テキスト入力、確認、リスト、チェックボックス、パスワード、そしてエディタです。v2 API はモジュール化されており(必要なものだけをインポートします)、テーマ、バリデーション、そして変換をサポートします。

手順

ステップ 1: プロンプト

import { input, select, confirm, checkbox, password } from '@inquirer/prompts'

// バリデーション付きのテキスト入力
const name = await input({
  message: 'プロジェクト名:',
  validate: (v) => v.length >= 2 || 'Name must be at least 2 characters',
})

// 単一選択
const framework = await select({
  message: 'フレームワークを選択:',
  choices: [
    { name: 'Next.js', value: 'nextjs', description: 'フルスタック React' },
    { name: 'Remix', value: 'remix', description: 'Web 標準重視' },
    { name: 'Astro', value: 'astro', description: 'コンテンツファースト' },
  ],
})

// 複数選択
const features = await checkbox({
  message: '機能を選択:',
  choices: [
    { name: 'TypeScript', value: 'typescript', checked: true },
    { name: 'ESLint', value: 'eslint', checked: true },
    { name: 'Tailwind CSS', value: 'tailwind' },
    { name: 'Database (Prisma)', value: 'prisma' },
    { name: 'Auth (NextAuth)', value: 'auth' },
  ],
})

// 確認
const proceed = await confirm({ message: 'プロジェクトを作成しますか?', default: true })

// パスワード (マスク)
const apiKey = await password({ message: 'API キーを入力:', mask: '*' })

ステップ 2: 複数ステップのウィザード

async function setupWizard() {
  console.log('🚀 プロジェクト設定ウィザード\n')

  const projectName = await input({ message: 'プロジェクト名:' })
  const template = await select({
    message: 'テンプレート:',
    choices: [
      { name: 'SaaS Starter', value: 'saas' },
      { name: 'Blog', value: 'blog' },
      { name: 'E-commerce', value: 'ecommerce' },
    ],
  })

  const features = await checkbox({
    message: '機能:',
    choices: getFeatureChoices(template),    // テンプレートに基づいて動的
  })

  const useDocker = await confirm({ message: 'Docker を追加しますか?', default: false })

  console.log('\n📋 概要:')
  console.log(`  Name: ${projectName}`)
  console.log(`  Template: ${template}`)
  console.log(`  Features: ${features.join(', ')}`)

  const ok = await confirm({ message: '\n実行しますか?', default: true })
  if (!ok) { console.log('キャンセルされました。'); process.exit(0) }

  return { projectName, template, features, useDocker }
}

ガイドライン

  • レガシーな inquirer パッケージではなく、個々のプロンプト (@inquirer/prompts) をインポートしてください。
  • 入力バリデーションには validate を使用してください — true またはエラーメッセージの文字列を返します。
  • 選択肢の description は、オプション名の下にヒントテキストを表示します。
  • 非インタラクティブな環境 (CI) の場合は、フラグ経由で設定を受け入れ、プロンプトをスキップしてください。
  • 引数パースには Commander を、インタラクティブモードには Inquirer を組み合わせて使用してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Inquirer.js

Overview

Inquirer provides interactive prompts for CLIs — text input, confirmations, lists, checkboxes, passwords, and editors. The v2 API is modular (import only what you use) and supports themes, validation, and transformations.

Instructions

Step 1: Prompts

import { input, select, confirm, checkbox, password } from '@inquirer/prompts'

// Text input with validation
const name = await input({
  message: 'Project name:',
  validate: (v) => v.length >= 2 || 'Name must be at least 2 characters',
})

// Single select
const framework = await select({
  message: 'Choose a framework:',
  choices: [
    { name: 'Next.js', value: 'nextjs', description: 'Full-stack React' },
    { name: 'Remix', value: 'remix', description: 'Web standards focused' },
    { name: 'Astro', value: 'astro', description: 'Content-first' },
  ],
})

// Multi-select
const features = await checkbox({
  message: 'Select features:',
  choices: [
    { name: 'TypeScript', value: 'typescript', checked: true },
    { name: 'ESLint', value: 'eslint', checked: true },
    { name: 'Tailwind CSS', value: 'tailwind' },
    { name: 'Database (Prisma)', value: 'prisma' },
    { name: 'Auth (NextAuth)', value: 'auth' },
  ],
})

// Confirmation
const proceed = await confirm({ message: 'Create project?', default: true })

// Password (masked)
const apiKey = await password({ message: 'Enter API key:', mask: '*' })

Step 2: Multi-Step Wizard

async function setupWizard() {
  console.log('🚀 Project Setup Wizard\n')

  const projectName = await input({ message: 'Project name:' })
  const template = await select({
    message: 'Template:',
    choices: [
      { name: 'SaaS Starter', value: 'saas' },
      { name: 'Blog', value: 'blog' },
      { name: 'E-commerce', value: 'ecommerce' },
    ],
  })

  const features = await checkbox({
    message: 'Features:',
    choices: getFeatureChoices(template),    // dynamic based on template
  })

  const useDocker = await confirm({ message: 'Add Docker?', default: false })

  console.log('\n📋 Summary:')
  console.log(`  Name: ${projectName}`)
  console.log(`  Template: ${template}`)
  console.log(`  Features: ${features.join(', ')}`)

  const ok = await confirm({ message: '\nProceed?', default: true })
  if (!ok) { console.log('Cancelled.'); process.exit(0) }

  return { projectName, template, features, useDocker }
}

Guidelines

  • Import individual prompts (@inquirer/prompts) not the legacy inquirer package.
  • Use validate for input validation — return true or error message string.
  • description in choices shows hint text below the option name.
  • For non-interactive environments (CI), accept config via flags and skip prompts.
  • Pair with Commander for argument parsing + Inquirer for interactive mode.