{"owner":"SBoudrias","repo":"Inquirer.js","hasSkills":true,"totalSkillsCount":20,"totalTokensCount":32091,"categories":["root-instruction","claude-rule","plugin-manifest"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","CLAUDE.md","packages/ansi/README.md","packages/checkbox/README.md","packages/confirm/README.md","packages/core/README.md","packages/editor/README.md","packages/expand/README.md","packages/external-editor/README.md","packages/input/README.md","packages/inquirer/README.md","packages/number/README.md","packages/password/README.md","packages/prompts/README.md","packages/rawlist/README.md","packages/search/README.md","packages/select/README.md","packages/testing/README.md","tools/isolate-monorepo-package/README.md","tools/package/README.md"],"skills":{"AGENTS.md":"# Repository Guidelines\n\n## Project Structure & Module Organization\n\nThe repo is a Yarn workspaces monorepo. Core runtime logic shared primitives and shared primitives live in `packages/core/src`, and individual prompt implementations under `packages/<prompt>/src`. Testing utilities sit in `packages/testing`, while `packages/demo` provides the interactive showcase. Integration suites reside in `integration/cjs` and `integration/esm` to verify bundling. Tooling scripts and repo wiring (tsconfig, release helpers) live in `tools/`. Treat `packages/*/dist` and `tools/*/dist` as generated output.\n\n## Build, Test, and Development Commands\n\nInstall deps with `yarn install`. Use `yarn dev` for Turbo-powered incremental TypeScript builds. Launch the playground with `yarn demo`. Run `yarn tsc` for a project-wide compile. Execute `yarn pretest` for lint, format, and type gates, then `yarn test` for Vitest unit coverage followed by Node integration tests. After adding or moving workspaces, run `yarn setup` to refresh shared TS references.\n\n## Coding Style & Naming Conventions\n\nCode is ESM-first TypeScript targeting Node ≥ 18. Prettier enforces two-space indentation, trailing commas, and single quotes—lean on it rather than hand formatting. Prefer named exports, keep prompt IDs aligned with folder names, and store assets beside their entry points. Use `camelCase` for variables/functions and `PascalCase` for classes/components. Run `yarn oxlint --fix` and `yarn eslint --fix` before committing to maintain rule compliance.\n\n## TypeScript Best Practices\n\nPrioritize type safety and leverage existing types from the codebase. Use `Question<A>` from `packages/inquirer/src/types.ts` instead of generic `Record<string, unknown>` when working with question objects. Prefer `unknown` over `any` for truly unknown types, and use `Partial<T>` for optional properties. Leverage generic type parameters (like `<A extends Answers>`) throughout to maintain type consistency. Avoid eslint-disable comments by refactoring to proper types rather than suppressing warnings. When extending types, use intersection types (`Type & { prop: T }`) for explicit signatures rather than casting to `any`.\n\n## Testing Guidelines\n\nVitest owns unit coverage via `vitest.config.ts`, with `coverage.all = true` so untested files fail CI. Co-locate specs as `*.test.ts` next to source, and model cross-package flows under `integration/**/**/*.test.ts`. Iterate with `yarn vitest --run packages`, then finish with `yarn test` to exercise the full matrix. Update snapshots using `yarn vitest --update`.\n\nKeep tests simple and focused. Reuse existing test stubs and fixtures rather than creating custom mocks. If a behavior affects all prompts, test it with an existing prompt type rather than creating a specialized stub. Write tests that verify actual behavior rather than implementation details. Prefer straightforward assertions over complex validation logic.\n\n## Package-Specific Code Style\n\n### Type Declarations\n\nPrefer `type` over `interface` for all object shapes. Never prefix type names with `I` (no `IEditorParams`, `IFileOptions`). Use descriptive names without Hungarian notation: `EditorParams`, `FileOptions`.\n\n### Node.js Built-in Imports\n\nAlways use the `node:` protocol prefix for Node.js built-in modules: `import { spawn } from 'node:child_process'`, `import { readFileSync } from 'node:fs'`. This is enforced by linting.\n\n### Error Classes\n\nModel custom error classes after the style in `packages/core/src/lib/errors.ts`:\n\n- Declare `override name = 'ErrorName'` as a class field (not set in the constructor).\n- Pass `{ cause: originalError }` to `super()` to populate `this.cause` per the standard `Error` API.\n- Do not add a separate `originalError` instance field.\n- Do not include copyright header comments.\n\n### Async Patterns\n\nAll async operations must be Promise-based. Do not use Node-style callbacks `(err, result) => void`. Do not use `setImmediate` to defer callbacks; use `await` and `Promise` directly. Wrap event-emitter-based APIs (like `child_process.spawn`) in `new Promise(...)`.\n\n### Test File Location\n\nUnit tests must be co-located as `*.test.ts` files beside their source files inside `src/`. Separate `test/` directories are not used.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commit prefixes such as `feat:`, `fix:`, `docs:`, or `chore:`; keep scopes lowercase (`feat(@inquirer/package-name): add fuzzy search`). Summaries should stay imperative and under 80 characters. Pull requests must describe the change, list the commands run (for example `yarn test`), and link issues or discussions. Attach terminal recordings or screenshots for UX-facing changes, and ensure lockfiles and generated readme fragments stay current.\n","CLAUDE.md":"Read @AGENTS.md\n","packages/ansi/README.md":"# @inquirer/ansi\n\nA lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/ansi\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/ansi\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\n```js\nimport {\n  cursorUp,\n  cursorDown,\n  cursorTo,\n  cursorLeft,\n  cursorHide,\n  cursorShow,\n  eraseLines,\n} from '@inquirer/ansi';\n\n// Move cursor up 3 lines\nprocess.stdout.write(cursorUp(3));\n\n// Move cursor to specific position (x: 10, y: 5)\nprocess.stdout.write(cursorTo(10, 5));\n\n// Hide/show cursor\nprocess.stdout.write(cursorHide);\nprocess.stdout.write(cursorShow);\n\n// Clear 5 lines\nprocess.stdout.write(eraseLines(5));\n```\n\nOr when used inside an inquirer prompt:\n\n```js\nimport { cursorHide } from '@inquirer/ansi';\nimport { createPrompt } from '@inquirer/core';\n\nexport default createPrompt((config, done: (value: void) => void) => {\n  return `Choose an option${cursorHide}`;\n});\n```\n\n## API\n\n### Cursor Movement\n\n- **`cursorUp(count?: number)`** - Move cursor up by `count` lines (default: 1)\n- **`cursorDown(count?: number)`** - Move cursor down by `count` lines (default: 1)\n- **`cursorTo(x: number, y?: number)`** - Move cursor to position (x, y). If y is omitted, only moves horizontally\n- **`cursorLeft`** - Move cursor to beginning of line\n\n### Cursor Visibility\n\n- **`cursorHide`** - Hide the cursor\n- **`cursorShow`** - Show the cursor\n\n### Screen Manipulation\n\n- **`eraseLines(count: number)`** - Clear `count` lines and position cursor at the beginning of the first cleared line\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/checkbox/README.md":"# `@inquirer/checkbox`\n\nSimple interactive command line prompt to display a list of checkboxes (multi select).\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/checkbox\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/checkbox\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { checkbox, Separator } from '@inquirer/prompts';\n// Or\n// import checkbox, { Separator } from '@inquirer/checkbox';\n\nconst answer = await checkbox({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    new Separator(),\n    { name: 'pnpm', value: 'pnpm', disabled: true },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property  | Type                                    | Required | Description                                                                                                                                                                                           |\n| --------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message   | `string`                                | yes      | The question to ask                                                                                                                                                                                   |\n| choices   | `Choice[]`                              | yes      | List of the available choices.                                                                                                                                                                        |\n| pageSize  | `number`                                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                           |\n| loop      | `boolean`                               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.                                                                     |\n| required  | `boolean`                               | no       | When set to `true`, ensures at least one choice must be selected.                                                                                                                                     |\n| validate  | `async (Choice[]) => boolean \\| string` | no       | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| shortcuts | [See Shortcuts](#Shortcuts)             | no       | Customize shortcut keys for `all` and `invert`.                                                                                                                                                       |\n| theme     | [See Theming](#Theming)                 | no       | Customize look of the prompt.                                                                                                                                                                         |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  checkedName?: string;\n  description?: string;\n  short?: string;\n  checked?: boolean;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await checkbox()`.\n- `name`: This is the string displayed in the choice list.\n- `checkedName`: Alternative `name` (or format) displayed when the choice is checked.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `checked`: If `true`, the option will be checked by default.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nAlso note the `choices` array can contain `Separator`s to help organize long lists.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Shortcuts\n\nYou can customize the shortcut keys for `all` and `invert` or disable them by setting them to `null`.\n\n```ts\ntype Shortcuts = {\n  all?: string | null; // default: 'a'\n  invert?: string | null; // default: 'i'\n};\n```\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n    disabledChoice: (text: string) => string;\n    description: (text: string) => string;\n    renderSelectedChoices: <T>(\n      selectedChoices: ReadonlyArray<Choice<T>>,\n      allChoices: ReadonlyArray<Choice<T> | Separator>,\n    ) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    checked: string;\n    unchecked: string;\n    cursor: string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/confirm/README.md":"# `@inquirer/confirm`\n\nSimple interactive command line prompt to gather boolean input from users.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/confirm\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/confirm\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { confirm } from '@inquirer/prompts';\n// Or\n// import confirm from '@inquirer/confirm';\n\nconst answer = await confirm({ message: 'Continue?' });\n```\n\n## Options\n\n| Property    | Type                    | Required | Description                                             |\n| ----------- | ----------------------- | -------- | ------------------------------------------------------- |\n| message     | `string`                | yes      | The question to ask                                     |\n| default     | `boolean`               | no       | Default answer (true or false)                          |\n| transformer | `(boolean) => string`   | no       | Transform the prompt printed message to a custom string |\n| theme       | [See Theming](#Theming) | no       | Customize look of the prompt.                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/core/README.md":"# `@inquirer/core`\n\nThe `@inquirer/core` package is the library enabling the creation of Inquirer prompts.\n\nIt aims to implements a lightweight API similar to React hooks - but without JSX.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/core\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/core\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n## Basic concept\n\nVisual terminal apps are at their core strings rendered onto the terminal.\n\nThe most basic prompt is a function returning a string that'll be rendered in the terminal. This function will run every time the prompt state change, and the new returned string will replace the previously rendered one. The prompt cursor appears after the string.\n\nWrapping the rendering function with `createPrompt()` will setup the rendering layer, inject the state management utilities, and wait until the `done` callback is called.\n\n```ts\nimport { createPrompt } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  // Implement logic\n\n  return '? My question';\n});\n\n// And it is then called as\nconst answer = await input({/* config */});\n```\n\n## Hooks\n\nState management and user interactions are handled through hooks. Hooks are common [within the React ecosystem](https://react.dev/reference/react/hooks), and Inquirer reimplement the common ones.\n\n### State hook\n\nState lets a component “remember” information like user input. For example, an input prompt can use state to store the input value, while a list prompt can use state to track the cursor index.\n\n`useState` declares a state variable that you can update directly.\n\nThe setter also accepts an updater function to compute the next state from the current one (mirroring React):\n\n```ts\nconst [index, setIndex] = useState(0);\n\nsetIndex((current) => current + 1);\n```\n\n```ts\nimport { createPrompt, useState } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  const [index, setIndex] = useState(0);\n\n  // ...\n```\n\n### Keypress hook\n\nAlmost all prompts need to react to user actions. In a terminal, this is done through typing.\n\n`useKeypress` allows you to react to keypress events, and access the prompt line.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key) => {\n    if (key.name === 'enter') {\n      done(answer);\n    }\n  });\n\n  // ...\n```\n\nBehind the scenes, Inquirer prompts are wrappers around [readlines](https://nodejs.org/api/readline.html). Aside the keypress event object, the hook also pass the active readline instance to the event handler.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key, readline) => {\n    setValue(readline.line);\n  });\n\n  // ...\n```\n\n### Ref hook\n\nRefs let a prompt hold some information that isn’t used for rendering, like a class instance or a timeout ID. Unlike with state, updating a ref does not re-render your prompt. Refs are an “escape hatch” from the rendering paradigm.\n\n`useRef` declares a ref. You can hold any value in it, but most often it’s used to hold a timeout ID.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const timeout = useRef(null);\n\n  // ...\n```\n\n### Effect Hook\n\nEffects let a prompt connect to and synchronize with external systems. This includes dealing with network or animations.\n\n`useEffect` connects a component to an external system.\n\n```ts\nconst chat = createPrompt((config, done) => {\n  useEffect(() => {\n    const connection = createConnection(roomId);\n    connection.connect();\n    return () => connection.disconnect();\n  }, [roomId]);\n\n  // ...\n```\n\n### Performance hook\n\nA common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell Inquirer to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render.\n\n`useMemo` lets you cache the result of an expensive calculation.\n\n```ts\nconst todoSelect = createPrompt((config, done) => {\n  const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]);\n\n  // ...\n```\n\n### Rendering hooks\n\n#### Prefix / loading\n\nAll default prompts, and most custom ones, uses a prefix at the beginning of the prompt line. This helps visually delineate different questions, and provides a convenient area to render a loading spinner.\n\n`usePrefix` is a built-in hook to do this.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const prefix = usePrefix({ status });\n\n  return `${prefix} My question`;\n});\n```\n\n#### Pagination\n\nWhen looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options.\n\nPagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`.\n\n```js\nexport default createPrompt((config, done) => {\n  const [active, setActive] = useState(0);\n\n  const allChoices = config.choices.map((choice) => choice.name);\n\n  const page = usePagination({\n    items: allChoices,\n    active: active,\n    renderItem: ({ item, index, isActive }) => `${isActive ? \">\" : \" \"}${index}. ${item.toString()}`\n    pageSize: config.pageSize,\n    loop: config.loop,\n  });\n\n  return `... ${page}`;\n});\n```\n\n## `createPrompt()` API\n\nAs we saw earlier, the rendering function should return a string, and eventually call `done` to close the prompt and return the answer.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const [value, setValue] = useState();\n\n  useKeypress((key, readline) => {\n    if (key.name === 'enter') {\n      done(answer);\n    } else {\n      setValue(readline.line);\n    }\n  });\n\n  return `? ${config.message} ${value}`;\n});\n```\n\nThe rendering function can also return a tuple of 2 string (`[string, string]`.) The first string represents the prompt. The second one is content to render under the prompt, like an error message. The text input cursor will appear after the first string.\n\n```ts\nconst number = createPrompt((config, done) => {\n  // Add some logic here\n\n  return [`? My question ${input}`, `! The input must be a number`];\n});\n```\n\n### Typescript\n\nIf using typescript, `createPrompt` takes 2 generic arguments.\n\n```ts\n// createPrompt<Value, Config>\nconst input = createPrompt<string, { message: string }>(// ...\n```\n\nThe first one is the type of the resolved value\n\n```ts\nconst answer: string = await input();\n```\n\nThe second one is the type of the prompt config; in other words the interface the created prompt will provide to users.\n\n```ts\nconst answer = await input({\n  message: 'My question',\n});\n```\n\n## Key utilities\n\nListening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean:\n\n- `isEnterKey()`\n- `isBackspaceKey()`\n- `isSpaceKey()`\n- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`)\n- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`)\n- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally. Prompt-level `theme.keybindings` values override the environment variable.\n\n## Theming\n\nTheming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts.\n\nTo allow standard customization:\n\n```ts\nimport { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.style.highlight('hello')}`;\n});\n```\n\nTo setup a custom theme:\n\n```ts\nimport { createPrompt, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptTheme = {};\n\nconst promptTheme: PromptTheme = {\n  icon: '!',\n};\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme<PromptTheme>>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(promptTheme, config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.icon}`;\n});\n```\n\nThe [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts):\n\n```ts\ntype DefaultTheme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n  };\n};\n```\n\n# Examples\n\nYou can refer to any `@inquirer/prompts` prompts for real examples:\n\n- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts)\n- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts)\n- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts)\n- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts)\n- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts)\n- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts)\n- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts)\n- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts)\n\n```ts\nimport { styleText } from 'node:util';\nimport {\n  createPrompt,\n  useState,\n  useKeypress,\n  isEnterKey,\n  usePrefix,\n  type Status,\n} from '@inquirer/core';\n\nconst confirm = createPrompt<boolean, { message: string; default?: boolean }>(\n  (config, done) => {\n    const [status, setStatus] = useState<Status>('idle');\n    const [value, setValue] = useState('');\n    const prefix = usePrefix({});\n\n    useKeypress((key, rl) => {\n      if (isEnterKey(key)) {\n        const answer = value ? /^y(es)?/i.test(value) : config.default !== false;\n        setValue(answer ? 'yes' : 'no');\n        setStatus('done');\n        done(answer);\n      } else {\n        setValue(rl.line);\n      }\n    });\n\n    let formattedValue = value;\n    let defaultValue = '';\n    if (status === 'done') {\n      formattedValue = styleText('cyan', value);\n    } else {\n      defaultValue = styleText('dim', config.default === false ? ' (y/N)' : ' (Y/n)');\n    }\n\n    const message = styleText('bold', config.message);\n    return `${prefix} ${message}${defaultValue} ${formattedValue}`;\n  },\n);\n\n/**\n *  Which then can be used like this:\n */\nconst answer = await confirm({ message: 'Do you want to continue?' });\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/editor/README.md":"# `@inquirer/editor`\n\nPrompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line.\n\nThe editor launched is the one [defined by the user's `EDITOR` environment variable](https://dev.to/jonasbn/til-integrate-visual-studio-code-with-shell--cli-2l1l).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/editor\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { editor } from '@inquirer/prompts';\n// Or\n// import editor from '@inquirer/editor';\n\nconst answer = await editor({\n  message: 'Enter a description',\n});\n```\n\n## Options\n\n| Property         | Type                                                                           | Required               | Description                                                                                                                                                                                                                            |\n| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message          | `string`                                                                       | yes                    | The question to ask                                                                                                                                                                                                                    |\n| default          | `string`                                                                       | no                     | Default value which will automatically be present in the editor                                                                                                                                                                        |\n| validate         | `string => boolean \\| string \\| Promise<boolean \\| string>`                    | no                     | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                  |\n| postfix          | `string`                                                                       | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.                                                                                                                     |\n| file             | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no                     | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file.                                                                                         |\n| waitForUserInput | `boolean`                                                                      | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |\n| theme            | [See Theming](#Theming)                                                        | no                     | Customize look of the prompt.                                                                                                                                                                                                          |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    key: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to the default value or empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/expand/README.md":"# `@inquirer/expand`\n\nCompact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/expand\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/expand\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { expand } from '@inquirer/prompts';\n// Or\n// import expand from '@inquirer/expand';\n\nconst answer = await expand({\n  message: 'Conflict on file.js',\n  default: 'y',\n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite',\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all',\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff',\n    },\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                               |\n| -------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                       |\n| choices  | `Choice[]`              | yes      | Array of the different allowed choices. The `h`/help option is always provided by default |\n| default  | `string`                | no       | Default choices to be selected. (value must be one of the choices `key`)                  |\n| expanded | `boolean`               | no       | Expand the choices by default                                                             |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                             |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  key: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await expand()`.\n- `name`: The string displayed in the choice list. It'll default to the stringify `value`.\n- `key`: The input the use must provide to select the choice. Must be a lowercase single alphanumeric character string.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    highlight: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/external-editor/README.md":"# `@inquirer/external-editor`\n\nA Node.js module to edit a string with the user's preferred text editor using $VISUAL or $EDITOR.\n\n> [!NOTE]\n> This package is a replacement for the unmaintained `external-editor`. It includes security fixes.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/external-editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/external-editor\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\nA simple example using the `edit` function\n\n```ts\nimport { edit } from '@inquirer/external-editor';\n\nconst data = edit('\\n\\n# Please write your text above');\nconsole.log(data);\n```\n\nExample relying on the class construct\n\n```ts\nimport {\n  ExternalEditor,\n  CreateFileError,\n  ReadFileError,\n  RemoveFileError,\n  LaunchEditorError,\n} from '@inquirer/external-editor';\n\ntry {\n  const editor = new ExternalEditor();\n  const text = editor.run(); // the text is also available in editor.text\n\n  if (editor.lastExitStatus !== 0) {\n    console.log('The editor exited with a non-zero code');\n  }\n\n  // Do things with the text\n  editor.cleanup();\n} catch (err) {\n  if (err instanceof CreateFileError) {\n    console.log('Failed to create the temporary file');\n  } else if (err instanceof ReadFileError) {\n    console.log('Failed to read the temporary file');\n  } else if (err instanceof LaunchEditorError) {\n    console.log('Failed to launch your editor');\n  } else if (err instanceof RemoveFileError) {\n    console.log('Failed to remove the temporary file');\n  } else {\n    throw err;\n  }\n}\n```\n\n### Windows editor commands\n\nOn Windows, prefer setting `$VISUAL` or `$EDITOR` to the editor executable\nrather than a `.cmd` or `.bat` shim. This package launches the editor directly\ninstead of through a shell so editor arguments and temporary file paths are not\ninterpreted as shell commands.\n\nFor example, use `Code.exe` with `--wait` instead of `code.cmd`:\n\n```powershell\nsetx VISUAL '\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" --wait'\n```\n\n#### API\n\n**Convenience Functions**\n\n- `edit(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - **Returns** (string) The contents of the file\n  - Could throw `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError`\n- `editAsync(text, callback, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `callback` (function (error?, text?))\n    - `error` could be of type `CreateFileError`, `ReadFileError`, `LaunchEditorError`, or `RemoveFileError`\n    - `text` (string) The contents of the file\n  - `config` (Config) _Optional_ Options for temporary file creation\n\n**Errors**\n\n- `CreateFileError` Error thrown if the temporary file could not be created.\n- `ReadFileError` Error thrown if the temporary file could not be read.\n- `RemoveFileError` Error thrown if the temporary file could not be removed during cleanup.\n- `LaunchEditorError` Error thrown if the editor could not be launched.\n\n**External Editor Public Methods**\n\n- `new ExternalEditor(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - Could throw `CreateFileError`\n- `run()` Launches the editor.\n  - **Returns** (string) The contents of the file\n  - Could throw `LaunchEditorError` or `ReadFileError`\n- `runAsync(callback)` Launches the editor in an async way\n  - `callback` (function (error?, text?))\n    - `error` could be of type `ReadFileError` or `LaunchEditorError`\n    - `text` (string) The contents of the file\n- `cleanup()` Removes the temporary file.\n  - Could throw `RemoveFileError`\n\n**External Editor Public Properties**\n\n- `text` (string) _readonly_ The text in the temporary file.\n- `editor.bin` (string) The editor determined from the environment.\n- `editor.args` (array) Default arguments for the bin\n- `tempFile` (string) Path to temporary file. Can be changed, but be careful as the temporary file probably already\n  exists and would need be removed manually.\n- `lastExitStatus` (number) The last exit code emitted from the editor.\n\n**Config Options**\n\n- `prefix` (string) _Optional_ A prefix for the file name.\n- `postfix` (string) _Optional_ A postfix for the file name. Useful if you want to provide an extension.\n- `mode` (number) _Optional_ Which mode to create the file with. e.g. 644\n- `dir` (string) _Optional_ Which path to store the file.\n\n## Why Synchronous?\n\nEverything is synchronous to make sure the editor has complete control of the stdin and stdout. Testing has shown\nasync launching of the editor can lead to issues when using readline or other packages which try to read from stdin or\nwrite to stdout. Seeing as this will be used in an interactive CLI environment, I made the decision to force the package\nto be synchronous. If you know a reliable way to force all stdin and stdout to be limited only to the child_process,\nplease submit a PR.\n\nIf async is really needed, you can use `editAsync` or `runAsync`. If you are using readline or have anything else\nlistening to the stdin or you write to stdout, you will most likely have problem, so make sure to remove any other\nlisteners on stdin, stdout, or stderr.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s.png)](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s)\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/input/README.md":"# `@inquirer/input`\n\nInteractive free text input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/input\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/input\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n// Or\n// import input from '@inquirer/input';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property     | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| ------------ | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| default      | `string`                                                    | no       | Default value if no answer is provided; see the prefill option below for governing it's behaviour.                                                                                                                      |\n| prefill      | `'tab' \\| 'editable'`                                       | no       | Defaults to `'tab'`. If set to `'tab'`, pressing `backspace` will clear the default and pressing `tab` will inline the value for edits; If set to `'editable'`, the default value will already be inlined to edit.      |\n| required     | `boolean`                                                   | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                 |\n| transformer  | `(string, { isFinal: boolean }) => string`                  | no       | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed.                                   |\n| validate     | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| pattern      | `RegExp`                                                    | no       | Regular expression to validate the input against. If the input doesn't match the pattern, validation will fail with the error message specified in `patternError`.                                                      |\n| patternError | `string`                                                    | no       | Error message to display when the input doesn't match the `pattern`. Defaults to `'Invalid input'`.                                                                                                                     |\n| theme        | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to an empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/inquirer/README.md":"<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer.js\n\n[![npm](https://badge.fury.io/js/inquirer.svg)](https://www.npmjs.com/package/inquirer)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n> [!IMPORTANT]\n> This is the legacy version of Inquirer.js. While it still receives maintenance, it is not actively developed. For the new Inquirer, see [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts).\n\n## Table of Contents\n\n1.  [Documentation](#documentation)\n    1.  [Installation](#installation)\n    2.  [Examples](#examples)\n    3.  [Methods](#methods)\n    4.  [Objects](#objects)\n    5.  [Question](#question)\n    6.  [Answers](#answers)\n    7.  [Separator](#separator)\n    8.  [Prompt Types](#prompt-types)\n2.  [User Interfaces and Layouts](#user-interfaces-and-layouts)\n    1.  [Reactive Interface](#reactive-interface)\n3.  [Support](#support)\n4.  [Known issues](#issues)\n5.  [News](#news)\n6.  [Contributing](#contributing)\n7.  [License](#license)\n8.  [Plugins](#plugins)\n\n## Goal and Philosophy\n\n**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the \"CLI [Xanadu](https://en.wikipedia.org/wiki/Citizen_Kane)\").\n\n**`Inquirer.js`** should ease the process of\n\n- providing _error feedback_\n- _asking questions_\n- _parsing_ input\n- _validating_ answers\n- managing _hierarchical prompts_\n\n> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [commander](https://github.com/visionmedia/commander.js), [vorpal](https://github.com/dthree/vorpal) or [args](https://github.com/leo/args).\n\n## [Documentation](#documentation)\n\n<a name=\"documentation\"></a>\n\n### Installation\n\n<a name=\"installation\"></a>\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install inquirer\n```\n\n</td>\n<td>\n\n```sh\nyarn add inquirer\n```\n\n</td>\n</tr>\n</table>\n\n```javascript\nimport inquirer from 'inquirer';\n\ninquirer\n  .prompt([/* Pass your questions in here */])\n  .then((answers) => {\n    // Use user feedback for... whatever!!\n  })\n  .catch((error) => {\n    if (error.isTtyError) {\n      // Prompt couldn't be rendered in the current environment\n    } else {\n      // Something else went wrong\n    }\n  });\n```\n\n<a name=\"examples\"></a>\n\n### Examples (Run it and see it)\n\nCheck out the [`packages/inquirer/examples/`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer/examples) folder for code and interface examples.\n\n```shell\nyarn node packages/inquirer/examples/pizza.js\nyarn node packages/inquirer/examples/checkbox.js\n# etc...\n```\n\n### Methods\n\n<a name=\"methods\"></a>\n\n> [!WARNING]\n> Those interfaces are not necessary for modern Javascript, while still maintained, they're depreciated. We highly encourage you to adopt the more ergonomic and modern API with [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts). Both `inquirer` and `@inquirer/prompts` are usable at the same time, so you can progressively migrate.\n\n#### `inquirer.prompt(questions, answers) -> promise`\n\nLaunch the prompt interface (inquiry session)\n\n- **questions** a [Question Object](#question), an array or map of questions, or an RxJS-compatible Observable of questions\n- **answers** (object) contains values of already answered questions. Inquirer will avoid asking answers already provided here. Defaults `{}`.\n- returns a **Promise**\n\n#### `inquirer.registerPrompt(name, prompt)`\n\nRegister prompt plugins under `name`.\n\n- **name** (string) name of the this new prompt. (used for question `type`)\n- **prompt** (object) the prompt object itself (the plugin)\n\n#### `inquirer.createPromptModule() -> prompt function`\n\nCreate a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types.\n\n```js\nconst prompt = inquirer.createPromptModule();\n\nprompt(questions).then(/* ... */);\n```\n\n### Objects\n\n<a name=\"objects\"></a>\n\n#### Question\n\n<a name=\"questions\"></a>\nA question object is a `hash` containing question related values:\n\n- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `number`, `confirm`, `list`, `rawlist`, `expand`, `checkbox`, `password`, `editor`\n- **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash.\n- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon).\n- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.\n- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers.\n  Array values can be simple `numbers`, `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash), and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator).\n- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided.\n- **filter**: (Function) Receive the user input and answers hash. Returns the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash.\n- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash.\n- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean.\n- **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`.\n- **prefix**: (String) Change the default _prefix_ message.\n- **suffix**: (String) Change the default _suffix_ message.\n- **askAnswered**: (Boolean) Force to prompt the question if the answer already exists.\n- **loop**: (Boolean) Enable list looping. Defaults: `true`\n- **waitUserInput**: (Boolean) Flag to enable/disable wait for user input before opening system editor - Defaults: `true`\n\n`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value.\n\n```javascript\n{\n  /* Preferred way: with promise */\n  filter() {\n    return new Promise(/* etc... */);\n  },\n\n  /* Legacy way: with this.async */\n  validate: function (input) {\n    // Declare function as asynchronous, and save the done callback\n    const done = this.async();\n\n    // Do async stuff\n    setTimeout(function() {\n      if (typeof input !== 'number') {\n        // Pass the return value in the done callback\n        done('You need to provide a number');\n      } else {\n        // Pass the return value in the done callback\n        done(null, true);\n      }\n    }, 3000);\n  }\n}\n```\n\n### Answers\n\n<a name=\"answers\"></a>\nA key/value hash containing the client answers in each prompt.\n\n- **Key** The `name` property of the _question_ object\n- **Value** (Depends on the prompt)\n  - `confirm`: (Boolean)\n  - `input` : User input (filtered if `filter` is defined) (String)\n  - `number`: User input (filtered if `filter` is defined) (Number)\n  - `rawlist`, `list` : Selected choice value (or name if no value specified) (String)\n\n### Separator\n\n<a name=\"separator\"></a>\nA separator can be added to any `choices` array:\n\n```\n// In the question object\nchoices: [ \"Choice A\", new inquirer.Separator(), \"choice B\" ]\n\n// Which'll be displayed this way\n[?] What do you want to do?\n > Order a pizza\n   Make a reservation\n   --------\n   Ask opening hours\n   Talk to the receptionist\n```\n\nThe constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`.\n\nSeparator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists.\n\n<a name=\"prompt\"></a>\n\n### Prompt types\n\n---\n\n> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._\n\n#### List - `{type: 'list'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` or `value` of one of the entries in `choices`)\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n---\n\n#### Raw List - `{type: 'rawlist'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` of one of the entries in `choices`)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n---\n\n#### Expand - `{type: 'expand'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`] properties.\nNote: `default` must be the `index` of the desired default selection of the array. If `default` key not provided, then `help` will be used as default choice\n\nNote that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user.\n\nSee `examples/expand.js` for a running example.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n---\n\n#### Checkbox - `{type: 'checkbox'}`\n\nTake `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`, `loop`] properties. `default` is expected to be an Array of the checked choices value.\n\nChoices marked as `{checked: true}` will be checked by default.\n\nChoices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `\"Disabled\"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string.\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n---\n\n#### Confirm - `{type: 'confirm'}`\n\nTake `type`, `name`, `message`, [`default`, `transformer`] properties. `default` is expected to be a boolean if used.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n---\n\n#### Input - `{type: 'input'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n---\n\n#### Input - `{type: 'number'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n---\n\n#### Password - `{type: 'password'}`\n\nTake `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n---\n\nNote that `mask` is required to hide the actual user input.\n\n#### Editor - `{type: 'editor'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `postfix`, `waitUserInput`] properties\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the contents of the temporary file are read in as the result. The editor to use is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used.\n\nThe `postfix` property is useful if you want to provide an extension.\n\n<a name=\"layouts\"></a>\n\n### Use in Non-Interactive Environments\n\n`prompt()` requires that it is run in an interactive environment. (I.e. [One where `process.stdin.isTTY` is `true`](https://nodejs.org/docs/latest-v12.x/api/process.html#process_a_note_on_process_i_o)). If `prompt()` is invoked outside of such an environment, then `prompt()` will return a rejected promise with an error. For convenience, the error will have a `isTtyError` property to programmatically indicate the cause.\n\n<a name=\"reactive\"></a>\n\n## Reactive interface\n\n`inquirer.prompt()` accepts an RxJS-compatible Observable of questions. This supports dynamic flows where questions are emitted over time:\n\n```js\nconst prompts = new Rx.Subject();\ninquirer.prompt(prompts);\n\n// At some point in the future, push new questions\nprompts.next({/* question... */});\nprompts.next({/* question... */});\n\n// When you're done\nprompts.complete();\n```\n\nAnd using the return value `process` property, you can access more fine grained callbacks:\n\n```js\ninquirer.prompt(prompts).ui.process.subscribe(onEachAnswer, onError, onComplete);\n```\n\n## Support (OS Terminals)\n\n<a name=\"support\"></a>\n\nYou should expect mostly good support for the CLI below. This does not mean we won't\nlook at issues found on other command line - feel free to report any!\n\n- **Mac OS**:\n  - Terminal.app\n  - iTerm\n- **Windows ([Known issues](#issues))**:\n  - [Windows Terminal](https://github.com/microsoft/terminal)\n  - [ConEmu](https://conemu.github.io/)\n  - cmd.exe\n  - Powershell\n  - Cygwin\n- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**:\n  - gnome-terminal (Terminal GNOME)\n  - konsole\n\n## Known issues\n\n<a name=\"issues\"></a>\n\n- **nodemon** - Makes the arrow keys print gibrish on list prompts.\n  Workaround: Add `{ stdin : false }` in the configuration file or pass `--no-stdin` in the CLI.\n  Please refer to [this issue](https://github.com/SBoudrias/Inquirer.js/issues/844#issuecomment-736675867)\n\n- **grunt-exec** - Calling a node script that uses Inquirer from grunt-exec can cause the program to crash. To fix this, add to your grunt-exec config `stdio: 'inherit'`.\n  Please refer to [this issue](https://github.com/jharding/grunt-exec/issues/85)\n\n- **Windows network streams** - Running Inquirer together with network streams in Windows platform inside some terminals can result in process hang.\n  Workaround: run inside another terminal.\n  Please refer to [this issue](https://github.com/nodejs/node/issues/21771)\n\n## News on the march (Release notes)\n\n<a name=\"news\"></a>\n\nPlease refer to the [GitHub releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases)\n\n## Contributing\n\n<a name=\"contributing\"></a>\n\n**Unit test**\nPlease add a unit test for every new feature or bug fix. `yarn test` to run the test suite.\n\n**Documentation**\nAdd documentation for every API change. Feel free to send typo fixes and better docs!\n\nWe're looking to offer good support for multiple prompts and environments. If you want to\nhelp, we'd like to keep a list of testers for each terminal/OS so we can contact you and\nget feedback before release. Let us know if you want to be added to the list (just tweet\nto [@vaxilart](https://twitter.com/Vaxilart)) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers)\n\n## License\n\n<a name=\"license\"></a>\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n## Plugins\n\n<a name=\"plugins\"></a>\n\nYou can build custom prompts, or use open sourced ones. See [`@inquirer/core` documentation for building custom prompts](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\nYou can either call the custom prompts directly (preferred), or you can register them (depreciated):\n\n```js\nimport customPrompt from '$$$/custom-prompt';\n\n// 1. Preferred solution with new plugins\nconst answer = await customPrompt({ ...config });\n\n// 2. Depreciated interface (or for old plugins)\ninquirer.registerPrompt('custom', customPrompt);\nconst answers = await inquirer.prompt([\n  {\n    type: 'custom',\n    ...config,\n  },\n]);\n```\n\nWhen using Typescript and `registerPrompt`, you'll also need to define your prompt signature. Since Typescript is static, we cannot infer available plugins from function calls.\n\n```ts\nimport customPrompt from '$$$/custom-prompt';\n\ndeclare module 'inquirer' {\n  interface QuestionMap {\n    // 1. Easiest option\n    custom: Parameters<typeof customPrompt>[0];\n\n    // 2. Or manually define the prompt config\n    custom_alt: { message: string; option: number[] };\n  }\n}\n```\n\n### Prompts\n\n[**autocomplete**](https://github.com/mokkabonna/inquirer-autocomplete-prompt)<br>\nPresents a list of options as the user types, compatible with other packages such as fuzzy (for search)<br>\n<br>\n![autocomplete prompt](https://raw.githubusercontent.com/mokkabonna/inquirer-autocomplete-prompt/master/packages/inquirer-autocomplete-prompt/inquirer.gif)\n\n[**checkbox-plus**](https://github.com/faressoft/inquirer-checkbox-plus-prompt)<br>\nCheckbox list with autocomplete and other additions<br>\n<br>\n![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif)\n\n[**inquirer-date-prompt**](https://github.com/haversnail/inquirer-date-prompt)<br>\nCustomizable date/time selector with localization support<br>\n<br>\n![Date Prompt](https://github.com/haversnail/inquirer-date-prompt/raw/master/examples/demo.gif)\n\n[**datetime**](https://github.com/DerekTBrown/inquirer-datepicker-prompt)<br>\nCustomizable date/time selector using both number pad and arrow keys<br>\n<br>\n![Datetime Prompt](https://github.com/DerekTBrown/inquirer-datepicker-prompt/raw/master/example/datetime-prompt.png)\n\n[**inquirer-select-line**](https://github.com/adam-golab/inquirer-select-line)<br>\nPrompt for selecting index in array where add new element<br>\n<br>\n![inquirer-select-line gif](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif)\n\n[**command**](https://github.com/sullof/inquirer-command-prompt)<br>\nSimple prompt with command history and dynamic autocomplete<br>\n\n[**inquirer-fuzzy-path**](https://github.com/adelsz/inquirer-fuzzy-path)<br>\nPrompt for fuzzy file/directory selection.<br>\n<br>\n![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif)\n\n[**inquirer-emoji**](https://github.com/tannerntannern/inquirer-emoji)<br>\nPrompt for inputting emojis.<br>\n<br>\n![inquirer-emoji](https://github.com/tannerntannern/inquirer-emoji/raw/master/demo.gif)\n\n[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)<br>\nPrompt for input chalk-pipe style strings<br>\n<br>\n![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/blob/main/screenshot.gif)\n\n[**inquirer-search-checkbox**](https://github.com/clinyong/inquirer-search-checkbox)<br>\nSearchable Inquirer checkbox<br>\n![inquirer-search-checkbox](https://github.com/clinyong/inquirer-search-checkbox/blob/master/screenshot.png)\n\n[**inquirer-search-list**](https://github.com/robin-rpr/inquirer-search-list)<br>\nSearchable Inquirer list<br>\n<br>\n![inquirer-search-list](https://github.com/robin-rpr/inquirer-search-list/blob/master/preview.gif)\n\n[**inquirer-prompt-suggest**](https://github.com/olistic/inquirer-prompt-suggest)<br>\nInquirer prompt for your less creative users.<br>\n<br>\n![inquirer-prompt-suggest](https://user-images.githubusercontent.com/5600126/40391192-d4f3d6d0-5ded-11e8-932f-4b75b642c09e.gif)\n\n[**inquirer-s3**](https://github.com/HQarroum/inquirer-s3)<br>\nAn S3 object selector for Inquirer.<br>\n<br>\n![inquirer-s3](https://github.com/HQarroum/inquirer-s3/raw/master/docs/inquirer-screenshot.png)\n\n[**inquirer-autosubmit-prompt**](https://github.com/yaodingyd/inquirer-autosubmit-prompt)<br>\nAuto submit based on your current input, saving one extra enter<br>\n\n[**inquirer-file-tree-selection-prompt**](https://github.com/anc95/inquirer-file-tree-selection)<br>\nInquirer prompt for to select a file or directory in file tree<br>\n<br>\n![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif)\n\n[**inquirer-tree-prompt**](https://github.com/insightfuls/inquirer-tree-prompt)<br>\nInquirer prompt to select from a tree<br>\n<br>\n![inquirer-tree-prompt](https://github.com/insightfuls/inquirer-tree-prompt/blob/main/example/screenshot.gif)\n\n[**inquirer-table-prompt**](https://github.com/eduardoboucas/inquirer-table-prompt)<br>\nA table-like prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/eduardoboucas/inquirer-table-prompt/master/screen-capture.gif)\n\n[**inquirer-table-input**](https://github.com/edelciomolina/inquirer-table-input)<br>\nA table editing prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/edelciomolina/inquirer-table-input/master/screen-capture.gif)\n\n[**inquirer-interrupted-prompt**](https://github.com/lnquy065/inquirer-interrupted-prompt)<br>\nTurning any existing inquirer and its plugin prompts into prompts that can be interrupted with a custom key.<br>\n<br>\n![inquirer-interrupted-prompt](https://raw.githubusercontent.com/lnquy065/inquirer-interrupted-prompt/master/example/demo-menu.gif)\n\n[**inquirer-press-to-continue**](https://github.com/leonzalion/inquirer-press-to-continue)<br>\nA \"press any key to continue\" prompt for Inquirer.js<br>\n<br>\n![inquirer-press-to-continue](https://raw.githubusercontent.com/leonzalion/inquirer-press-to-continue/main/assets/demo.gif)\n","packages/number/README.md":"# `@inquirer/number`\n\nInteractive free number input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/number\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/number\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { number } from '@inquirer/prompts';\n// Or\n// import number from '@inquirer/number';\n\nconst answer = await number({ message: 'Enter your age' });\n```\n\n## Options\n\n| Property | Type                                                                       | Required | Description                                                                                                                                                                                                                                                     |\n| -------- | -------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                                   | yes      | The question to ask                                                                                                                                                                                                                                             |\n| default  | `number`                                                                   | no       | Default value if no answer is provided (clear it by pressing backspace)                                                                                                                                                                                         |\n| min      | `number`                                                                   | no       | The minimum value to accept for this input.                                                                                                                                                                                                                     |\n| max      | `number`                                                                   | no       | The maximum value to accept for this input.                                                                                                                                                                                                                     |\n| step     | `number \\| 'any'`                                                          | no       | The step option is a number that specifies the granularity that the value must adhere to. Only values which are equal to the basis for stepping (min if specified) are valid. This value defaults to 1, meaning by default the prompt will only allow integers. |\n| required | `boolean`                                                                  | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                                                         |\n| validate | `(number \\| undefined) => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                         |\n| theme    | [See Theming](#Theming)                                                    | no       | Customize look of the prompt.                                                                                                                                                                                                                                   |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/password/README.md":"# `@inquirer/password`\n\nInteractive password input component for command line interfaces. Supports input validation and masked or transparent modes.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/password\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/password\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { password } from '@inquirer/prompts';\n// Or\n// import password from '@inquirer/password';\n\nconst answer = await password({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| mask     | `boolean`                                                   | no       | Show a `*` mask over the input or keep it transparent                                                                                                                                                                   |\n| validate | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme    | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/prompts/README.md":"<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer\n\n[![npm](https://badge.fury.io/js/@inquirer%2Fprompts.svg)](https://www.npmjs.com/package/@inquirer/prompts)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\nGive it a try in your own terminal!\n\n```sh\nnpx @inquirer/demo@latest\n```\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\npnpm add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nbun add @inquirer/prompts\n```\n\n</td>\n</tr>\n</table>\n\n> [!NOTE]\n> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer).\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n# Prompts\n\n## [Input](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input)\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n```js\nimport { input } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input) for usage example and options documentation.\n\n## [Select](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select)\n\n![Select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n```js\nimport { select } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select) for usage example and options documentation.\n\n## [Checkbox](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox)\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n```js\nimport { checkbox } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox) for usage example and options documentation.\n\n## [Confirm](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm)\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n```js\nimport { confirm } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm) for usage example and options documentation.\n\n## [Search](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search)\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n```js\nimport { search } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search) for usage example and options documentation.\n\n## [Password](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password)\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n```js\nimport { password } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password) for usage example and options documentation.\n\n## [Expand](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand)\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n```js\nimport { expand } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand) for usage example and options documentation.\n\n## [Editor](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor)\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)\n\n```js\nimport { editor } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor) for usage example and options documentation.\n\n## [Number](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number)\n\nVery similar to the `input` prompt, but with built-in number validation configuration option.\n\n```js\nimport { number } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number) for usage example and options documentation.\n\n## [Raw List](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist) for usage example and options documentation.\n\n# Internationalization (i18n)\n\nNeed prompts in a language other than English? The [`@inquirer/i18n`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) package is a drop-in replacement for `@inquirer/prompts` with built-in localization.\n\nThe root import automatically detects your locale from the `LANGUAGE`, `LC_ALL`, `LC_MESSAGES`, and `LANG` environment variables (falling back to the `Intl` API). If no supported locale is found, English is used.\n\n```js\n// Drop-in replacement — locale is auto-detected from environment variables\nimport { input, select, confirm } from '@inquirer/i18n';\n```\n\nBuilt-in locales include English, French, Spanish, Chinese (Simplified), and Portuguese. You can also pin to a specific language via sub-path imports (e.g. `@inquirer/i18n/fr`), or use the `createLocalizedPrompts` and `registerLocale` APIs to add your own.\n\n[See the full documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) for available languages and how to create a custom locale.\n\n# Create your own prompts\n\nThe [API documentation is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core), and our [testing utilities here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/testing).\n\n# Advanced usage\n\nAll inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration.\n\nThe context options are:\n\n| Property          | Type                    | Required | Description                                                  |\n| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ |\n| input             | `NodeJS.ReadableStream` | no       | The stdin stream (defaults to `process.stdin`)               |\n| output            | `NodeJS.WritableStream` | no       | The stdout stream (defaults to `process.stdout`)             |\n| clearPromptOnDone | `boolean`               | no       | If true, we'll clear the screen after the prompt is answered |\n| signal            | `AbortSignal`           | no       | An AbortSignal to cancel prompts asynchronously              |\n\n> [!WARNING]\n> When providing an input stream or piping `process.stdin`, it's very likely you need to call `process.stdin.setRawMode(true)`\n> before calling inquirer functions. Node.js usually does it automatically, but when we shadow the stdin, Node can loss track\n> and not know it has to. If the prompt isn't interactive (arrows don't work, etc), it's likely due to this.\n\nWhen running Inquirer from an existing `node:readline` interface, pause the readline instance before starting the prompt, then resume it after the prompt settles. This makes the handoff of `process.stdin` ownership explicit and prevents the parent readline loop from losing control of the input stream.\n\n```js\nconst answer = await rl.question('Command: ');\n\nif (answer === 'configure') {\n  rl.pause();\n\n  try {\n    const value = await input({ message: 'Configuration value' });\n  } finally {\n    rl.resume();\n  }\n}\n```\n\nExample:\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm(\n  { message: 'Do you allow us to send you email?' },\n  {\n    output: new Stream.Writable({\n      write(chunk, _encoding, next) {\n        // Do something\n        next();\n      },\n    }),\n    clearPromptOnDone: true,\n  },\n);\n```\n\n## Canceling prompt\n\nThis can be done with either an `AbortController` or `AbortSignal`.\n\n```js\n// Example 1: using built-in AbortSignal utilities\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });\n```\n\n```js\n// Example 2: implementing custom cancellation with an AbortController\nimport { confirm } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nsetTimeout(() => {\n  controller.abort(); // This will reject the promise\n}, 5000);\n\nconst answer = await confirm({ ... }, { signal: controller.signal });\n```\n\n# Recipes\n\n## Handling `ctrl+c` gracefully\n\nWhen a user press `ctrl+c` to exit a prompt, Inquirer rejects the prompt promise. This is the expected behavior in order to allow your program to teardown/cleanup its environment. When using `async/await`, rejected promises throw their error. When unhandled, those errors print their stack trace in your user's terminal.\n\n```\nExitPromptError: User force closed the prompt with 0 null\n  at file://example/packages/core/dist/esm/lib/create-prompt.js:55:20\n  at Emitter.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:67:19)\n  at #processEmit (file://example/node_modules/signal-exit/dist/mjs/index.js:236:27)\n  at #process.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:187:37)\n  at process.callbackTrampoline (node:internal/async_hooks:130:17)\n```\n\nThis isn't a great UX, which is why we highly recommend you to handle those errors gracefully.\n\nFirst option is to wrap your scripts in `try/catch`; like [we do in our demo program](https://github.com/SBoudrias/Inquirer.js/blob/649e78147cbb6390a162ff842d4b21d53a233472/packages/demo/src/index.ts#L89-L95). Or handle the error in your CLI framework mechanism; for example [`Clipanion catch` method](https://mael.dev/clipanion/docs/errors#custom-error-handling).\n\nLastly, you could handle the error globally with an event listener and silence it.\n\n```ts\nprocess.on('uncaughtException', (error) => {\n  if (error instanceof Error && error.name === 'ExitPromptError') {\n    console.log('👋 until next time!');\n  } else {\n    // Rethrow unknown errors\n    throw error;\n  }\n});\n```\n\n## Get answers in an object\n\nWhen asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst answers = {\n  firstName: await input({ message: \"What's your first name?\" }),\n  allowEmail: await confirm({ message: 'Do you allow us to send you email?' }),\n};\n\nconsole.log(answers.firstName);\n```\n\n## Ask a question conditionally\n\nMaybe some questions depend on some other question's answer.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm({ message: 'Do you allow us to send you email?' });\n\nlet email;\nif (allowEmail) {\n  email = await input({ message: 'What is your email address' });\n}\n```\n\n## Get default value after timeout\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nconst timeout = setTimeout(() => {\n  controller.abort();\n}, 5000);\nconst clearInputTimeout = () => clearTimeout(timeout);\n\nprocess.stdin.once('keypress', clearInputTimeout);\n\nconst answer = await input(\n  { message: 'Enter a value (timing out in 5 seconds)' },\n  { signal: controller.signal },\n)\n  .catch((error) => {\n    if (error.name === 'AbortPromptError') {\n      return 'Default value';\n    }\n\n    throw error;\n  })\n  .finally(() => {\n    clearInputTimeout();\n    process.stdin.off('keypress', clearInputTimeout);\n  });\n```\n\n## Using as pre-commit/git hooks, or scripts\n\nBy default scripts ran from tools like `husky`/`lint-staged` might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process.\n\nFor it to work, you must make sure you start a `tty` (or \"interactive\" input stream.)\n\nIf those scripts are set within your `package.json`, you can define the stream like so:\n\n```json\n  \"precommit\": \"my-script < /dev/tty\"\n```\n\nOr if in a shell script file, you'll do it like so: (on Windows that's likely your only option)\n\n```sh\n#!/bin/sh\nexec < /dev/tty\n\nnode my-script.js\n```\n\n## Using with nodemon\n\nWhen using inquirer prompts with nodemon, you need to pass the `--no-stdin` flag for everything to work as expected.\n\n```sh\nnpx nodemon ./packages/demo/demos/password.mjs --no-stdin\n```\n\nNote that for most of you, you'll be able to use the new watch-mode built-in Node. This mode works out of the box with inquirer.\n\n```sh\n# One of depending on your need\nnode --watch script.js\nnode --watch-path=packages/ packages/demo/\n```\n\n## Wait for config\n\nMaybe some question configuration require to await a value.\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ message: await getMessage() });\n```\n\n## Usage with `npx` within bash scripts\n\nYou can use Inquirer prompts directly in the shell via [`npx`](https://docs.npmjs.com/cli/v8/commands/npx), which is useful for quick scripts or `package.json` commands.\n\nA community library, [@inquirer-cli](https://github.com/fishballapp/inquirer-cli), exposes each prompt as a standalone CLI.\n\nFor example, to prompt for input:\n\n```bash\nname=$(npx -y @inquirer-cli/input -r \"What is your name?\")\necho \"Hello, $name!\"\n```\n\nOr to create an interactive version bump:\n\n```bash\n$ npm version $(npx -y @inquirer-cli/select -c patch -c minor -c major 'Select Version')\n```\n\nFind out more: [@inquirer-cli](https://github.com/fishballapp/inquirer-cli).\n\n# Community prompts\n\nIf you created a cool prompt, [send us a PR adding it](https://github.com/SBoudrias/Inquirer.js/edit/main/packages/prompts/README.md) to the list below!\n\n[**Interactive List Prompt**](https://github.com/pgibler/inquirer-interactive-list-prompt)<br/>\nSelect a choice either with arrow keys + Enter or by pressing a key associated with a choice.\n\n```\n? Choose an option:\n>   Run command (D)\n    Quit (Q)\n```\n\n[**Action Select Prompt**](https://github.com/zenithlight/inquirer-action-select)<br/>\nChoose an item from a list and choose an action to take by pressing a key.\n\n```\n? Choose a file Open <O> Edit <E> Delete <X>\n❯ image.png\n  audio.mp3\n  code.py\n```\n\n[**Table Multiple Prompt**](https://github.com/Bartheleway/inquirer-table-multiple)<br/>\nSelect multiple answer from a table display.\n\n```sh\nChoose between choices? (Press <space> to select, <Up and Down> to move rows,\n<Left and Right> to move columns)\n\n┌──────────┬───────┬───────┐\n│ 1-2 of 2 │ Yes?  │ No?   |\n├──────────┼───────┼───────┤\n│ Choice 1 │ [ ◯ ] │   ◯   |\n├──────────┼───────┼───────┤\n│ Choice 2 │   ◯   │   ◯   |\n└──────────┴───────┴───────┘\n\n```\n\n[**Toggle Prompt**](https://github.com/skarahoda/inquirer-toggle)<br/>\nConfirm with a toggle. Select a choice with arrow keys + Enter.\n\n```\n? Do you want to continue? no / yes\n```\n\n[**Sortable Checkbox Prompt**](https://github.com/th0r/inquirer-sortable-checkbox)<br/>\nThe same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down.\n\n```\n? Which PRs and in what order would you like to merge? (Press <space> to select, <a> to toggle all, <i> to invert selection, <ctrl+up> to move item up, <ctrl+down> to move item down, and <enter> to proceed)\n❯ ◯ PR 1\n  ◯ PR 2\n  ◯ PR 3\n```\n\n[**Multi Select Prompt**](https://github.com/jeffwcx/inquirer-select-pro)\n\nAn inquirer select that supports multiple selections and filtering/searching.\n\n```\n? Choose your OS, IDE, PL, etc. (Press <tab> to select/deselect, <backspace> to remove selected\noption, <enter> to select option)\n>>  vue\n>[ ] vue\n [ ] vuejs\n [ ] fuelphp\n [ ] venv\n [ ] vercel\n (Use arrow keys to reveal more options)\n```\n\n[**File Selector Prompt**](https://github.com/br14n-sol/inquirer-file-selector)<br/>\nA file selector, you can navigate freely between directories, choose what type of files you want to allow and it is fully customizable.\n\n```sh\n? Select a file:\n/main/path/\n├── folder1/\n├── folder2/\n├── folder3/\n├── file1.txt\n├── file2.pdf\n└── file3.jpg (not allowed)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nUse ↑↓ to navigate through the list\nPress <esc> to navigate to the parent directory\nPress <enter> to select a file or navigate to a directory\n```\n\n[**Select Prompt with Stateful Banner**](https://github.com/patik/inquirer-select-with-state)<br/>\nThe same as built-in select prompt, but it also displays a banner above the prompt which can be updated with a `setState` function. For example, it can display the results of a long-running command without making the user wait to see the prompt.\n\nInitial display:\n\n```\nDirectory size: loading...\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\nA moment later:\n\n```\nDirectory size: 123M\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\n[**Ordered Checkbox Prompt**](https://github.com/kyou-izumi/inquirer-ordered-checkbox)<br/>\nA sortable checkbox prompt that maintains the order of selection. Perfect for prioritizing tasks or ranking options.\n\n```\n? Configure your development workflow:\n  [1] Set up CI/CD pipeline\n❯ [3] Code quality tools\n  [ ] Documentation\n  [2] Performance monitoring\n ──────────────\n- Legacy system (disabled)\n(Linting, formatting, and analysis)\n```\n\n[**Checkbox Plus Plus Prompt**](https://github.com/behnamazimi/inquirer-checkbox-plus-plus)<br/>\nA modern multiselect checkbox prompt with search and filter capabilities, highlighting, autocomplete, and improved UX. Supports both ESM and CommonJS and is compatible with @inquirer/core v10+.\n\n```\n? Select colors [searching: \"re\"]\n❯ ◉ The red color\n  ◯ The green color\n  ◉ The purple color\n  ◯ The orange color\n\n↑↓ navigate • space de/select • type search • 2 selected  • ⏎ submit\n```\n\n[**Tree Prompt**](https://github.com/3z3qu13l/inquirer-tree-prompt)<br/>\nNavigate a tree of choices, expanding and collapsing branches with the arrow keys. Children can be loaded lazily, and single or multiple items can be selected.\n\n```\n? Where is my phone?\n  ▼ in the house\n    ▼ in the living room\n      ❯ on the sofa\n        on the TV cabinet\n    ▶ in the bedroom\n      in the bathroom\n  ▶ in the car\n----------------\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/rawlist/README.md":"# `@inquirer/rawlist`\n\nSimple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.\n\n![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/rawlist\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/rawlist\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n// Or\n// import rawlist from '@inquirer/rawlist';\n\nconst answer = await rawlist({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    { name: 'pnpm', value: 'pnpm' },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                       |\n| -------- | ----------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                               |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                    |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |\n| default  | `Value`                 | no       | The value of the choice to preselect. If the value is not found, no choice is preselected.                                        |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                     |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  short?: string;\n  key?: string;\n  description?: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await rawlist()`.\n- `name`: This is the string displayed in the choice list.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `key`: The key of the choice. Displayed as `key) name`.\n- `description`: Option description which appears below the list when the choice is selected.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/search/README.md":"# `@inquirer/search`\n\nInteractive search prompt component for command line interfaces.\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/search\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/search\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { search, Separator } from '@inquirer/prompts';\n// Or\n// import search, { Separator } from '@inquirer/search';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    if (!input) {\n      return [];\n    }\n\n    const response = await fetch(\n      `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`,\n      { signal },\n    );\n    const data = await response.json();\n\n    return data.objects.map((pkg) => ({\n      name: pkg.package.name,\n      value: pkg.package.name,\n      description: pkg.package.description,\n    }));\n  },\n});\n```\n\n## Options\n\n| Property     | Type                                                       | Required | Description                                                                                                                                                                                          |\n| ------------ | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                   | yes      | The question to ask                                                                                                                                                                                  |\n| source       | `(term: string \\| void) => Promise<Choice[]>`              | yes      | This function returns the choices relevant to the search term.                                                                                                                                       |\n| pageSize     | `number`                                                   | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                          |\n| default      | `Value`                                                    | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.                                                                  |\n| initialValue | `string`                                                   | no       | The value used to pre-populate the search input. `source` will be called with this value as the initial search term.                                                                                 |\n| validate     | `Value => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme        | [See Theming](#Theming)                                    | no       | Customize look of the prompt.                                                                                                                                                                        |\n\n### `source` function\n\nThe full signature type of `source` is as follow:\n\n```ts\nfunction(\n  term: string | void,\n  opt: { signal: AbortSignal },\n): Promise<ReadonlyArray<Choice<Value> | Separator>>;\n```\n\nWhen `term` is `undefined`, it means the search term input is empty. You can use this to return default choices, or return an empty array.\n\nAside from returning the choices:\n\n1. An `AbortSignal` is passed in to cancel ongoing network calls when the search term change.\n2. `Separator`s can be used to organize the list.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await search()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nChoices can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n### Validation & autocomplete interaction\n\nThe validation within the search prompt acts as a signal for the autocomplete feature.\n\nWhen a list value is submitted and fail validation, the prompt will compare it to the search term. If they're the same, the prompt display the error. If they're not the same, we'll autocomplete the search term to match the value. Doing this will trigger a new search.\n\nYou can rely on this behavior to implement progressive autocomplete searches. Where you want the user to narrow the search in a progressive manner.\n\nPressing `tab` also triggers the term autocomplete.\n\nYou can see this behavior in action in [our search demo](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/src/demos/search.ts).\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    searchTerm: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n## Recipes\n\n### Debounce search\n\n```js\nimport { setTimeout } from 'node:timers/promises';\nimport { search } from '@inquirer/prompts';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    await setTimeout(300);\n    if (signal.aborted) return [];\n\n    // Do the search\n    fetch(...)\n  },\n});\n```\n\n# License\n\nCopyright (c) 2024 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/select/README.md":"# `@inquirer/select`\n\nSimple interactive command line prompt to display a list of choices (single select.)\n\n![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/select\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/select\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { select, Separator } from '@inquirer/prompts';\n// Or\n// import select, { Separator } from '@inquirer/select';\n\nconst answer = await select({\n  message: 'Select a package manager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm',\n      description: 'npm is the most popular package manager',\n    },\n    {\n      name: 'yarn',\n      value: 'yarn',\n      description: 'yarn is an awesome package manager',\n    },\n    new Separator(),\n    {\n      name: 'jspm',\n      value: 'jspm',\n      disabled: true,\n    },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                                 |\n| -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                                         |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                              |\n| default  | `string`                | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.         |\n| pageSize | `number`                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.           |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                               |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await select()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nWhen Vim keybindings are enabled, the prompt disables type-to-search so navigation keys are not interpreted as search input. You can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n  indexMode: 'hidden' | 'number';\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n### `theme.indexMode`\n\nControls how indices are displayed before each choice:\n\n- `hidden` (default): No indices are shown\n- `number`: Display a number before each choice (e.g. \"1. Option A\")\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/testing/README.md":"# `@inquirer/testing`\n\nThe `@inquirer/testing` package is Inquirer's answer to testing prompts [built with `@inquirer/core`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/testing --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/testing --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\nThis package provides two ways to test Inquirer prompts:\n\n1. **Unit testing** with `render()` - Test individual prompts in isolation\n2. **E2E testing** with `screen` - Test full CLI applications that use Inquirer\n\n## Unit Testing with `render()`\n\nThe `render()` function creates and instruments a command line interface for testing a single prompt.\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\ndescribe('input prompt', () => {\n  it('handle simple use case', async () => {\n    const { answer, events, getScreen } = await render(input, {\n      message: 'What is your name',\n    });\n\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name\"`);\n\n    events.type('J');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name J\"`);\n\n    events.type('ohn');\n    events.keypress('enter');\n\n    await expect(answer).resolves.toEqual('John');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name John\"`);\n  });\n});\n```\n\n### `render()` API\n\n`render` takes 2 arguments:\n\n1. The Inquirer prompt to test (the return value of `createPrompt()`)\n2. The prompt configuration (the first prompt argument)\n\n`render` returns a promise that resolves once the prompt is rendered. This promise returns:\n\n- `answer` (`Promise`) - Resolves when an answer is provided and valid\n- `getScreen` (`({ raw?: boolean }) => string`) - Returns the current screen content. By default strips ANSI codes\n- `nextRender` (`() => Promise<void>`) - Wait for the next screen update. Use after triggering async actions (e.g. pressing enter with validation). Coalesces rapid back-to-back renders so a single `await nextRender()` captures the final settled state\n- `events` - Utilities to interact with the prompt:\n  - `keypress(key: string | KeyObject)` - Trigger a keypress event\n  - `type(text: string)` - Type text into the prompt\n- `getFullOutput` (`() => Promise<string>`) - Returns the full output interpreted through a virtual terminal, resolving ANSI escape sequences into the actual screen state\n\n### Async actions and `nextRender()`\n\nWhen a keypress triggers an asynchronous action (such as input validation), the screen won't update synchronously. Use `nextRender()` to wait for the prompt to settle before reading the screen:\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\nit('shows a validation error', async () => {\n  const { answer, events, getScreen, nextRender } = await render(input, {\n    message: 'Enter a number',\n    validate: (value) => /^\\d+$/.test(value) || 'Must be a number',\n  });\n\n  events.type('abc');\n  events.keypress('enter');\n\n  await nextRender(); // wait for validation to complete and the error to render\n  expect(getScreen()).toContain('Must be a number');\n\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.type('42');\n  events.keypress('enter');\n\n  await expect(answer).resolves.toEqual('42');\n});\n```\n\n### Unit Testing Example\n\nYou can refer to the [`@inquirer/input` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/input.test.ts) for a comprehensive unit testing example using `render()`.\n\n## E2E Testing with `screen`\n\nFor testing full CLI applications that use Inquirer prompts internally, use the framework-specific entry points:\n\n### Vitest\n\n```ts\nimport { describe, it, expect } from 'vitest';\nimport { screen } from '@inquirer/testing/vitest';\n\n// Import your CLI AFTER @inquirer/testing/vitest\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### Jest\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### `screen` API\n\nThe `screen` object provides:\n\n- `next()` - Wait for the next screen update (prompt transitions, validation errors, async updates). The initial prompt render is available immediately via `getScreen()` — no `next()` needed\n- `getScreen({ raw?: boolean })` - Get the current prompt screen content. By default strips ANSI codes\n- `getFullOutput({ raw?: boolean })` - Get all accumulated output interpreted through a virtual terminal (returns a `Promise`). By default resolves ANSI escape sequences into actual screen state\n- `type(text)` - Type text (writes to stream AND emits keypresses)\n- `keypress(key)` - Send a keypress event\n- `clear()` - Reset screen state (called automatically before each test)\n\n### Mocking Third-Party Prompts\n\nAll `@inquirer/*` prompts are mocked automatically. To mock a third-party or custom prompt package, use `wrapPrompt` in your own mock call:\n\n#### Vitest\n\n```ts\nimport { screen, wrapPrompt } from '@inquirer/testing/vitest';\n\nvi.mock('@my-company/custom-prompt', async (importOriginal) => {\n  const actual = await importOriginal<typeof import('@my-company/custom-prompt')>();\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n#### Jest\n\nIn Jest, `jest.mock()` factories are hoisted before imports, so `wrapPrompt` must be accessed via `jest.requireActual()` inside the factory:\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\n\njest.mock('@my-company/custom-prompt', () => {\n  const { wrapPrompt } = jest.requireActual('@inquirer/testing/jest');\n  const actual = jest.requireActual('@my-company/custom-prompt');\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n### Important Notes\n\n1. **Import order matters**: Import `@inquirer/testing/vitest` or `@inquirer/testing/jest` BEFORE importing modules that use Inquirer prompts\n2. **Editor prompt**: The external editor is mocked — `screen.type()` buffers text, and `screen.keypress('enter')` submits it (same pattern as other prompts). Works with both `waitForUserInput: true` and `false`\n3. **Sequential prompts**: Multiple prompts are supported, but they must run sequentially (not concurrently)\n\n### E2E Testing Example\n\nYou can refer to the [`@inquirer/demo` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/demo.test.ts) for a comprehensive E2E testing example using `screen`.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","tools/isolate-monorepo-package/README.md":"# isolate-monorepo-package\n\nTool to isolate a package within a monorepo, locally replicating the release flow to ensure dependencies will work together post build.\n\nAiming to simulate how packages work once published to npm, it:\n\n1. Auto-discovers all workspace dependencies (direct and transitive)\n2. Packs workspace dependencies as tarballs\n3. Creates an isolated temp directory with modified package.json\n4. Outputs the temp directory path for testing\n\nWhile it uses `yarn` behind the scenes, it should work with any package manager that supports workspaces.\n\n## Installation\n\nThis tool is automatically available in the Inquirer workspace. No separate installation needed.\n\nLet me know if you'd like to see this published.\n\n## Usage\n\n```bash\n# Basic usage - outputs the path to isolated directory\nisolate-monorepo-package @inquirer/demo\n\n# One-liner approach - CD directly into the isolated directory\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nyarn set version stable # specific to yarn, this repo isn't setup, so it'll need to know which version to run.\nyarn install\nyarn test\ncd -\n\n# Or with npm\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nnpm install\nnpm test\ncd -\n```\n\n## Command Line Options\n\n- `<package-name>`: The workspace package to isolate (required)\n- `-v, --verbose`: Show detailed progress information\n\n## Output\n\nThe tool outputs only the path to the isolated directory to stdout. All other messages go to stderr, making it easy to capture the path in scripts:\n\n```bash\n# Capture path in variable\nTEST_DIR=$(isolate-monorepo-package @inquirer/demo)\n\n# Or CD directly\ncd $(isolate-monorepo-package @inquirer/demo)\n```\n\n## Troubleshooting\n\nIf the tool fails:\n\n1. Check that you're in a Yarn workspace (`.yarnrc.yml` must exist)\n2. Verify the package name exists in the workspace\n3. Use `-v` flag for detailed output\n4. Ensure `/tmp/artifacts/` is writable\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","tools/package/README.md":"# @sboudrias/package\n\nPackage metadata tools for JavaScript packages and monorepos.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @sboudrias/package --dev\n```\n\n</td>\n<td>\n\n```sh\npnpm add @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nbun add @sboudrias/package --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```bash\npackage lint\n```\n\n`package lint` validates public workspace packages and fixes safe package metadata issues in place.\n\n```bash\npackage lint --check\n```\n\n`package lint --check` runs the same validation without writing files. It exits non-zero when any package needs a fix or has a manual conflict.\n\n# Lint Rules\n\n## Valid Peer Dependencies\n\nRuntime dependencies can declare their own peer dependencies. `package lint` makes those peer requirements visible on the package that uses the runtime dependency.\n\nIt adds missing peers to `peerDependencies` and copies matching `peerDependenciesMeta` entries so optional peers stay optional.\n\n## Matching engines\n\nPackages should only advertise Node.js support that their runtime dependencies can also support.\n\n`package lint` sets missing, invalid, or out-of-root-range `engines.node` values to the root package `engines.node` range. It fails when a runtime dependency supports a narrower Node.js range than the package.\n\nThat failure is intentional. Bumping a dependency can raise the minimum supported Node.js version and break dependants that still install the package under the previous `engines.node` range. In that case, manually narrow the package engine range or choose a compatible dependency version.\n\n## Ensure package.json is exposed\n\nPackages should expose their manifest for tools that inspect package metadata at runtime.\n\n`package lint` ensures public packages expose `\"./package.json\": \"./package.json\"` in `exports`.\n\n# Workspace Discovery\n\nThe CLI discovers workspaces from `package.json` `workspaces` fields and `pnpm-workspace.yaml` files.\n\nIf no workspaces are configured, the root `package.json` is linted as a single-package project.\n\nPrivate packages are ignored by default.\n"},"files":{"AGENTS.md":"# Repository Guidelines\n\n## Project Structure & Module Organization\n\nThe repo is a Yarn workspaces monorepo. Core runtime logic shared primitives and shared primitives live in `packages/core/src`, and individual prompt implementations under `packages/<prompt>/src`. Testing utilities sit in `packages/testing`, while `packages/demo` provides the interactive showcase. Integration suites reside in `integration/cjs` and `integration/esm` to verify bundling. Tooling scripts and repo wiring (tsconfig, release helpers) live in `tools/`. Treat `packages/*/dist` and `tools/*/dist` as generated output.\n\n## Build, Test, and Development Commands\n\nInstall deps with `yarn install`. Use `yarn dev` for Turbo-powered incremental TypeScript builds. Launch the playground with `yarn demo`. Run `yarn tsc` for a project-wide compile. Execute `yarn pretest` for lint, format, and type gates, then `yarn test` for Vitest unit coverage followed by Node integration tests. After adding or moving workspaces, run `yarn setup` to refresh shared TS references.\n\n## Coding Style & Naming Conventions\n\nCode is ESM-first TypeScript targeting Node ≥ 18. Prettier enforces two-space indentation, trailing commas, and single quotes—lean on it rather than hand formatting. Prefer named exports, keep prompt IDs aligned with folder names, and store assets beside their entry points. Use `camelCase` for variables/functions and `PascalCase` for classes/components. Run `yarn oxlint --fix` and `yarn eslint --fix` before committing to maintain rule compliance.\n\n## TypeScript Best Practices\n\nPrioritize type safety and leverage existing types from the codebase. Use `Question<A>` from `packages/inquirer/src/types.ts` instead of generic `Record<string, unknown>` when working with question objects. Prefer `unknown` over `any` for truly unknown types, and use `Partial<T>` for optional properties. Leverage generic type parameters (like `<A extends Answers>`) throughout to maintain type consistency. Avoid eslint-disable comments by refactoring to proper types rather than suppressing warnings. When extending types, use intersection types (`Type & { prop: T }`) for explicit signatures rather than casting to `any`.\n\n## Testing Guidelines\n\nVitest owns unit coverage via `vitest.config.ts`, with `coverage.all = true` so untested files fail CI. Co-locate specs as `*.test.ts` next to source, and model cross-package flows under `integration/**/**/*.test.ts`. Iterate with `yarn vitest --run packages`, then finish with `yarn test` to exercise the full matrix. Update snapshots using `yarn vitest --update`.\n\nKeep tests simple and focused. Reuse existing test stubs and fixtures rather than creating custom mocks. If a behavior affects all prompts, test it with an existing prompt type rather than creating a specialized stub. Write tests that verify actual behavior rather than implementation details. Prefer straightforward assertions over complex validation logic.\n\n## Package-Specific Code Style\n\n### Type Declarations\n\nPrefer `type` over `interface` for all object shapes. Never prefix type names with `I` (no `IEditorParams`, `IFileOptions`). Use descriptive names without Hungarian notation: `EditorParams`, `FileOptions`.\n\n### Node.js Built-in Imports\n\nAlways use the `node:` protocol prefix for Node.js built-in modules: `import { spawn } from 'node:child_process'`, `import { readFileSync } from 'node:fs'`. This is enforced by linting.\n\n### Error Classes\n\nModel custom error classes after the style in `packages/core/src/lib/errors.ts`:\n\n- Declare `override name = 'ErrorName'` as a class field (not set in the constructor).\n- Pass `{ cause: originalError }` to `super()` to populate `this.cause` per the standard `Error` API.\n- Do not add a separate `originalError` instance field.\n- Do not include copyright header comments.\n\n### Async Patterns\n\nAll async operations must be Promise-based. Do not use Node-style callbacks `(err, result) => void`. Do not use `setImmediate` to defer callbacks; use `await` and `Promise` directly. Wrap event-emitter-based APIs (like `child_process.spawn`) in `new Promise(...)`.\n\n### Test File Location\n\nUnit tests must be co-located as `*.test.ts` files beside their source files inside `src/`. Separate `test/` directories are not used.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commit prefixes such as `feat:`, `fix:`, `docs:`, or `chore:`; keep scopes lowercase (`feat(@inquirer/package-name): add fuzzy search`). Summaries should stay imperative and under 80 characters. Pull requests must describe the change, list the commands run (for example `yarn test`), and link issues or discussions. Attach terminal recordings or screenshots for UX-facing changes, and ensure lockfiles and generated readme fragments stay current.\n","CLAUDE.md":"Read @AGENTS.md\n","packages/ansi/README.md":"# @inquirer/ansi\n\nA lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/ansi\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/ansi\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\n```js\nimport {\n  cursorUp,\n  cursorDown,\n  cursorTo,\n  cursorLeft,\n  cursorHide,\n  cursorShow,\n  eraseLines,\n} from '@inquirer/ansi';\n\n// Move cursor up 3 lines\nprocess.stdout.write(cursorUp(3));\n\n// Move cursor to specific position (x: 10, y: 5)\nprocess.stdout.write(cursorTo(10, 5));\n\n// Hide/show cursor\nprocess.stdout.write(cursorHide);\nprocess.stdout.write(cursorShow);\n\n// Clear 5 lines\nprocess.stdout.write(eraseLines(5));\n```\n\nOr when used inside an inquirer prompt:\n\n```js\nimport { cursorHide } from '@inquirer/ansi';\nimport { createPrompt } from '@inquirer/core';\n\nexport default createPrompt((config, done: (value: void) => void) => {\n  return `Choose an option${cursorHide}`;\n});\n```\n\n## API\n\n### Cursor Movement\n\n- **`cursorUp(count?: number)`** - Move cursor up by `count` lines (default: 1)\n- **`cursorDown(count?: number)`** - Move cursor down by `count` lines (default: 1)\n- **`cursorTo(x: number, y?: number)`** - Move cursor to position (x, y). If y is omitted, only moves horizontally\n- **`cursorLeft`** - Move cursor to beginning of line\n\n### Cursor Visibility\n\n- **`cursorHide`** - Hide the cursor\n- **`cursorShow`** - Show the cursor\n\n### Screen Manipulation\n\n- **`eraseLines(count: number)`** - Clear `count` lines and position cursor at the beginning of the first cleared line\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/checkbox/README.md":"# `@inquirer/checkbox`\n\nSimple interactive command line prompt to display a list of checkboxes (multi select).\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/checkbox\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/checkbox\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { checkbox, Separator } from '@inquirer/prompts';\n// Or\n// import checkbox, { Separator } from '@inquirer/checkbox';\n\nconst answer = await checkbox({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    new Separator(),\n    { name: 'pnpm', value: 'pnpm', disabled: true },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property  | Type                                    | Required | Description                                                                                                                                                                                           |\n| --------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message   | `string`                                | yes      | The question to ask                                                                                                                                                                                   |\n| choices   | `Choice[]`                              | yes      | List of the available choices.                                                                                                                                                                        |\n| pageSize  | `number`                                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                           |\n| loop      | `boolean`                               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.                                                                     |\n| required  | `boolean`                               | no       | When set to `true`, ensures at least one choice must be selected.                                                                                                                                     |\n| validate  | `async (Choice[]) => boolean \\| string` | no       | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| shortcuts | [See Shortcuts](#Shortcuts)             | no       | Customize shortcut keys for `all` and `invert`.                                                                                                                                                       |\n| theme     | [See Theming](#Theming)                 | no       | Customize look of the prompt.                                                                                                                                                                         |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  checkedName?: string;\n  description?: string;\n  short?: string;\n  checked?: boolean;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await checkbox()`.\n- `name`: This is the string displayed in the choice list.\n- `checkedName`: Alternative `name` (or format) displayed when the choice is checked.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `checked`: If `true`, the option will be checked by default.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nAlso note the `choices` array can contain `Separator`s to help organize long lists.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Shortcuts\n\nYou can customize the shortcut keys for `all` and `invert` or disable them by setting them to `null`.\n\n```ts\ntype Shortcuts = {\n  all?: string | null; // default: 'a'\n  invert?: string | null; // default: 'i'\n};\n```\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n    disabledChoice: (text: string) => string;\n    description: (text: string) => string;\n    renderSelectedChoices: <T>(\n      selectedChoices: ReadonlyArray<Choice<T>>,\n      allChoices: ReadonlyArray<Choice<T> | Separator>,\n    ) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    checked: string;\n    unchecked: string;\n    cursor: string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/confirm/README.md":"# `@inquirer/confirm`\n\nSimple interactive command line prompt to gather boolean input from users.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/confirm\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/confirm\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { confirm } from '@inquirer/prompts';\n// Or\n// import confirm from '@inquirer/confirm';\n\nconst answer = await confirm({ message: 'Continue?' });\n```\n\n## Options\n\n| Property    | Type                    | Required | Description                                             |\n| ----------- | ----------------------- | -------- | ------------------------------------------------------- |\n| message     | `string`                | yes      | The question to ask                                     |\n| default     | `boolean`               | no       | Default answer (true or false)                          |\n| transformer | `(boolean) => string`   | no       | Transform the prompt printed message to a custom string |\n| theme       | [See Theming](#Theming) | no       | Customize look of the prompt.                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/core/README.md":"# `@inquirer/core`\n\nThe `@inquirer/core` package is the library enabling the creation of Inquirer prompts.\n\nIt aims to implements a lightweight API similar to React hooks - but without JSX.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/core\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/core\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n## Basic concept\n\nVisual terminal apps are at their core strings rendered onto the terminal.\n\nThe most basic prompt is a function returning a string that'll be rendered in the terminal. This function will run every time the prompt state change, and the new returned string will replace the previously rendered one. The prompt cursor appears after the string.\n\nWrapping the rendering function with `createPrompt()` will setup the rendering layer, inject the state management utilities, and wait until the `done` callback is called.\n\n```ts\nimport { createPrompt } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  // Implement logic\n\n  return '? My question';\n});\n\n// And it is then called as\nconst answer = await input({/* config */});\n```\n\n## Hooks\n\nState management and user interactions are handled through hooks. Hooks are common [within the React ecosystem](https://react.dev/reference/react/hooks), and Inquirer reimplement the common ones.\n\n### State hook\n\nState lets a component “remember” information like user input. For example, an input prompt can use state to store the input value, while a list prompt can use state to track the cursor index.\n\n`useState` declares a state variable that you can update directly.\n\nThe setter also accepts an updater function to compute the next state from the current one (mirroring React):\n\n```ts\nconst [index, setIndex] = useState(0);\n\nsetIndex((current) => current + 1);\n```\n\n```ts\nimport { createPrompt, useState } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  const [index, setIndex] = useState(0);\n\n  // ...\n```\n\n### Keypress hook\n\nAlmost all prompts need to react to user actions. In a terminal, this is done through typing.\n\n`useKeypress` allows you to react to keypress events, and access the prompt line.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key) => {\n    if (key.name === 'enter') {\n      done(answer);\n    }\n  });\n\n  // ...\n```\n\nBehind the scenes, Inquirer prompts are wrappers around [readlines](https://nodejs.org/api/readline.html). Aside the keypress event object, the hook also pass the active readline instance to the event handler.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key, readline) => {\n    setValue(readline.line);\n  });\n\n  // ...\n```\n\n### Ref hook\n\nRefs let a prompt hold some information that isn’t used for rendering, like a class instance or a timeout ID. Unlike with state, updating a ref does not re-render your prompt. Refs are an “escape hatch” from the rendering paradigm.\n\n`useRef` declares a ref. You can hold any value in it, but most often it’s used to hold a timeout ID.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const timeout = useRef(null);\n\n  // ...\n```\n\n### Effect Hook\n\nEffects let a prompt connect to and synchronize with external systems. This includes dealing with network or animations.\n\n`useEffect` connects a component to an external system.\n\n```ts\nconst chat = createPrompt((config, done) => {\n  useEffect(() => {\n    const connection = createConnection(roomId);\n    connection.connect();\n    return () => connection.disconnect();\n  }, [roomId]);\n\n  // ...\n```\n\n### Performance hook\n\nA common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell Inquirer to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render.\n\n`useMemo` lets you cache the result of an expensive calculation.\n\n```ts\nconst todoSelect = createPrompt((config, done) => {\n  const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]);\n\n  // ...\n```\n\n### Rendering hooks\n\n#### Prefix / loading\n\nAll default prompts, and most custom ones, uses a prefix at the beginning of the prompt line. This helps visually delineate different questions, and provides a convenient area to render a loading spinner.\n\n`usePrefix` is a built-in hook to do this.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const prefix = usePrefix({ status });\n\n  return `${prefix} My question`;\n});\n```\n\n#### Pagination\n\nWhen looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options.\n\nPagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`.\n\n```js\nexport default createPrompt((config, done) => {\n  const [active, setActive] = useState(0);\n\n  const allChoices = config.choices.map((choice) => choice.name);\n\n  const page = usePagination({\n    items: allChoices,\n    active: active,\n    renderItem: ({ item, index, isActive }) => `${isActive ? \">\" : \" \"}${index}. ${item.toString()}`\n    pageSize: config.pageSize,\n    loop: config.loop,\n  });\n\n  return `... ${page}`;\n});\n```\n\n## `createPrompt()` API\n\nAs we saw earlier, the rendering function should return a string, and eventually call `done` to close the prompt and return the answer.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const [value, setValue] = useState();\n\n  useKeypress((key, readline) => {\n    if (key.name === 'enter') {\n      done(answer);\n    } else {\n      setValue(readline.line);\n    }\n  });\n\n  return `? ${config.message} ${value}`;\n});\n```\n\nThe rendering function can also return a tuple of 2 string (`[string, string]`.) The first string represents the prompt. The second one is content to render under the prompt, like an error message. The text input cursor will appear after the first string.\n\n```ts\nconst number = createPrompt((config, done) => {\n  // Add some logic here\n\n  return [`? My question ${input}`, `! The input must be a number`];\n});\n```\n\n### Typescript\n\nIf using typescript, `createPrompt` takes 2 generic arguments.\n\n```ts\n// createPrompt<Value, Config>\nconst input = createPrompt<string, { message: string }>(// ...\n```\n\nThe first one is the type of the resolved value\n\n```ts\nconst answer: string = await input();\n```\n\nThe second one is the type of the prompt config; in other words the interface the created prompt will provide to users.\n\n```ts\nconst answer = await input({\n  message: 'My question',\n});\n```\n\n## Key utilities\n\nListening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean:\n\n- `isEnterKey()`\n- `isBackspaceKey()`\n- `isSpaceKey()`\n- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`)\n- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`)\n- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally. Prompt-level `theme.keybindings` values override the environment variable.\n\n## Theming\n\nTheming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts.\n\nTo allow standard customization:\n\n```ts\nimport { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.style.highlight('hello')}`;\n});\n```\n\nTo setup a custom theme:\n\n```ts\nimport { createPrompt, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptTheme = {};\n\nconst promptTheme: PromptTheme = {\n  icon: '!',\n};\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme<PromptTheme>>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(promptTheme, config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.icon}`;\n});\n```\n\nThe [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts):\n\n```ts\ntype DefaultTheme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n  };\n};\n```\n\n# Examples\n\nYou can refer to any `@inquirer/prompts` prompts for real examples:\n\n- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts)\n- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts)\n- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts)\n- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts)\n- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts)\n- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts)\n- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts)\n- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts)\n\n```ts\nimport { styleText } from 'node:util';\nimport {\n  createPrompt,\n  useState,\n  useKeypress,\n  isEnterKey,\n  usePrefix,\n  type Status,\n} from '@inquirer/core';\n\nconst confirm = createPrompt<boolean, { message: string; default?: boolean }>(\n  (config, done) => {\n    const [status, setStatus] = useState<Status>('idle');\n    const [value, setValue] = useState('');\n    const prefix = usePrefix({});\n\n    useKeypress((key, rl) => {\n      if (isEnterKey(key)) {\n        const answer = value ? /^y(es)?/i.test(value) : config.default !== false;\n        setValue(answer ? 'yes' : 'no');\n        setStatus('done');\n        done(answer);\n      } else {\n        setValue(rl.line);\n      }\n    });\n\n    let formattedValue = value;\n    let defaultValue = '';\n    if (status === 'done') {\n      formattedValue = styleText('cyan', value);\n    } else {\n      defaultValue = styleText('dim', config.default === false ? ' (y/N)' : ' (Y/n)');\n    }\n\n    const message = styleText('bold', config.message);\n    return `${prefix} ${message}${defaultValue} ${formattedValue}`;\n  },\n);\n\n/**\n *  Which then can be used like this:\n */\nconst answer = await confirm({ message: 'Do you want to continue?' });\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/editor/README.md":"# `@inquirer/editor`\n\nPrompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line.\n\nThe editor launched is the one [defined by the user's `EDITOR` environment variable](https://dev.to/jonasbn/til-integrate-visual-studio-code-with-shell--cli-2l1l).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/editor\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { editor } from '@inquirer/prompts';\n// Or\n// import editor from '@inquirer/editor';\n\nconst answer = await editor({\n  message: 'Enter a description',\n});\n```\n\n## Options\n\n| Property         | Type                                                                           | Required               | Description                                                                                                                                                                                                                            |\n| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message          | `string`                                                                       | yes                    | The question to ask                                                                                                                                                                                                                    |\n| default          | `string`                                                                       | no                     | Default value which will automatically be present in the editor                                                                                                                                                                        |\n| validate         | `string => boolean \\| string \\| Promise<boolean \\| string>`                    | no                     | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                  |\n| postfix          | `string`                                                                       | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.                                                                                                                     |\n| file             | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no                     | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file.                                                                                         |\n| waitForUserInput | `boolean`                                                                      | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |\n| theme            | [See Theming](#Theming)                                                        | no                     | Customize look of the prompt.                                                                                                                                                                                                          |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    key: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to the default value or empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/expand/README.md":"# `@inquirer/expand`\n\nCompact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/expand\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/expand\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { expand } from '@inquirer/prompts';\n// Or\n// import expand from '@inquirer/expand';\n\nconst answer = await expand({\n  message: 'Conflict on file.js',\n  default: 'y',\n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite',\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all',\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff',\n    },\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                               |\n| -------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                       |\n| choices  | `Choice[]`              | yes      | Array of the different allowed choices. The `h`/help option is always provided by default |\n| default  | `string`                | no       | Default choices to be selected. (value must be one of the choices `key`)                  |\n| expanded | `boolean`               | no       | Expand the choices by default                                                             |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                             |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  key: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await expand()`.\n- `name`: The string displayed in the choice list. It'll default to the stringify `value`.\n- `key`: The input the use must provide to select the choice. Must be a lowercase single alphanumeric character string.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    highlight: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/external-editor/README.md":"# `@inquirer/external-editor`\n\nA Node.js module to edit a string with the user's preferred text editor using $VISUAL or $EDITOR.\n\n> [!NOTE]\n> This package is a replacement for the unmaintained `external-editor`. It includes security fixes.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/external-editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/external-editor\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\nA simple example using the `edit` function\n\n```ts\nimport { edit } from '@inquirer/external-editor';\n\nconst data = edit('\\n\\n# Please write your text above');\nconsole.log(data);\n```\n\nExample relying on the class construct\n\n```ts\nimport {\n  ExternalEditor,\n  CreateFileError,\n  ReadFileError,\n  RemoveFileError,\n  LaunchEditorError,\n} from '@inquirer/external-editor';\n\ntry {\n  const editor = new ExternalEditor();\n  const text = editor.run(); // the text is also available in editor.text\n\n  if (editor.lastExitStatus !== 0) {\n    console.log('The editor exited with a non-zero code');\n  }\n\n  // Do things with the text\n  editor.cleanup();\n} catch (err) {\n  if (err instanceof CreateFileError) {\n    console.log('Failed to create the temporary file');\n  } else if (err instanceof ReadFileError) {\n    console.log('Failed to read the temporary file');\n  } else if (err instanceof LaunchEditorError) {\n    console.log('Failed to launch your editor');\n  } else if (err instanceof RemoveFileError) {\n    console.log('Failed to remove the temporary file');\n  } else {\n    throw err;\n  }\n}\n```\n\n### Windows editor commands\n\nOn Windows, prefer setting `$VISUAL` or `$EDITOR` to the editor executable\nrather than a `.cmd` or `.bat` shim. This package launches the editor directly\ninstead of through a shell so editor arguments and temporary file paths are not\ninterpreted as shell commands.\n\nFor example, use `Code.exe` with `--wait` instead of `code.cmd`:\n\n```powershell\nsetx VISUAL '\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" --wait'\n```\n\n#### API\n\n**Convenience Functions**\n\n- `edit(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - **Returns** (string) The contents of the file\n  - Could throw `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError`\n- `editAsync(text, callback, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `callback` (function (error?, text?))\n    - `error` could be of type `CreateFileError`, `ReadFileError`, `LaunchEditorError`, or `RemoveFileError`\n    - `text` (string) The contents of the file\n  - `config` (Config) _Optional_ Options for temporary file creation\n\n**Errors**\n\n- `CreateFileError` Error thrown if the temporary file could not be created.\n- `ReadFileError` Error thrown if the temporary file could not be read.\n- `RemoveFileError` Error thrown if the temporary file could not be removed during cleanup.\n- `LaunchEditorError` Error thrown if the editor could not be launched.\n\n**External Editor Public Methods**\n\n- `new ExternalEditor(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - Could throw `CreateFileError`\n- `run()` Launches the editor.\n  - **Returns** (string) The contents of the file\n  - Could throw `LaunchEditorError` or `ReadFileError`\n- `runAsync(callback)` Launches the editor in an async way\n  - `callback` (function (error?, text?))\n    - `error` could be of type `ReadFileError` or `LaunchEditorError`\n    - `text` (string) The contents of the file\n- `cleanup()` Removes the temporary file.\n  - Could throw `RemoveFileError`\n\n**External Editor Public Properties**\n\n- `text` (string) _readonly_ The text in the temporary file.\n- `editor.bin` (string) The editor determined from the environment.\n- `editor.args` (array) Default arguments for the bin\n- `tempFile` (string) Path to temporary file. Can be changed, but be careful as the temporary file probably already\n  exists and would need be removed manually.\n- `lastExitStatus` (number) The last exit code emitted from the editor.\n\n**Config Options**\n\n- `prefix` (string) _Optional_ A prefix for the file name.\n- `postfix` (string) _Optional_ A postfix for the file name. Useful if you want to provide an extension.\n- `mode` (number) _Optional_ Which mode to create the file with. e.g. 644\n- `dir` (string) _Optional_ Which path to store the file.\n\n## Why Synchronous?\n\nEverything is synchronous to make sure the editor has complete control of the stdin and stdout. Testing has shown\nasync launching of the editor can lead to issues when using readline or other packages which try to read from stdin or\nwrite to stdout. Seeing as this will be used in an interactive CLI environment, I made the decision to force the package\nto be synchronous. If you know a reliable way to force all stdin and stdout to be limited only to the child_process,\nplease submit a PR.\n\nIf async is really needed, you can use `editAsync` or `runAsync`. If you are using readline or have anything else\nlistening to the stdin or you write to stdout, you will most likely have problem, so make sure to remove any other\nlisteners on stdin, stdout, or stderr.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s.png)](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s)\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/input/README.md":"# `@inquirer/input`\n\nInteractive free text input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/input\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/input\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n// Or\n// import input from '@inquirer/input';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property     | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| ------------ | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| default      | `string`                                                    | no       | Default value if no answer is provided; see the prefill option below for governing it's behaviour.                                                                                                                      |\n| prefill      | `'tab' \\| 'editable'`                                       | no       | Defaults to `'tab'`. If set to `'tab'`, pressing `backspace` will clear the default and pressing `tab` will inline the value for edits; If set to `'editable'`, the default value will already be inlined to edit.      |\n| required     | `boolean`                                                   | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                 |\n| transformer  | `(string, { isFinal: boolean }) => string`                  | no       | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed.                                   |\n| validate     | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| pattern      | `RegExp`                                                    | no       | Regular expression to validate the input against. If the input doesn't match the pattern, validation will fail with the error message specified in `patternError`.                                                      |\n| patternError | `string`                                                    | no       | Error message to display when the input doesn't match the `pattern`. Defaults to `'Invalid input'`.                                                                                                                     |\n| theme        | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to an empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/inquirer/README.md":"<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer.js\n\n[![npm](https://badge.fury.io/js/inquirer.svg)](https://www.npmjs.com/package/inquirer)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n> [!IMPORTANT]\n> This is the legacy version of Inquirer.js. While it still receives maintenance, it is not actively developed. For the new Inquirer, see [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts).\n\n## Table of Contents\n\n1.  [Documentation](#documentation)\n    1.  [Installation](#installation)\n    2.  [Examples](#examples)\n    3.  [Methods](#methods)\n    4.  [Objects](#objects)\n    5.  [Question](#question)\n    6.  [Answers](#answers)\n    7.  [Separator](#separator)\n    8.  [Prompt Types](#prompt-types)\n2.  [User Interfaces and Layouts](#user-interfaces-and-layouts)\n    1.  [Reactive Interface](#reactive-interface)\n3.  [Support](#support)\n4.  [Known issues](#issues)\n5.  [News](#news)\n6.  [Contributing](#contributing)\n7.  [License](#license)\n8.  [Plugins](#plugins)\n\n## Goal and Philosophy\n\n**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the \"CLI [Xanadu](https://en.wikipedia.org/wiki/Citizen_Kane)\").\n\n**`Inquirer.js`** should ease the process of\n\n- providing _error feedback_\n- _asking questions_\n- _parsing_ input\n- _validating_ answers\n- managing _hierarchical prompts_\n\n> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [commander](https://github.com/visionmedia/commander.js), [vorpal](https://github.com/dthree/vorpal) or [args](https://github.com/leo/args).\n\n## [Documentation](#documentation)\n\n<a name=\"documentation\"></a>\n\n### Installation\n\n<a name=\"installation\"></a>\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install inquirer\n```\n\n</td>\n<td>\n\n```sh\nyarn add inquirer\n```\n\n</td>\n</tr>\n</table>\n\n```javascript\nimport inquirer from 'inquirer';\n\ninquirer\n  .prompt([/* Pass your questions in here */])\n  .then((answers) => {\n    // Use user feedback for... whatever!!\n  })\n  .catch((error) => {\n    if (error.isTtyError) {\n      // Prompt couldn't be rendered in the current environment\n    } else {\n      // Something else went wrong\n    }\n  });\n```\n\n<a name=\"examples\"></a>\n\n### Examples (Run it and see it)\n\nCheck out the [`packages/inquirer/examples/`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer/examples) folder for code and interface examples.\n\n```shell\nyarn node packages/inquirer/examples/pizza.js\nyarn node packages/inquirer/examples/checkbox.js\n# etc...\n```\n\n### Methods\n\n<a name=\"methods\"></a>\n\n> [!WARNING]\n> Those interfaces are not necessary for modern Javascript, while still maintained, they're depreciated. We highly encourage you to adopt the more ergonomic and modern API with [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts). Both `inquirer` and `@inquirer/prompts` are usable at the same time, so you can progressively migrate.\n\n#### `inquirer.prompt(questions, answers) -> promise`\n\nLaunch the prompt interface (inquiry session)\n\n- **questions** a [Question Object](#question), an array or map of questions, or an RxJS-compatible Observable of questions\n- **answers** (object) contains values of already answered questions. Inquirer will avoid asking answers already provided here. Defaults `{}`.\n- returns a **Promise**\n\n#### `inquirer.registerPrompt(name, prompt)`\n\nRegister prompt plugins under `name`.\n\n- **name** (string) name of the this new prompt. (used for question `type`)\n- **prompt** (object) the prompt object itself (the plugin)\n\n#### `inquirer.createPromptModule() -> prompt function`\n\nCreate a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types.\n\n```js\nconst prompt = inquirer.createPromptModule();\n\nprompt(questions).then(/* ... */);\n```\n\n### Objects\n\n<a name=\"objects\"></a>\n\n#### Question\n\n<a name=\"questions\"></a>\nA question object is a `hash` containing question related values:\n\n- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `number`, `confirm`, `list`, `rawlist`, `expand`, `checkbox`, `password`, `editor`\n- **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash.\n- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon).\n- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.\n- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers.\n  Array values can be simple `numbers`, `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash), and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator).\n- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided.\n- **filter**: (Function) Receive the user input and answers hash. Returns the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash.\n- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash.\n- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean.\n- **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`.\n- **prefix**: (String) Change the default _prefix_ message.\n- **suffix**: (String) Change the default _suffix_ message.\n- **askAnswered**: (Boolean) Force to prompt the question if the answer already exists.\n- **loop**: (Boolean) Enable list looping. Defaults: `true`\n- **waitUserInput**: (Boolean) Flag to enable/disable wait for user input before opening system editor - Defaults: `true`\n\n`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value.\n\n```javascript\n{\n  /* Preferred way: with promise */\n  filter() {\n    return new Promise(/* etc... */);\n  },\n\n  /* Legacy way: with this.async */\n  validate: function (input) {\n    // Declare function as asynchronous, and save the done callback\n    const done = this.async();\n\n    // Do async stuff\n    setTimeout(function() {\n      if (typeof input !== 'number') {\n        // Pass the return value in the done callback\n        done('You need to provide a number');\n      } else {\n        // Pass the return value in the done callback\n        done(null, true);\n      }\n    }, 3000);\n  }\n}\n```\n\n### Answers\n\n<a name=\"answers\"></a>\nA key/value hash containing the client answers in each prompt.\n\n- **Key** The `name` property of the _question_ object\n- **Value** (Depends on the prompt)\n  - `confirm`: (Boolean)\n  - `input` : User input (filtered if `filter` is defined) (String)\n  - `number`: User input (filtered if `filter` is defined) (Number)\n  - `rawlist`, `list` : Selected choice value (or name if no value specified) (String)\n\n### Separator\n\n<a name=\"separator\"></a>\nA separator can be added to any `choices` array:\n\n```\n// In the question object\nchoices: [ \"Choice A\", new inquirer.Separator(), \"choice B\" ]\n\n// Which'll be displayed this way\n[?] What do you want to do?\n > Order a pizza\n   Make a reservation\n   --------\n   Ask opening hours\n   Talk to the receptionist\n```\n\nThe constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`.\n\nSeparator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists.\n\n<a name=\"prompt\"></a>\n\n### Prompt types\n\n---\n\n> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._\n\n#### List - `{type: 'list'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` or `value` of one of the entries in `choices`)\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n---\n\n#### Raw List - `{type: 'rawlist'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` of one of the entries in `choices`)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n---\n\n#### Expand - `{type: 'expand'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`] properties.\nNote: `default` must be the `index` of the desired default selection of the array. If `default` key not provided, then `help` will be used as default choice\n\nNote that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user.\n\nSee `examples/expand.js` for a running example.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n---\n\n#### Checkbox - `{type: 'checkbox'}`\n\nTake `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`, `loop`] properties. `default` is expected to be an Array of the checked choices value.\n\nChoices marked as `{checked: true}` will be checked by default.\n\nChoices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `\"Disabled\"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string.\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n---\n\n#### Confirm - `{type: 'confirm'}`\n\nTake `type`, `name`, `message`, [`default`, `transformer`] properties. `default` is expected to be a boolean if used.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n---\n\n#### Input - `{type: 'input'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n---\n\n#### Input - `{type: 'number'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n---\n\n#### Password - `{type: 'password'}`\n\nTake `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n---\n\nNote that `mask` is required to hide the actual user input.\n\n#### Editor - `{type: 'editor'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `postfix`, `waitUserInput`] properties\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the contents of the temporary file are read in as the result. The editor to use is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used.\n\nThe `postfix` property is useful if you want to provide an extension.\n\n<a name=\"layouts\"></a>\n\n### Use in Non-Interactive Environments\n\n`prompt()` requires that it is run in an interactive environment. (I.e. [One where `process.stdin.isTTY` is `true`](https://nodejs.org/docs/latest-v12.x/api/process.html#process_a_note_on_process_i_o)). If `prompt()` is invoked outside of such an environment, then `prompt()` will return a rejected promise with an error. For convenience, the error will have a `isTtyError` property to programmatically indicate the cause.\n\n<a name=\"reactive\"></a>\n\n## Reactive interface\n\n`inquirer.prompt()` accepts an RxJS-compatible Observable of questions. This supports dynamic flows where questions are emitted over time:\n\n```js\nconst prompts = new Rx.Subject();\ninquirer.prompt(prompts);\n\n// At some point in the future, push new questions\nprompts.next({/* question... */});\nprompts.next({/* question... */});\n\n// When you're done\nprompts.complete();\n```\n\nAnd using the return value `process` property, you can access more fine grained callbacks:\n\n```js\ninquirer.prompt(prompts).ui.process.subscribe(onEachAnswer, onError, onComplete);\n```\n\n## Support (OS Terminals)\n\n<a name=\"support\"></a>\n\nYou should expect mostly good support for the CLI below. This does not mean we won't\nlook at issues found on other command line - feel free to report any!\n\n- **Mac OS**:\n  - Terminal.app\n  - iTerm\n- **Windows ([Known issues](#issues))**:\n  - [Windows Terminal](https://github.com/microsoft/terminal)\n  - [ConEmu](https://conemu.github.io/)\n  - cmd.exe\n  - Powershell\n  - Cygwin\n- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**:\n  - gnome-terminal (Terminal GNOME)\n  - konsole\n\n## Known issues\n\n<a name=\"issues\"></a>\n\n- **nodemon** - Makes the arrow keys print gibrish on list prompts.\n  Workaround: Add `{ stdin : false }` in the configuration file or pass `--no-stdin` in the CLI.\n  Please refer to [this issue](https://github.com/SBoudrias/Inquirer.js/issues/844#issuecomment-736675867)\n\n- **grunt-exec** - Calling a node script that uses Inquirer from grunt-exec can cause the program to crash. To fix this, add to your grunt-exec config `stdio: 'inherit'`.\n  Please refer to [this issue](https://github.com/jharding/grunt-exec/issues/85)\n\n- **Windows network streams** - Running Inquirer together with network streams in Windows platform inside some terminals can result in process hang.\n  Workaround: run inside another terminal.\n  Please refer to [this issue](https://github.com/nodejs/node/issues/21771)\n\n## News on the march (Release notes)\n\n<a name=\"news\"></a>\n\nPlease refer to the [GitHub releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases)\n\n## Contributing\n\n<a name=\"contributing\"></a>\n\n**Unit test**\nPlease add a unit test for every new feature or bug fix. `yarn test` to run the test suite.\n\n**Documentation**\nAdd documentation for every API change. Feel free to send typo fixes and better docs!\n\nWe're looking to offer good support for multiple prompts and environments. If you want to\nhelp, we'd like to keep a list of testers for each terminal/OS so we can contact you and\nget feedback before release. Let us know if you want to be added to the list (just tweet\nto [@vaxilart](https://twitter.com/Vaxilart)) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers)\n\n## License\n\n<a name=\"license\"></a>\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n## Plugins\n\n<a name=\"plugins\"></a>\n\nYou can build custom prompts, or use open sourced ones. See [`@inquirer/core` documentation for building custom prompts](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\nYou can either call the custom prompts directly (preferred), or you can register them (depreciated):\n\n```js\nimport customPrompt from '$$$/custom-prompt';\n\n// 1. Preferred solution with new plugins\nconst answer = await customPrompt({ ...config });\n\n// 2. Depreciated interface (or for old plugins)\ninquirer.registerPrompt('custom', customPrompt);\nconst answers = await inquirer.prompt([\n  {\n    type: 'custom',\n    ...config,\n  },\n]);\n```\n\nWhen using Typescript and `registerPrompt`, you'll also need to define your prompt signature. Since Typescript is static, we cannot infer available plugins from function calls.\n\n```ts\nimport customPrompt from '$$$/custom-prompt';\n\ndeclare module 'inquirer' {\n  interface QuestionMap {\n    // 1. Easiest option\n    custom: Parameters<typeof customPrompt>[0];\n\n    // 2. Or manually define the prompt config\n    custom_alt: { message: string; option: number[] };\n  }\n}\n```\n\n### Prompts\n\n[**autocomplete**](https://github.com/mokkabonna/inquirer-autocomplete-prompt)<br>\nPresents a list of options as the user types, compatible with other packages such as fuzzy (for search)<br>\n<br>\n![autocomplete prompt](https://raw.githubusercontent.com/mokkabonna/inquirer-autocomplete-prompt/master/packages/inquirer-autocomplete-prompt/inquirer.gif)\n\n[**checkbox-plus**](https://github.com/faressoft/inquirer-checkbox-plus-prompt)<br>\nCheckbox list with autocomplete and other additions<br>\n<br>\n![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif)\n\n[**inquirer-date-prompt**](https://github.com/haversnail/inquirer-date-prompt)<br>\nCustomizable date/time selector with localization support<br>\n<br>\n![Date Prompt](https://github.com/haversnail/inquirer-date-prompt/raw/master/examples/demo.gif)\n\n[**datetime**](https://github.com/DerekTBrown/inquirer-datepicker-prompt)<br>\nCustomizable date/time selector using both number pad and arrow keys<br>\n<br>\n![Datetime Prompt](https://github.com/DerekTBrown/inquirer-datepicker-prompt/raw/master/example/datetime-prompt.png)\n\n[**inquirer-select-line**](https://github.com/adam-golab/inquirer-select-line)<br>\nPrompt for selecting index in array where add new element<br>\n<br>\n![inquirer-select-line gif](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif)\n\n[**command**](https://github.com/sullof/inquirer-command-prompt)<br>\nSimple prompt with command history and dynamic autocomplete<br>\n\n[**inquirer-fuzzy-path**](https://github.com/adelsz/inquirer-fuzzy-path)<br>\nPrompt for fuzzy file/directory selection.<br>\n<br>\n![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif)\n\n[**inquirer-emoji**](https://github.com/tannerntannern/inquirer-emoji)<br>\nPrompt for inputting emojis.<br>\n<br>\n![inquirer-emoji](https://github.com/tannerntannern/inquirer-emoji/raw/master/demo.gif)\n\n[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)<br>\nPrompt for input chalk-pipe style strings<br>\n<br>\n![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/blob/main/screenshot.gif)\n\n[**inquirer-search-checkbox**](https://github.com/clinyong/inquirer-search-checkbox)<br>\nSearchable Inquirer checkbox<br>\n![inquirer-search-checkbox](https://github.com/clinyong/inquirer-search-checkbox/blob/master/screenshot.png)\n\n[**inquirer-search-list**](https://github.com/robin-rpr/inquirer-search-list)<br>\nSearchable Inquirer list<br>\n<br>\n![inquirer-search-list](https://github.com/robin-rpr/inquirer-search-list/blob/master/preview.gif)\n\n[**inquirer-prompt-suggest**](https://github.com/olistic/inquirer-prompt-suggest)<br>\nInquirer prompt for your less creative users.<br>\n<br>\n![inquirer-prompt-suggest](https://user-images.githubusercontent.com/5600126/40391192-d4f3d6d0-5ded-11e8-932f-4b75b642c09e.gif)\n\n[**inquirer-s3**](https://github.com/HQarroum/inquirer-s3)<br>\nAn S3 object selector for Inquirer.<br>\n<br>\n![inquirer-s3](https://github.com/HQarroum/inquirer-s3/raw/master/docs/inquirer-screenshot.png)\n\n[**inquirer-autosubmit-prompt**](https://github.com/yaodingyd/inquirer-autosubmit-prompt)<br>\nAuto submit based on your current input, saving one extra enter<br>\n\n[**inquirer-file-tree-selection-prompt**](https://github.com/anc95/inquirer-file-tree-selection)<br>\nInquirer prompt for to select a file or directory in file tree<br>\n<br>\n![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif)\n\n[**inquirer-tree-prompt**](https://github.com/insightfuls/inquirer-tree-prompt)<br>\nInquirer prompt to select from a tree<br>\n<br>\n![inquirer-tree-prompt](https://github.com/insightfuls/inquirer-tree-prompt/blob/main/example/screenshot.gif)\n\n[**inquirer-table-prompt**](https://github.com/eduardoboucas/inquirer-table-prompt)<br>\nA table-like prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/eduardoboucas/inquirer-table-prompt/master/screen-capture.gif)\n\n[**inquirer-table-input**](https://github.com/edelciomolina/inquirer-table-input)<br>\nA table editing prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/edelciomolina/inquirer-table-input/master/screen-capture.gif)\n\n[**inquirer-interrupted-prompt**](https://github.com/lnquy065/inquirer-interrupted-prompt)<br>\nTurning any existing inquirer and its plugin prompts into prompts that can be interrupted with a custom key.<br>\n<br>\n![inquirer-interrupted-prompt](https://raw.githubusercontent.com/lnquy065/inquirer-interrupted-prompt/master/example/demo-menu.gif)\n\n[**inquirer-press-to-continue**](https://github.com/leonzalion/inquirer-press-to-continue)<br>\nA \"press any key to continue\" prompt for Inquirer.js<br>\n<br>\n![inquirer-press-to-continue](https://raw.githubusercontent.com/leonzalion/inquirer-press-to-continue/main/assets/demo.gif)\n","packages/number/README.md":"# `@inquirer/number`\n\nInteractive free number input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/number\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/number\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { number } from '@inquirer/prompts';\n// Or\n// import number from '@inquirer/number';\n\nconst answer = await number({ message: 'Enter your age' });\n```\n\n## Options\n\n| Property | Type                                                                       | Required | Description                                                                                                                                                                                                                                                     |\n| -------- | -------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                                   | yes      | The question to ask                                                                                                                                                                                                                                             |\n| default  | `number`                                                                   | no       | Default value if no answer is provided (clear it by pressing backspace)                                                                                                                                                                                         |\n| min      | `number`                                                                   | no       | The minimum value to accept for this input.                                                                                                                                                                                                                     |\n| max      | `number`                                                                   | no       | The maximum value to accept for this input.                                                                                                                                                                                                                     |\n| step     | `number \\| 'any'`                                                          | no       | The step option is a number that specifies the granularity that the value must adhere to. Only values which are equal to the basis for stepping (min if specified) are valid. This value defaults to 1, meaning by default the prompt will only allow integers. |\n| required | `boolean`                                                                  | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                                                         |\n| validate | `(number \\| undefined) => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                         |\n| theme    | [See Theming](#Theming)                                                    | no       | Customize look of the prompt.                                                                                                                                                                                                                                   |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/password/README.md":"# `@inquirer/password`\n\nInteractive password input component for command line interfaces. Supports input validation and masked or transparent modes.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/password\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/password\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { password } from '@inquirer/prompts';\n// Or\n// import password from '@inquirer/password';\n\nconst answer = await password({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| mask     | `boolean`                                                   | no       | Show a `*` mask over the input or keep it transparent                                                                                                                                                                   |\n| validate | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme    | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/prompts/README.md":"<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer\n\n[![npm](https://badge.fury.io/js/@inquirer%2Fprompts.svg)](https://www.npmjs.com/package/@inquirer/prompts)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\nGive it a try in your own terminal!\n\n```sh\nnpx @inquirer/demo@latest\n```\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\npnpm add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nbun add @inquirer/prompts\n```\n\n</td>\n</tr>\n</table>\n\n> [!NOTE]\n> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer).\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n# Prompts\n\n## [Input](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input)\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n```js\nimport { input } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input) for usage example and options documentation.\n\n## [Select](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select)\n\n![Select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n```js\nimport { select } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select) for usage example and options documentation.\n\n## [Checkbox](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox)\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n```js\nimport { checkbox } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox) for usage example and options documentation.\n\n## [Confirm](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm)\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n```js\nimport { confirm } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm) for usage example and options documentation.\n\n## [Search](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search)\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n```js\nimport { search } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search) for usage example and options documentation.\n\n## [Password](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password)\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n```js\nimport { password } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password) for usage example and options documentation.\n\n## [Expand](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand)\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n```js\nimport { expand } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand) for usage example and options documentation.\n\n## [Editor](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor)\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)\n\n```js\nimport { editor } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor) for usage example and options documentation.\n\n## [Number](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number)\n\nVery similar to the `input` prompt, but with built-in number validation configuration option.\n\n```js\nimport { number } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number) for usage example and options documentation.\n\n## [Raw List](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist) for usage example and options documentation.\n\n# Internationalization (i18n)\n\nNeed prompts in a language other than English? The [`@inquirer/i18n`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) package is a drop-in replacement for `@inquirer/prompts` with built-in localization.\n\nThe root import automatically detects your locale from the `LANGUAGE`, `LC_ALL`, `LC_MESSAGES`, and `LANG` environment variables (falling back to the `Intl` API). If no supported locale is found, English is used.\n\n```js\n// Drop-in replacement — locale is auto-detected from environment variables\nimport { input, select, confirm } from '@inquirer/i18n';\n```\n\nBuilt-in locales include English, French, Spanish, Chinese (Simplified), and Portuguese. You can also pin to a specific language via sub-path imports (e.g. `@inquirer/i18n/fr`), or use the `createLocalizedPrompts` and `registerLocale` APIs to add your own.\n\n[See the full documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) for available languages and how to create a custom locale.\n\n# Create your own prompts\n\nThe [API documentation is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core), and our [testing utilities here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/testing).\n\n# Advanced usage\n\nAll inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration.\n\nThe context options are:\n\n| Property          | Type                    | Required | Description                                                  |\n| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ |\n| input             | `NodeJS.ReadableStream` | no       | The stdin stream (defaults to `process.stdin`)               |\n| output            | `NodeJS.WritableStream` | no       | The stdout stream (defaults to `process.stdout`)             |\n| clearPromptOnDone | `boolean`               | no       | If true, we'll clear the screen after the prompt is answered |\n| signal            | `AbortSignal`           | no       | An AbortSignal to cancel prompts asynchronously              |\n\n> [!WARNING]\n> When providing an input stream or piping `process.stdin`, it's very likely you need to call `process.stdin.setRawMode(true)`\n> before calling inquirer functions. Node.js usually does it automatically, but when we shadow the stdin, Node can loss track\n> and not know it has to. If the prompt isn't interactive (arrows don't work, etc), it's likely due to this.\n\nWhen running Inquirer from an existing `node:readline` interface, pause the readline instance before starting the prompt, then resume it after the prompt settles. This makes the handoff of `process.stdin` ownership explicit and prevents the parent readline loop from losing control of the input stream.\n\n```js\nconst answer = await rl.question('Command: ');\n\nif (answer === 'configure') {\n  rl.pause();\n\n  try {\n    const value = await input({ message: 'Configuration value' });\n  } finally {\n    rl.resume();\n  }\n}\n```\n\nExample:\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm(\n  { message: 'Do you allow us to send you email?' },\n  {\n    output: new Stream.Writable({\n      write(chunk, _encoding, next) {\n        // Do something\n        next();\n      },\n    }),\n    clearPromptOnDone: true,\n  },\n);\n```\n\n## Canceling prompt\n\nThis can be done with either an `AbortController` or `AbortSignal`.\n\n```js\n// Example 1: using built-in AbortSignal utilities\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });\n```\n\n```js\n// Example 2: implementing custom cancellation with an AbortController\nimport { confirm } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nsetTimeout(() => {\n  controller.abort(); // This will reject the promise\n}, 5000);\n\nconst answer = await confirm({ ... }, { signal: controller.signal });\n```\n\n# Recipes\n\n## Handling `ctrl+c` gracefully\n\nWhen a user press `ctrl+c` to exit a prompt, Inquirer rejects the prompt promise. This is the expected behavior in order to allow your program to teardown/cleanup its environment. When using `async/await`, rejected promises throw their error. When unhandled, those errors print their stack trace in your user's terminal.\n\n```\nExitPromptError: User force closed the prompt with 0 null\n  at file://example/packages/core/dist/esm/lib/create-prompt.js:55:20\n  at Emitter.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:67:19)\n  at #processEmit (file://example/node_modules/signal-exit/dist/mjs/index.js:236:27)\n  at #process.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:187:37)\n  at process.callbackTrampoline (node:internal/async_hooks:130:17)\n```\n\nThis isn't a great UX, which is why we highly recommend you to handle those errors gracefully.\n\nFirst option is to wrap your scripts in `try/catch`; like [we do in our demo program](https://github.com/SBoudrias/Inquirer.js/blob/649e78147cbb6390a162ff842d4b21d53a233472/packages/demo/src/index.ts#L89-L95). Or handle the error in your CLI framework mechanism; for example [`Clipanion catch` method](https://mael.dev/clipanion/docs/errors#custom-error-handling).\n\nLastly, you could handle the error globally with an event listener and silence it.\n\n```ts\nprocess.on('uncaughtException', (error) => {\n  if (error instanceof Error && error.name === 'ExitPromptError') {\n    console.log('👋 until next time!');\n  } else {\n    // Rethrow unknown errors\n    throw error;\n  }\n});\n```\n\n## Get answers in an object\n\nWhen asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst answers = {\n  firstName: await input({ message: \"What's your first name?\" }),\n  allowEmail: await confirm({ message: 'Do you allow us to send you email?' }),\n};\n\nconsole.log(answers.firstName);\n```\n\n## Ask a question conditionally\n\nMaybe some questions depend on some other question's answer.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm({ message: 'Do you allow us to send you email?' });\n\nlet email;\nif (allowEmail) {\n  email = await input({ message: 'What is your email address' });\n}\n```\n\n## Get default value after timeout\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nconst timeout = setTimeout(() => {\n  controller.abort();\n}, 5000);\nconst clearInputTimeout = () => clearTimeout(timeout);\n\nprocess.stdin.once('keypress', clearInputTimeout);\n\nconst answer = await input(\n  { message: 'Enter a value (timing out in 5 seconds)' },\n  { signal: controller.signal },\n)\n  .catch((error) => {\n    if (error.name === 'AbortPromptError') {\n      return 'Default value';\n    }\n\n    throw error;\n  })\n  .finally(() => {\n    clearInputTimeout();\n    process.stdin.off('keypress', clearInputTimeout);\n  });\n```\n\n## Using as pre-commit/git hooks, or scripts\n\nBy default scripts ran from tools like `husky`/`lint-staged` might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process.\n\nFor it to work, you must make sure you start a `tty` (or \"interactive\" input stream.)\n\nIf those scripts are set within your `package.json`, you can define the stream like so:\n\n```json\n  \"precommit\": \"my-script < /dev/tty\"\n```\n\nOr if in a shell script file, you'll do it like so: (on Windows that's likely your only option)\n\n```sh\n#!/bin/sh\nexec < /dev/tty\n\nnode my-script.js\n```\n\n## Using with nodemon\n\nWhen using inquirer prompts with nodemon, you need to pass the `--no-stdin` flag for everything to work as expected.\n\n```sh\nnpx nodemon ./packages/demo/demos/password.mjs --no-stdin\n```\n\nNote that for most of you, you'll be able to use the new watch-mode built-in Node. This mode works out of the box with inquirer.\n\n```sh\n# One of depending on your need\nnode --watch script.js\nnode --watch-path=packages/ packages/demo/\n```\n\n## Wait for config\n\nMaybe some question configuration require to await a value.\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ message: await getMessage() });\n```\n\n## Usage with `npx` within bash scripts\n\nYou can use Inquirer prompts directly in the shell via [`npx`](https://docs.npmjs.com/cli/v8/commands/npx), which is useful for quick scripts or `package.json` commands.\n\nA community library, [@inquirer-cli](https://github.com/fishballapp/inquirer-cli), exposes each prompt as a standalone CLI.\n\nFor example, to prompt for input:\n\n```bash\nname=$(npx -y @inquirer-cli/input -r \"What is your name?\")\necho \"Hello, $name!\"\n```\n\nOr to create an interactive version bump:\n\n```bash\n$ npm version $(npx -y @inquirer-cli/select -c patch -c minor -c major 'Select Version')\n```\n\nFind out more: [@inquirer-cli](https://github.com/fishballapp/inquirer-cli).\n\n# Community prompts\n\nIf you created a cool prompt, [send us a PR adding it](https://github.com/SBoudrias/Inquirer.js/edit/main/packages/prompts/README.md) to the list below!\n\n[**Interactive List Prompt**](https://github.com/pgibler/inquirer-interactive-list-prompt)<br/>\nSelect a choice either with arrow keys + Enter or by pressing a key associated with a choice.\n\n```\n? Choose an option:\n>   Run command (D)\n    Quit (Q)\n```\n\n[**Action Select Prompt**](https://github.com/zenithlight/inquirer-action-select)<br/>\nChoose an item from a list and choose an action to take by pressing a key.\n\n```\n? Choose a file Open <O> Edit <E> Delete <X>\n❯ image.png\n  audio.mp3\n  code.py\n```\n\n[**Table Multiple Prompt**](https://github.com/Bartheleway/inquirer-table-multiple)<br/>\nSelect multiple answer from a table display.\n\n```sh\nChoose between choices? (Press <space> to select, <Up and Down> to move rows,\n<Left and Right> to move columns)\n\n┌──────────┬───────┬───────┐\n│ 1-2 of 2 │ Yes?  │ No?   |\n├──────────┼───────┼───────┤\n│ Choice 1 │ [ ◯ ] │   ◯   |\n├──────────┼───────┼───────┤\n│ Choice 2 │   ◯   │   ◯   |\n└──────────┴───────┴───────┘\n\n```\n\n[**Toggle Prompt**](https://github.com/skarahoda/inquirer-toggle)<br/>\nConfirm with a toggle. Select a choice with arrow keys + Enter.\n\n```\n? Do you want to continue? no / yes\n```\n\n[**Sortable Checkbox Prompt**](https://github.com/th0r/inquirer-sortable-checkbox)<br/>\nThe same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down.\n\n```\n? Which PRs and in what order would you like to merge? (Press <space> to select, <a> to toggle all, <i> to invert selection, <ctrl+up> to move item up, <ctrl+down> to move item down, and <enter> to proceed)\n❯ ◯ PR 1\n  ◯ PR 2\n  ◯ PR 3\n```\n\n[**Multi Select Prompt**](https://github.com/jeffwcx/inquirer-select-pro)\n\nAn inquirer select that supports multiple selections and filtering/searching.\n\n```\n? Choose your OS, IDE, PL, etc. (Press <tab> to select/deselect, <backspace> to remove selected\noption, <enter> to select option)\n>>  vue\n>[ ] vue\n [ ] vuejs\n [ ] fuelphp\n [ ] venv\n [ ] vercel\n (Use arrow keys to reveal more options)\n```\n\n[**File Selector Prompt**](https://github.com/br14n-sol/inquirer-file-selector)<br/>\nA file selector, you can navigate freely between directories, choose what type of files you want to allow and it is fully customizable.\n\n```sh\n? Select a file:\n/main/path/\n├── folder1/\n├── folder2/\n├── folder3/\n├── file1.txt\n├── file2.pdf\n└── file3.jpg (not allowed)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nUse ↑↓ to navigate through the list\nPress <esc> to navigate to the parent directory\nPress <enter> to select a file or navigate to a directory\n```\n\n[**Select Prompt with Stateful Banner**](https://github.com/patik/inquirer-select-with-state)<br/>\nThe same as built-in select prompt, but it also displays a banner above the prompt which can be updated with a `setState` function. For example, it can display the results of a long-running command without making the user wait to see the prompt.\n\nInitial display:\n\n```\nDirectory size: loading...\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\nA moment later:\n\n```\nDirectory size: 123M\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\n[**Ordered Checkbox Prompt**](https://github.com/kyou-izumi/inquirer-ordered-checkbox)<br/>\nA sortable checkbox prompt that maintains the order of selection. Perfect for prioritizing tasks or ranking options.\n\n```\n? Configure your development workflow:\n  [1] Set up CI/CD pipeline\n❯ [3] Code quality tools\n  [ ] Documentation\n  [2] Performance monitoring\n ──────────────\n- Legacy system (disabled)\n(Linting, formatting, and analysis)\n```\n\n[**Checkbox Plus Plus Prompt**](https://github.com/behnamazimi/inquirer-checkbox-plus-plus)<br/>\nA modern multiselect checkbox prompt with search and filter capabilities, highlighting, autocomplete, and improved UX. Supports both ESM and CommonJS and is compatible with @inquirer/core v10+.\n\n```\n? Select colors [searching: \"re\"]\n❯ ◉ The red color\n  ◯ The green color\n  ◉ The purple color\n  ◯ The orange color\n\n↑↓ navigate • space de/select • type search • 2 selected  • ⏎ submit\n```\n\n[**Tree Prompt**](https://github.com/3z3qu13l/inquirer-tree-prompt)<br/>\nNavigate a tree of choices, expanding and collapsing branches with the arrow keys. Children can be loaded lazily, and single or multiple items can be selected.\n\n```\n? Where is my phone?\n  ▼ in the house\n    ▼ in the living room\n      ❯ on the sofa\n        on the TV cabinet\n    ▶ in the bedroom\n      in the bathroom\n  ▶ in the car\n----------------\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/rawlist/README.md":"# `@inquirer/rawlist`\n\nSimple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.\n\n![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/rawlist\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/rawlist\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n// Or\n// import rawlist from '@inquirer/rawlist';\n\nconst answer = await rawlist({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    { name: 'pnpm', value: 'pnpm' },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                       |\n| -------- | ----------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                               |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                    |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |\n| default  | `Value`                 | no       | The value of the choice to preselect. If the value is not found, no choice is preselected.                                        |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                     |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  short?: string;\n  key?: string;\n  description?: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await rawlist()`.\n- `name`: This is the string displayed in the choice list.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `key`: The key of the choice. Displayed as `key) name`.\n- `description`: Option description which appears below the list when the choice is selected.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/search/README.md":"# `@inquirer/search`\n\nInteractive search prompt component for command line interfaces.\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/search\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/search\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { search, Separator } from '@inquirer/prompts';\n// Or\n// import search, { Separator } from '@inquirer/search';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    if (!input) {\n      return [];\n    }\n\n    const response = await fetch(\n      `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`,\n      { signal },\n    );\n    const data = await response.json();\n\n    return data.objects.map((pkg) => ({\n      name: pkg.package.name,\n      value: pkg.package.name,\n      description: pkg.package.description,\n    }));\n  },\n});\n```\n\n## Options\n\n| Property     | Type                                                       | Required | Description                                                                                                                                                                                          |\n| ------------ | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                   | yes      | The question to ask                                                                                                                                                                                  |\n| source       | `(term: string \\| void) => Promise<Choice[]>`              | yes      | This function returns the choices relevant to the search term.                                                                                                                                       |\n| pageSize     | `number`                                                   | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                          |\n| default      | `Value`                                                    | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.                                                                  |\n| initialValue | `string`                                                   | no       | The value used to pre-populate the search input. `source` will be called with this value as the initial search term.                                                                                 |\n| validate     | `Value => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme        | [See Theming](#Theming)                                    | no       | Customize look of the prompt.                                                                                                                                                                        |\n\n### `source` function\n\nThe full signature type of `source` is as follow:\n\n```ts\nfunction(\n  term: string | void,\n  opt: { signal: AbortSignal },\n): Promise<ReadonlyArray<Choice<Value> | Separator>>;\n```\n\nWhen `term` is `undefined`, it means the search term input is empty. You can use this to return default choices, or return an empty array.\n\nAside from returning the choices:\n\n1. An `AbortSignal` is passed in to cancel ongoing network calls when the search term change.\n2. `Separator`s can be used to organize the list.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await search()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nChoices can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n### Validation & autocomplete interaction\n\nThe validation within the search prompt acts as a signal for the autocomplete feature.\n\nWhen a list value is submitted and fail validation, the prompt will compare it to the search term. If they're the same, the prompt display the error. If they're not the same, we'll autocomplete the search term to match the value. Doing this will trigger a new search.\n\nYou can rely on this behavior to implement progressive autocomplete searches. Where you want the user to narrow the search in a progressive manner.\n\nPressing `tab` also triggers the term autocomplete.\n\nYou can see this behavior in action in [our search demo](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/src/demos/search.ts).\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    searchTerm: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n## Recipes\n\n### Debounce search\n\n```js\nimport { setTimeout } from 'node:timers/promises';\nimport { search } from '@inquirer/prompts';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    await setTimeout(300);\n    if (signal.aborted) return [];\n\n    // Do the search\n    fetch(...)\n  },\n});\n```\n\n# License\n\nCopyright (c) 2024 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/select/README.md":"# `@inquirer/select`\n\nSimple interactive command line prompt to display a list of choices (single select.)\n\n![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/select\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/select\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { select, Separator } from '@inquirer/prompts';\n// Or\n// import select, { Separator } from '@inquirer/select';\n\nconst answer = await select({\n  message: 'Select a package manager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm',\n      description: 'npm is the most popular package manager',\n    },\n    {\n      name: 'yarn',\n      value: 'yarn',\n      description: 'yarn is an awesome package manager',\n    },\n    new Separator(),\n    {\n      name: 'jspm',\n      value: 'jspm',\n      disabled: true,\n    },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                                 |\n| -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                                         |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                              |\n| default  | `string`                | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.         |\n| pageSize | `number`                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.           |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                               |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await select()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nWhen Vim keybindings are enabled, the prompt disables type-to-search so navigation keys are not interpreted as search input. You can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n  indexMode: 'hidden' | 'number';\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n### `theme.indexMode`\n\nControls how indices are displayed before each choice:\n\n- `hidden` (default): No indices are shown\n- `number`: Display a number before each choice (e.g. \"1. Option A\")\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","packages/testing/README.md":"# `@inquirer/testing`\n\nThe `@inquirer/testing` package is Inquirer's answer to testing prompts [built with `@inquirer/core`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/testing --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/testing --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\nThis package provides two ways to test Inquirer prompts:\n\n1. **Unit testing** with `render()` - Test individual prompts in isolation\n2. **E2E testing** with `screen` - Test full CLI applications that use Inquirer\n\n## Unit Testing with `render()`\n\nThe `render()` function creates and instruments a command line interface for testing a single prompt.\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\ndescribe('input prompt', () => {\n  it('handle simple use case', async () => {\n    const { answer, events, getScreen } = await render(input, {\n      message: 'What is your name',\n    });\n\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name\"`);\n\n    events.type('J');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name J\"`);\n\n    events.type('ohn');\n    events.keypress('enter');\n\n    await expect(answer).resolves.toEqual('John');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name John\"`);\n  });\n});\n```\n\n### `render()` API\n\n`render` takes 2 arguments:\n\n1. The Inquirer prompt to test (the return value of `createPrompt()`)\n2. The prompt configuration (the first prompt argument)\n\n`render` returns a promise that resolves once the prompt is rendered. This promise returns:\n\n- `answer` (`Promise`) - Resolves when an answer is provided and valid\n- `getScreen` (`({ raw?: boolean }) => string`) - Returns the current screen content. By default strips ANSI codes\n- `nextRender` (`() => Promise<void>`) - Wait for the next screen update. Use after triggering async actions (e.g. pressing enter with validation). Coalesces rapid back-to-back renders so a single `await nextRender()` captures the final settled state\n- `events` - Utilities to interact with the prompt:\n  - `keypress(key: string | KeyObject)` - Trigger a keypress event\n  - `type(text: string)` - Type text into the prompt\n- `getFullOutput` (`() => Promise<string>`) - Returns the full output interpreted through a virtual terminal, resolving ANSI escape sequences into the actual screen state\n\n### Async actions and `nextRender()`\n\nWhen a keypress triggers an asynchronous action (such as input validation), the screen won't update synchronously. Use `nextRender()` to wait for the prompt to settle before reading the screen:\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\nit('shows a validation error', async () => {\n  const { answer, events, getScreen, nextRender } = await render(input, {\n    message: 'Enter a number',\n    validate: (value) => /^\\d+$/.test(value) || 'Must be a number',\n  });\n\n  events.type('abc');\n  events.keypress('enter');\n\n  await nextRender(); // wait for validation to complete and the error to render\n  expect(getScreen()).toContain('Must be a number');\n\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.type('42');\n  events.keypress('enter');\n\n  await expect(answer).resolves.toEqual('42');\n});\n```\n\n### Unit Testing Example\n\nYou can refer to the [`@inquirer/input` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/input.test.ts) for a comprehensive unit testing example using `render()`.\n\n## E2E Testing with `screen`\n\nFor testing full CLI applications that use Inquirer prompts internally, use the framework-specific entry points:\n\n### Vitest\n\n```ts\nimport { describe, it, expect } from 'vitest';\nimport { screen } from '@inquirer/testing/vitest';\n\n// Import your CLI AFTER @inquirer/testing/vitest\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### Jest\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### `screen` API\n\nThe `screen` object provides:\n\n- `next()` - Wait for the next screen update (prompt transitions, validation errors, async updates). The initial prompt render is available immediately via `getScreen()` — no `next()` needed\n- `getScreen({ raw?: boolean })` - Get the current prompt screen content. By default strips ANSI codes\n- `getFullOutput({ raw?: boolean })` - Get all accumulated output interpreted through a virtual terminal (returns a `Promise`). By default resolves ANSI escape sequences into actual screen state\n- `type(text)` - Type text (writes to stream AND emits keypresses)\n- `keypress(key)` - Send a keypress event\n- `clear()` - Reset screen state (called automatically before each test)\n\n### Mocking Third-Party Prompts\n\nAll `@inquirer/*` prompts are mocked automatically. To mock a third-party or custom prompt package, use `wrapPrompt` in your own mock call:\n\n#### Vitest\n\n```ts\nimport { screen, wrapPrompt } from '@inquirer/testing/vitest';\n\nvi.mock('@my-company/custom-prompt', async (importOriginal) => {\n  const actual = await importOriginal<typeof import('@my-company/custom-prompt')>();\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n#### Jest\n\nIn Jest, `jest.mock()` factories are hoisted before imports, so `wrapPrompt` must be accessed via `jest.requireActual()` inside the factory:\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\n\njest.mock('@my-company/custom-prompt', () => {\n  const { wrapPrompt } = jest.requireActual('@inquirer/testing/jest');\n  const actual = jest.requireActual('@my-company/custom-prompt');\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n### Important Notes\n\n1. **Import order matters**: Import `@inquirer/testing/vitest` or `@inquirer/testing/jest` BEFORE importing modules that use Inquirer prompts\n2. **Editor prompt**: The external editor is mocked — `screen.type()` buffers text, and `screen.keypress('enter')` submits it (same pattern as other prompts). Works with both `waitForUserInput: true` and `false`\n3. **Sequential prompts**: Multiple prompts are supported, but they must run sequentially (not concurrently)\n\n### E2E Testing Example\n\nYou can refer to the [`@inquirer/demo` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/demo.test.ts) for a comprehensive E2E testing example using `screen`.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","tools/isolate-monorepo-package/README.md":"# isolate-monorepo-package\n\nTool to isolate a package within a monorepo, locally replicating the release flow to ensure dependencies will work together post build.\n\nAiming to simulate how packages work once published to npm, it:\n\n1. Auto-discovers all workspace dependencies (direct and transitive)\n2. Packs workspace dependencies as tarballs\n3. Creates an isolated temp directory with modified package.json\n4. Outputs the temp directory path for testing\n\nWhile it uses `yarn` behind the scenes, it should work with any package manager that supports workspaces.\n\n## Installation\n\nThis tool is automatically available in the Inquirer workspace. No separate installation needed.\n\nLet me know if you'd like to see this published.\n\n## Usage\n\n```bash\n# Basic usage - outputs the path to isolated directory\nisolate-monorepo-package @inquirer/demo\n\n# One-liner approach - CD directly into the isolated directory\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nyarn set version stable # specific to yarn, this repo isn't setup, so it'll need to know which version to run.\nyarn install\nyarn test\ncd -\n\n# Or with npm\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nnpm install\nnpm test\ncd -\n```\n\n## Command Line Options\n\n- `<package-name>`: The workspace package to isolate (required)\n- `-v, --verbose`: Show detailed progress information\n\n## Output\n\nThe tool outputs only the path to the isolated directory to stdout. All other messages go to stderr, making it easy to capture the path in scripts:\n\n```bash\n# Capture path in variable\nTEST_DIR=$(isolate-monorepo-package @inquirer/demo)\n\n# Or CD directly\ncd $(isolate-monorepo-package @inquirer/demo)\n```\n\n## Troubleshooting\n\nIf the tool fails:\n\n1. Check that you're in a Yarn workspace (`.yarnrc.yml` must exist)\n2. Verify the package name exists in the workspace\n3. Use `-v` flag for detailed output\n4. Ensure `/tmp/artifacts/` is writable\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","tools/package/README.md":"# @sboudrias/package\n\nPackage metadata tools for JavaScript packages and monorepos.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @sboudrias/package --dev\n```\n\n</td>\n<td>\n\n```sh\npnpm add @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nbun add @sboudrias/package --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```bash\npackage lint\n```\n\n`package lint` validates public workspace packages and fixes safe package metadata issues in place.\n\n```bash\npackage lint --check\n```\n\n`package lint --check` runs the same validation without writing files. It exits non-zero when any package needs a fix or has a manual conflict.\n\n# Lint Rules\n\n## Valid Peer Dependencies\n\nRuntime dependencies can declare their own peer dependencies. `package lint` makes those peer requirements visible on the package that uses the runtime dependency.\n\nIt adds missing peers to `peerDependencies` and copies matching `peerDependenciesMeta` entries so optional peers stay optional.\n\n## Matching engines\n\nPackages should only advertise Node.js support that their runtime dependencies can also support.\n\n`package lint` sets missing, invalid, or out-of-root-range `engines.node` values to the root package `engines.node` range. It fails when a runtime dependency supports a narrower Node.js range than the package.\n\nThat failure is intentional. Bumping a dependency can raise the minimum supported Node.js version and break dependants that still install the package under the previous `engines.node` range. In that case, manually narrow the package engine range or choose a compatible dependency version.\n\n## Ensure package.json is exposed\n\nPackages should expose their manifest for tools that inspect package metadata at runtime.\n\n`package lint` ensures public packages expose `\"./package.json\": \"./package.json\"` in `exports`.\n\n# Workspace Discovery\n\nThe CLI discovers workspaces from `package.json` `workspaces` fields and `pnpm-workspace.yaml` files.\n\nIf no workspaces are configured, the root `package.json` is linted as a single-package project.\n\nPrivate packages are ignored by default.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# Repository Guidelines\n\n## Project Structure & Module Organization\n\nThe repo is a Yarn workspaces monorepo. Core runtime logic shared primitives and shared primitives live in `packages/core/src`, and individual prompt implementations under `packages/<prompt>/src`. Testing utilities sit in `packages/testing`, while `packages/demo` provides the interactive showcase. Integration suites reside in `integration/cjs` and `integration/esm` to verify bundling. Tooling scripts and repo wiring (tsconfig, release helpers) live in `tools/`. Treat `packages/*/dist` and `tools/*/dist` as generated output.\n\n## Build, Test, and Development Commands\n\nInstall deps with `yarn install`. Use `yarn dev` for Turbo-powered incremental TypeScript builds. Launch the playground with `yarn demo`. Run `yarn tsc` for a project-wide compile. Execute `yarn pretest` for lint, format, and type gates, then `yarn test` for Vitest unit coverage followed by Node integration tests. After adding or moving workspaces, run `yarn setup` to refresh shared TS references.\n\n## Coding Style & Naming Conventions\n\nCode is ESM-first TypeScript targeting Node ≥ 18. Prettier enforces two-space indentation, trailing commas, and single quotes—lean on it rather than hand formatting. Prefer named exports, keep prompt IDs aligned with folder names, and store assets beside their entry points. Use `camelCase` for variables/functions and `PascalCase` for classes/components. Run `yarn oxlint --fix` and `yarn eslint --fix` before committing to maintain rule compliance.\n\n## TypeScript Best Practices\n\nPrioritize type safety and leverage existing types from the codebase. Use `Question<A>` from `packages/inquirer/src/types.ts` instead of generic `Record<string, unknown>` when working with question objects. Prefer `unknown` over `any` for truly unknown types, and use `Partial<T>` for optional properties. Leverage generic type parameters (like `<A extends Answers>`) throughout to maintain type consistency. Avoid eslint-disable comments by refactoring to proper types rather than suppressing warnings. When extending types, use intersection types (`Type & { prop: T }`) for explicit signatures rather than casting to `any`.\n\n## Testing Guidelines\n\nVitest owns unit coverage via `vitest.config.ts`, with `coverage.all = true` so untested files fail CI. Co-locate specs as `*.test.ts` next to source, and model cross-package flows under `integration/**/**/*.test.ts`. Iterate with `yarn vitest --run packages`, then finish with `yarn test` to exercise the full matrix. Update snapshots using `yarn vitest --update`.\n\nKeep tests simple and focused. Reuse existing test stubs and fixtures rather than creating custom mocks. If a behavior affects all prompts, test it with an existing prompt type rather than creating a specialized stub. Write tests that verify actual behavior rather than implementation details. Prefer straightforward assertions over complex validation logic.\n\n## Package-Specific Code Style\n\n### Type Declarations\n\nPrefer `type` over `interface` for all object shapes. Never prefix type names with `I` (no `IEditorParams`, `IFileOptions`). Use descriptive names without Hungarian notation: `EditorParams`, `FileOptions`.\n\n### Node.js Built-in Imports\n\nAlways use the `node:` protocol prefix for Node.js built-in modules: `import { spawn } from 'node:child_process'`, `import { readFileSync } from 'node:fs'`. This is enforced by linting.\n\n### Error Classes\n\nModel custom error classes after the style in `packages/core/src/lib/errors.ts`:\n\n- Declare `override name = 'ErrorName'` as a class field (not set in the constructor).\n- Pass `{ cause: originalError }` to `super()` to populate `this.cause` per the standard `Error` API.\n- Do not add a separate `originalError` instance field.\n- Do not include copyright header comments.\n\n### Async Patterns\n\nAll async operations must be Promise-based. Do not use Node-style callbacks `(err, result) => void`. Do not use `setImmediate` to defer callbacks; use `await` and `Promise` directly. Wrap event-emitter-based APIs (like `child_process.spawn`) in `new Promise(...)`.\n\n### Test File Location\n\nUnit tests must be co-located as `*.test.ts` files beside their source files inside `src/`. Separate `test/` directories are not used.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commit prefixes such as `feat:`, `fix:`, `docs:`, or `chore:`; keep scopes lowercase (`feat(@inquirer/package-name): add fuzzy search`). Summaries should stay imperative and under 80 characters. Pull requests must describe the change, list the commands run (for example `yarn test`), and link issues or discussions. Attach terminal recordings or screenshots for UX-facing changes, and ensure lockfiles and generated readme fragments stay current.\n","isInternal":false,"tokens":1191,"sizeBytes":4765},{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"Read @AGENTS.md\n","isInternal":false,"tokens":4,"sizeBytes":16},{"name":"README.md","path":"packages/ansi/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/ansi/README.md","title":"ansi Documentation","category":"plugin-manifest","format":"markdown","content":"# @inquirer/ansi\n\nA lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/ansi\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/ansi\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\n```js\nimport {\n  cursorUp,\n  cursorDown,\n  cursorTo,\n  cursorLeft,\n  cursorHide,\n  cursorShow,\n  eraseLines,\n} from '@inquirer/ansi';\n\n// Move cursor up 3 lines\nprocess.stdout.write(cursorUp(3));\n\n// Move cursor to specific position (x: 10, y: 5)\nprocess.stdout.write(cursorTo(10, 5));\n\n// Hide/show cursor\nprocess.stdout.write(cursorHide);\nprocess.stdout.write(cursorShow);\n\n// Clear 5 lines\nprocess.stdout.write(eraseLines(5));\n```\n\nOr when used inside an inquirer prompt:\n\n```js\nimport { cursorHide } from '@inquirer/ansi';\nimport { createPrompt } from '@inquirer/core';\n\nexport default createPrompt((config, done: (value: void) => void) => {\n  return `Choose an option${cursorHide}`;\n});\n```\n\n## API\n\n### Cursor Movement\n\n- **`cursorUp(count?: number)`** - Move cursor up by `count` lines (default: 1)\n- **`cursorDown(count?: number)`** - Move cursor down by `count` lines (default: 1)\n- **`cursorTo(x: number, y?: number)`** - Move cursor to position (x, y). If y is omitted, only moves horizontally\n- **`cursorLeft`** - Move cursor to beginning of line\n\n### Cursor Visibility\n\n- **`cursorHide`** - Hide the cursor\n- **`cursorShow`** - Show the cursor\n\n### Screen Manipulation\n\n- **`eraseLines(count: number)`** - Clear `count` lines and position cursor at the beginning of the first cleared line\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":440,"sizeBytes":1759},{"name":"README.md","path":"packages/checkbox/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/checkbox/README.md","title":"checkbox Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/checkbox`\n\nSimple interactive command line prompt to display a list of checkboxes (multi select).\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/checkbox\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/checkbox\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { checkbox, Separator } from '@inquirer/prompts';\n// Or\n// import checkbox, { Separator } from '@inquirer/checkbox';\n\nconst answer = await checkbox({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    new Separator(),\n    { name: 'pnpm', value: 'pnpm', disabled: true },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property  | Type                                    | Required | Description                                                                                                                                                                                           |\n| --------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message   | `string`                                | yes      | The question to ask                                                                                                                                                                                   |\n| choices   | `Choice[]`                              | yes      | List of the available choices.                                                                                                                                                                        |\n| pageSize  | `number`                                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                           |\n| loop      | `boolean`                               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.                                                                     |\n| required  | `boolean`                               | no       | When set to `true`, ensures at least one choice must be selected.                                                                                                                                     |\n| validate  | `async (Choice[]) => boolean \\| string` | no       | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| shortcuts | [See Shortcuts](#Shortcuts)             | no       | Customize shortcut keys for `all` and `invert`.                                                                                                                                                       |\n| theme     | [See Theming](#Theming)                 | no       | Customize look of the prompt.                                                                                                                                                                         |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  checkedName?: string;\n  description?: string;\n  short?: string;\n  checked?: boolean;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await checkbox()`.\n- `name`: This is the string displayed in the choice list.\n- `checkedName`: Alternative `name` (or format) displayed when the choice is checked.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `checked`: If `true`, the option will be checked by default.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nAlso note the `choices` array can contain `Separator`s to help organize long lists.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Shortcuts\n\nYou can customize the shortcut keys for `all` and `invert` or disable them by setting them to `null`.\n\n```ts\ntype Shortcuts = {\n  all?: string | null; // default: 'a'\n  invert?: string | null; // default: 'i'\n};\n```\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n    disabledChoice: (text: string) => string;\n    description: (text: string) => string;\n    renderSelectedChoices: <T>(\n      selectedChoices: ReadonlyArray<Choice<T>>,\n      allChoices: ReadonlyArray<Choice<T> | Separator>,\n    ) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    checked: string;\n    unchecked: string;\n    cursor: string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1897,"sizeBytes":7586},{"name":"README.md","path":"packages/confirm/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/confirm/README.md","title":"confirm Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/confirm`\n\nSimple interactive command line prompt to gather boolean input from users.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/confirm\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/confirm\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { confirm } from '@inquirer/prompts';\n// Or\n// import confirm from '@inquirer/confirm';\n\nconst answer = await confirm({ message: 'Continue?' });\n```\n\n## Options\n\n| Property    | Type                    | Required | Description                                             |\n| ----------- | ----------------------- | -------- | ------------------------------------------------------- |\n| message     | `string`                | yes      | The question to ask                                     |\n| default     | `boolean`               | no       | Default answer (true or false)                          |\n| transformer | `(boolean) => string`   | no       | Transform the prompt printed message to a custom string |\n| theme       | [See Theming](#Theming) | no       | Customize look of the prompt.                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":520,"sizeBytes":2078},{"name":"README.md","path":"packages/core/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/core/README.md","title":"core Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/core`\n\nThe `@inquirer/core` package is the library enabling the creation of Inquirer prompts.\n\nIt aims to implements a lightweight API similar to React hooks - but without JSX.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/core\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/core\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n## Basic concept\n\nVisual terminal apps are at their core strings rendered onto the terminal.\n\nThe most basic prompt is a function returning a string that'll be rendered in the terminal. This function will run every time the prompt state change, and the new returned string will replace the previously rendered one. The prompt cursor appears after the string.\n\nWrapping the rendering function with `createPrompt()` will setup the rendering layer, inject the state management utilities, and wait until the `done` callback is called.\n\n```ts\nimport { createPrompt } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  // Implement logic\n\n  return '? My question';\n});\n\n// And it is then called as\nconst answer = await input({/* config */});\n```\n\n## Hooks\n\nState management and user interactions are handled through hooks. Hooks are common [within the React ecosystem](https://react.dev/reference/react/hooks), and Inquirer reimplement the common ones.\n\n### State hook\n\nState lets a component “remember” information like user input. For example, an input prompt can use state to store the input value, while a list prompt can use state to track the cursor index.\n\n`useState` declares a state variable that you can update directly.\n\nThe setter also accepts an updater function to compute the next state from the current one (mirroring React):\n\n```ts\nconst [index, setIndex] = useState(0);\n\nsetIndex((current) => current + 1);\n```\n\n```ts\nimport { createPrompt, useState } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  const [index, setIndex] = useState(0);\n\n  // ...\n```\n\n### Keypress hook\n\nAlmost all prompts need to react to user actions. In a terminal, this is done through typing.\n\n`useKeypress` allows you to react to keypress events, and access the prompt line.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key) => {\n    if (key.name === 'enter') {\n      done(answer);\n    }\n  });\n\n  // ...\n```\n\nBehind the scenes, Inquirer prompts are wrappers around [readlines](https://nodejs.org/api/readline.html). Aside the keypress event object, the hook also pass the active readline instance to the event handler.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key, readline) => {\n    setValue(readline.line);\n  });\n\n  // ...\n```\n\n### Ref hook\n\nRefs let a prompt hold some information that isn’t used for rendering, like a class instance or a timeout ID. Unlike with state, updating a ref does not re-render your prompt. Refs are an “escape hatch” from the rendering paradigm.\n\n`useRef` declares a ref. You can hold any value in it, but most often it’s used to hold a timeout ID.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const timeout = useRef(null);\n\n  // ...\n```\n\n### Effect Hook\n\nEffects let a prompt connect to and synchronize with external systems. This includes dealing with network or animations.\n\n`useEffect` connects a component to an external system.\n\n```ts\nconst chat = createPrompt((config, done) => {\n  useEffect(() => {\n    const connection = createConnection(roomId);\n    connection.connect();\n    return () => connection.disconnect();\n  }, [roomId]);\n\n  // ...\n```\n\n### Performance hook\n\nA common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell Inquirer to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render.\n\n`useMemo` lets you cache the result of an expensive calculation.\n\n```ts\nconst todoSelect = createPrompt((config, done) => {\n  const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]);\n\n  // ...\n```\n\n### Rendering hooks\n\n#### Prefix / loading\n\nAll default prompts, and most custom ones, uses a prefix at the beginning of the prompt line. This helps visually delineate different questions, and provides a convenient area to render a loading spinner.\n\n`usePrefix` is a built-in hook to do this.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const prefix = usePrefix({ status });\n\n  return `${prefix} My question`;\n});\n```\n\n#### Pagination\n\nWhen looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options.\n\nPagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`.\n\n```js\nexport default createPrompt((config, done) => {\n  const [active, setActive] = useState(0);\n\n  const allChoices = config.choices.map((choice) => choice.name);\n\n  const page = usePagination({\n    items: allChoices,\n    active: active,\n    renderItem: ({ item, index, isActive }) => `${isActive ? \">\" : \" \"}${index}. ${item.toString()}`\n    pageSize: config.pageSize,\n    loop: config.loop,\n  });\n\n  return `... ${page}`;\n});\n```\n\n## `createPrompt()` API\n\nAs we saw earlier, the rendering function should return a string, and eventually call `done` to close the prompt and return the answer.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const [value, setValue] = useState();\n\n  useKeypress((key, readline) => {\n    if (key.name === 'enter') {\n      done(answer);\n    } else {\n      setValue(readline.line);\n    }\n  });\n\n  return `? ${config.message} ${value}`;\n});\n```\n\nThe rendering function can also return a tuple of 2 string (`[string, string]`.) The first string represents the prompt. The second one is content to render under the prompt, like an error message. The text input cursor will appear after the first string.\n\n```ts\nconst number = createPrompt((config, done) => {\n  // Add some logic here\n\n  return [`? My question ${input}`, `! The input must be a number`];\n});\n```\n\n### Typescript\n\nIf using typescript, `createPrompt` takes 2 generic arguments.\n\n```ts\n// createPrompt<Value, Config>\nconst input = createPrompt<string, { message: string }>(// ...\n```\n\nThe first one is the type of the resolved value\n\n```ts\nconst answer: string = await input();\n```\n\nThe second one is the type of the prompt config; in other words the interface the created prompt will provide to users.\n\n```ts\nconst answer = await input({\n  message: 'My question',\n});\n```\n\n## Key utilities\n\nListening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean:\n\n- `isEnterKey()`\n- `isBackspaceKey()`\n- `isSpaceKey()`\n- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`)\n- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`)\n- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally. Prompt-level `theme.keybindings` values override the environment variable.\n\n## Theming\n\nTheming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts.\n\nTo allow standard customization:\n\n```ts\nimport { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.style.highlight('hello')}`;\n});\n```\n\nTo setup a custom theme:\n\n```ts\nimport { createPrompt, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptTheme = {};\n\nconst promptTheme: PromptTheme = {\n  icon: '!',\n};\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme<PromptTheme>>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(promptTheme, config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.icon}`;\n});\n```\n\nThe [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts):\n\n```ts\ntype DefaultTheme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n  };\n};\n```\n\n# Examples\n\nYou can refer to any `@inquirer/prompts` prompts for real examples:\n\n- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts)\n- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts)\n- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts)\n- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts)\n- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts)\n- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts)\n- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts)\n- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts)\n\n```ts\nimport { styleText } from 'node:util';\nimport {\n  createPrompt,\n  useState,\n  useKeypress,\n  isEnterKey,\n  usePrefix,\n  type Status,\n} from '@inquirer/core';\n\nconst confirm = createPrompt<boolean, { message: string; default?: boolean }>(\n  (config, done) => {\n    const [status, setStatus] = useState<Status>('idle');\n    const [value, setValue] = useState('');\n    const prefix = usePrefix({});\n\n    useKeypress((key, rl) => {\n      if (isEnterKey(key)) {\n        const answer = value ? /^y(es)?/i.test(value) : config.default !== false;\n        setValue(answer ? 'yes' : 'no');\n        setStatus('done');\n        done(answer);\n      } else {\n        setValue(rl.line);\n      }\n    });\n\n    let formattedValue = value;\n    let defaultValue = '';\n    if (status === 'done') {\n      formattedValue = styleText('cyan', value);\n    } else {\n      defaultValue = styleText('dim', config.default === false ? ' (y/N)' : ' (Y/n)');\n    }\n\n    const message = styleText('bold', config.message);\n    return `${prefix} ${message}${defaultValue} ${formattedValue}`;\n  },\n);\n\n/**\n *  Which then can be used like this:\n */\nconst answer = await confirm({ message: 'Do you want to continue?' });\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":2971,"sizeBytes":11895},{"name":"README.md","path":"packages/editor/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/editor/README.md","title":"editor Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/editor`\n\nPrompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line.\n\nThe editor launched is the one [defined by the user's `EDITOR` environment variable](https://dev.to/jonasbn/til-integrate-visual-studio-code-with-shell--cli-2l1l).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/editor\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { editor } from '@inquirer/prompts';\n// Or\n// import editor from '@inquirer/editor';\n\nconst answer = await editor({\n  message: 'Enter a description',\n});\n```\n\n## Options\n\n| Property         | Type                                                                           | Required               | Description                                                                                                                                                                                                                            |\n| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message          | `string`                                                                       | yes                    | The question to ask                                                                                                                                                                                                                    |\n| default          | `string`                                                                       | no                     | Default value which will automatically be present in the editor                                                                                                                                                                        |\n| validate         | `string => boolean \\| string \\| Promise<boolean \\| string>`                    | no                     | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                  |\n| postfix          | `string`                                                                       | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.                                                                                                                     |\n| file             | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no                     | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file.                                                                                         |\n| waitForUserInput | `boolean`                                                                      | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |\n| theme            | [See Theming](#Theming)                                                        | no                     | Customize look of the prompt.                                                                                                                                                                                                          |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    key: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to the default value or empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1273,"sizeBytes":5089},{"name":"README.md","path":"packages/expand/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/expand/README.md","title":"expand Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/expand`\n\nCompact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/expand\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/expand\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { expand } from '@inquirer/prompts';\n// Or\n// import expand from '@inquirer/expand';\n\nconst answer = await expand({\n  message: 'Conflict on file.js',\n  default: 'y',\n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite',\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all',\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff',\n    },\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                               |\n| -------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                       |\n| choices  | `Choice[]`              | yes      | Array of the different allowed choices. The `h`/help option is always provided by default |\n| default  | `string`                | no       | Default choices to be selected. (value must be one of the choices `key`)                  |\n| expanded | `boolean`               | no       | Expand the choices by default                                                             |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                             |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  key: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await expand()`.\n- `name`: The string displayed in the choice list. It'll default to the stringify `value`.\n- `key`: The input the use must provide to select the choice. Must be a lowercase single alphanumeric character string.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    highlight: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":954,"sizeBytes":3816},{"name":"README.md","path":"packages/external-editor/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/external-editor/README.md","title":"external-editor Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/external-editor`\n\nA Node.js module to edit a string with the user's preferred text editor using $VISUAL or $EDITOR.\n\n> [!NOTE]\n> This package is a replacement for the unmaintained `external-editor`. It includes security fixes.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/external-editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/external-editor\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\nA simple example using the `edit` function\n\n```ts\nimport { edit } from '@inquirer/external-editor';\n\nconst data = edit('\\n\\n# Please write your text above');\nconsole.log(data);\n```\n\nExample relying on the class construct\n\n```ts\nimport {\n  ExternalEditor,\n  CreateFileError,\n  ReadFileError,\n  RemoveFileError,\n  LaunchEditorError,\n} from '@inquirer/external-editor';\n\ntry {\n  const editor = new ExternalEditor();\n  const text = editor.run(); // the text is also available in editor.text\n\n  if (editor.lastExitStatus !== 0) {\n    console.log('The editor exited with a non-zero code');\n  }\n\n  // Do things with the text\n  editor.cleanup();\n} catch (err) {\n  if (err instanceof CreateFileError) {\n    console.log('Failed to create the temporary file');\n  } else if (err instanceof ReadFileError) {\n    console.log('Failed to read the temporary file');\n  } else if (err instanceof LaunchEditorError) {\n    console.log('Failed to launch your editor');\n  } else if (err instanceof RemoveFileError) {\n    console.log('Failed to remove the temporary file');\n  } else {\n    throw err;\n  }\n}\n```\n\n### Windows editor commands\n\nOn Windows, prefer setting `$VISUAL` or `$EDITOR` to the editor executable\nrather than a `.cmd` or `.bat` shim. This package launches the editor directly\ninstead of through a shell so editor arguments and temporary file paths are not\ninterpreted as shell commands.\n\nFor example, use `Code.exe` with `--wait` instead of `code.cmd`:\n\n```powershell\nsetx VISUAL '\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" --wait'\n```\n\n#### API\n\n**Convenience Functions**\n\n- `edit(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - **Returns** (string) The contents of the file\n  - Could throw `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError`\n- `editAsync(text, callback, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `callback` (function (error?, text?))\n    - `error` could be of type `CreateFileError`, `ReadFileError`, `LaunchEditorError`, or `RemoveFileError`\n    - `text` (string) The contents of the file\n  - `config` (Config) _Optional_ Options for temporary file creation\n\n**Errors**\n\n- `CreateFileError` Error thrown if the temporary file could not be created.\n- `ReadFileError` Error thrown if the temporary file could not be read.\n- `RemoveFileError` Error thrown if the temporary file could not be removed during cleanup.\n- `LaunchEditorError` Error thrown if the editor could not be launched.\n\n**External Editor Public Methods**\n\n- `new ExternalEditor(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - Could throw `CreateFileError`\n- `run()` Launches the editor.\n  - **Returns** (string) The contents of the file\n  - Could throw `LaunchEditorError` or `ReadFileError`\n- `runAsync(callback)` Launches the editor in an async way\n  - `callback` (function (error?, text?))\n    - `error` could be of type `ReadFileError` or `LaunchEditorError`\n    - `text` (string) The contents of the file\n- `cleanup()` Removes the temporary file.\n  - Could throw `RemoveFileError`\n\n**External Editor Public Properties**\n\n- `text` (string) _readonly_ The text in the temporary file.\n- `editor.bin` (string) The editor determined from the environment.\n- `editor.args` (array) Default arguments for the bin\n- `tempFile` (string) Path to temporary file. Can be changed, but be careful as the temporary file probably already\n  exists and would need be removed manually.\n- `lastExitStatus` (number) The last exit code emitted from the editor.\n\n**Config Options**\n\n- `prefix` (string) _Optional_ A prefix for the file name.\n- `postfix` (string) _Optional_ A postfix for the file name. Useful if you want to provide an extension.\n- `mode` (number) _Optional_ Which mode to create the file with. e.g. 644\n- `dir` (string) _Optional_ Which path to store the file.\n\n## Why Synchronous?\n\nEverything is synchronous to make sure the editor has complete control of the stdin and stdout. Testing has shown\nasync launching of the editor can lead to issues when using readline or other packages which try to read from stdin or\nwrite to stdout. Seeing as this will be used in an interactive CLI environment, I made the decision to force the package\nto be synchronous. If you know a reliable way to force all stdin and stdout to be limited only to the child_process,\nplease submit a PR.\n\nIf async is really needed, you can use `editAsync` or `runAsync`. If you are using readline or have anything else\nlistening to the stdin or you write to stdout, you will most likely have problem, so make sure to remove any other\nlisteners on stdin, stdout, or stderr.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s.png)](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s)\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1374,"sizeBytes":5495},{"name":"README.md","path":"packages/input/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/input/README.md","title":"input Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/input`\n\nInteractive free text input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/input\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/input\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n// Or\n// import input from '@inquirer/input';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property     | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| ------------ | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| default      | `string`                                                    | no       | Default value if no answer is provided; see the prefill option below for governing it's behaviour.                                                                                                                      |\n| prefill      | `'tab' \\| 'editable'`                                       | no       | Defaults to `'tab'`. If set to `'tab'`, pressing `backspace` will clear the default and pressing `tab` will inline the value for edits; If set to `'editable'`, the default value will already be inlined to edit.      |\n| required     | `boolean`                                                   | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                 |\n| transformer  | `(string, { isFinal: boolean }) => string`                  | no       | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed.                                   |\n| validate     | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| pattern      | `RegExp`                                                    | no       | Regular expression to validate the input against. If the input doesn't match the pattern, validation will fail with the error message specified in `patternError`.                                                      |\n| patternError | `string`                                                    | no       | Error message to display when the input doesn't match the `pattern`. Defaults to `'Invalid input'`.                                                                                                                     |\n| theme        | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to an empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1290,"sizeBytes":5157},{"name":"README.md","path":"packages/inquirer/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/inquirer/README.md","title":"inquirer Documentation","category":"plugin-manifest","format":"markdown","content":"<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer.js\n\n[![npm](https://badge.fury.io/js/inquirer.svg)](https://www.npmjs.com/package/inquirer)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n> [!IMPORTANT]\n> This is the legacy version of Inquirer.js. While it still receives maintenance, it is not actively developed. For the new Inquirer, see [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts).\n\n## Table of Contents\n\n1.  [Documentation](#documentation)\n    1.  [Installation](#installation)\n    2.  [Examples](#examples)\n    3.  [Methods](#methods)\n    4.  [Objects](#objects)\n    5.  [Question](#question)\n    6.  [Answers](#answers)\n    7.  [Separator](#separator)\n    8.  [Prompt Types](#prompt-types)\n2.  [User Interfaces and Layouts](#user-interfaces-and-layouts)\n    1.  [Reactive Interface](#reactive-interface)\n3.  [Support](#support)\n4.  [Known issues](#issues)\n5.  [News](#news)\n6.  [Contributing](#contributing)\n7.  [License](#license)\n8.  [Plugins](#plugins)\n\n## Goal and Philosophy\n\n**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the \"CLI [Xanadu](https://en.wikipedia.org/wiki/Citizen_Kane)\").\n\n**`Inquirer.js`** should ease the process of\n\n- providing _error feedback_\n- _asking questions_\n- _parsing_ input\n- _validating_ answers\n- managing _hierarchical prompts_\n\n> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [commander](https://github.com/visionmedia/commander.js), [vorpal](https://github.com/dthree/vorpal) or [args](https://github.com/leo/args).\n\n## [Documentation](#documentation)\n\n<a name=\"documentation\"></a>\n\n### Installation\n\n<a name=\"installation\"></a>\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install inquirer\n```\n\n</td>\n<td>\n\n```sh\nyarn add inquirer\n```\n\n</td>\n</tr>\n</table>\n\n```javascript\nimport inquirer from 'inquirer';\n\ninquirer\n  .prompt([/* Pass your questions in here */])\n  .then((answers) => {\n    // Use user feedback for... whatever!!\n  })\n  .catch((error) => {\n    if (error.isTtyError) {\n      // Prompt couldn't be rendered in the current environment\n    } else {\n      // Something else went wrong\n    }\n  });\n```\n\n<a name=\"examples\"></a>\n\n### Examples (Run it and see it)\n\nCheck out the [`packages/inquirer/examples/`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer/examples) folder for code and interface examples.\n\n```shell\nyarn node packages/inquirer/examples/pizza.js\nyarn node packages/inquirer/examples/checkbox.js\n# etc...\n```\n\n### Methods\n\n<a name=\"methods\"></a>\n\n> [!WARNING]\n> Those interfaces are not necessary for modern Javascript, while still maintained, they're depreciated. We highly encourage you to adopt the more ergonomic and modern API with [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts). Both `inquirer` and `@inquirer/prompts` are usable at the same time, so you can progressively migrate.\n\n#### `inquirer.prompt(questions, answers) -> promise`\n\nLaunch the prompt interface (inquiry session)\n\n- **questions** a [Question Object](#question), an array or map of questions, or an RxJS-compatible Observable of questions\n- **answers** (object) contains values of already answered questions. Inquirer will avoid asking answers already provided here. Defaults `{}`.\n- returns a **Promise**\n\n#### `inquirer.registerPrompt(name, prompt)`\n\nRegister prompt plugins under `name`.\n\n- **name** (string) name of the this new prompt. (used for question `type`)\n- **prompt** (object) the prompt object itself (the plugin)\n\n#### `inquirer.createPromptModule() -> prompt function`\n\nCreate a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types.\n\n```js\nconst prompt = inquirer.createPromptModule();\n\nprompt(questions).then(/* ... */);\n```\n\n### Objects\n\n<a name=\"objects\"></a>\n\n#### Question\n\n<a name=\"questions\"></a>\nA question object is a `hash` containing question related values:\n\n- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `number`, `confirm`, `list`, `rawlist`, `expand`, `checkbox`, `password`, `editor`\n- **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash.\n- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon).\n- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.\n- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers.\n  Array values can be simple `numbers`, `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash), and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator).\n- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided.\n- **filter**: (Function) Receive the user input and answers hash. Returns the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash.\n- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash.\n- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean.\n- **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`.\n- **prefix**: (String) Change the default _prefix_ message.\n- **suffix**: (String) Change the default _suffix_ message.\n- **askAnswered**: (Boolean) Force to prompt the question if the answer already exists.\n- **loop**: (Boolean) Enable list looping. Defaults: `true`\n- **waitUserInput**: (Boolean) Flag to enable/disable wait for user input before opening system editor - Defaults: `true`\n\n`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value.\n\n```javascript\n{\n  /* Preferred way: with promise */\n  filter() {\n    return new Promise(/* etc... */);\n  },\n\n  /* Legacy way: with this.async */\n  validate: function (input) {\n    // Declare function as asynchronous, and save the done callback\n    const done = this.async();\n\n    // Do async stuff\n    setTimeout(function() {\n      if (typeof input !== 'number') {\n        // Pass the return value in the done callback\n        done('You need to provide a number');\n      } else {\n        // Pass the return value in the done callback\n        done(null, true);\n      }\n    }, 3000);\n  }\n}\n```\n\n### Answers\n\n<a name=\"answers\"></a>\nA key/value hash containing the client answers in each prompt.\n\n- **Key** The `name` property of the _question_ object\n- **Value** (Depends on the prompt)\n  - `confirm`: (Boolean)\n  - `input` : User input (filtered if `filter` is defined) (String)\n  - `number`: User input (filtered if `filter` is defined) (Number)\n  - `rawlist`, `list` : Selected choice value (or name if no value specified) (String)\n\n### Separator\n\n<a name=\"separator\"></a>\nA separator can be added to any `choices` array:\n\n```\n// In the question object\nchoices: [ \"Choice A\", new inquirer.Separator(), \"choice B\" ]\n\n// Which'll be displayed this way\n[?] What do you want to do?\n > Order a pizza\n   Make a reservation\n   --------\n   Ask opening hours\n   Talk to the receptionist\n```\n\nThe constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`.\n\nSeparator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists.\n\n<a name=\"prompt\"></a>\n\n### Prompt types\n\n---\n\n> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._\n\n#### List - `{type: 'list'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` or `value` of one of the entries in `choices`)\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n---\n\n#### Raw List - `{type: 'rawlist'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` of one of the entries in `choices`)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n---\n\n#### Expand - `{type: 'expand'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`] properties.\nNote: `default` must be the `index` of the desired default selection of the array. If `default` key not provided, then `help` will be used as default choice\n\nNote that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user.\n\nSee `examples/expand.js` for a running example.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n---\n\n#### Checkbox - `{type: 'checkbox'}`\n\nTake `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`, `loop`] properties. `default` is expected to be an Array of the checked choices value.\n\nChoices marked as `{checked: true}` will be checked by default.\n\nChoices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `\"Disabled\"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string.\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n---\n\n#### Confirm - `{type: 'confirm'}`\n\nTake `type`, `name`, `message`, [`default`, `transformer`] properties. `default` is expected to be a boolean if used.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n---\n\n#### Input - `{type: 'input'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n---\n\n#### Input - `{type: 'number'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n---\n\n#### Password - `{type: 'password'}`\n\nTake `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n---\n\nNote that `mask` is required to hide the actual user input.\n\n#### Editor - `{type: 'editor'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `postfix`, `waitUserInput`] properties\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the contents of the temporary file are read in as the result. The editor to use is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used.\n\nThe `postfix` property is useful if you want to provide an extension.\n\n<a name=\"layouts\"></a>\n\n### Use in Non-Interactive Environments\n\n`prompt()` requires that it is run in an interactive environment. (I.e. [One where `process.stdin.isTTY` is `true`](https://nodejs.org/docs/latest-v12.x/api/process.html#process_a_note_on_process_i_o)). If `prompt()` is invoked outside of such an environment, then `prompt()` will return a rejected promise with an error. For convenience, the error will have a `isTtyError` property to programmatically indicate the cause.\n\n<a name=\"reactive\"></a>\n\n## Reactive interface\n\n`inquirer.prompt()` accepts an RxJS-compatible Observable of questions. This supports dynamic flows where questions are emitted over time:\n\n```js\nconst prompts = new Rx.Subject();\ninquirer.prompt(prompts);\n\n// At some point in the future, push new questions\nprompts.next({/* question... */});\nprompts.next({/* question... */});\n\n// When you're done\nprompts.complete();\n```\n\nAnd using the return value `process` property, you can access more fine grained callbacks:\n\n```js\ninquirer.prompt(prompts).ui.process.subscribe(onEachAnswer, onError, onComplete);\n```\n\n## Support (OS Terminals)\n\n<a name=\"support\"></a>\n\nYou should expect mostly good support for the CLI below. This does not mean we won't\nlook at issues found on other command line - feel free to report any!\n\n- **Mac OS**:\n  - Terminal.app\n  - iTerm\n- **Windows ([Known issues](#issues))**:\n  - [Windows Terminal](https://github.com/microsoft/terminal)\n  - [ConEmu](https://conemu.github.io/)\n  - cmd.exe\n  - Powershell\n  - Cygwin\n- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**:\n  - gnome-terminal (Terminal GNOME)\n  - konsole\n\n## Known issues\n\n<a name=\"issues\"></a>\n\n- **nodemon** - Makes the arrow keys print gibrish on list prompts.\n  Workaround: Add `{ stdin : false }` in the configuration file or pass `--no-stdin` in the CLI.\n  Please refer to [this issue](https://github.com/SBoudrias/Inquirer.js/issues/844#issuecomment-736675867)\n\n- **grunt-exec** - Calling a node script that uses Inquirer from grunt-exec can cause the program to crash. To fix this, add to your grunt-exec config `stdio: 'inherit'`.\n  Please refer to [this issue](https://github.com/jharding/grunt-exec/issues/85)\n\n- **Windows network streams** - Running Inquirer together with network streams in Windows platform inside some terminals can result in process hang.\n  Workaround: run inside another terminal.\n  Please refer to [this issue](https://github.com/nodejs/node/issues/21771)\n\n## News on the march (Release notes)\n\n<a name=\"news\"></a>\n\nPlease refer to the [GitHub releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases)\n\n## Contributing\n\n<a name=\"contributing\"></a>\n\n**Unit test**\nPlease add a unit test for every new feature or bug fix. `yarn test` to run the test suite.\n\n**Documentation**\nAdd documentation for every API change. Feel free to send typo fixes and better docs!\n\nWe're looking to offer good support for multiple prompts and environments. If you want to\nhelp, we'd like to keep a list of testers for each terminal/OS so we can contact you and\nget feedback before release. Let us know if you want to be added to the list (just tweet\nto [@vaxilart](https://twitter.com/Vaxilart)) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers)\n\n## License\n\n<a name=\"license\"></a>\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n## Plugins\n\n<a name=\"plugins\"></a>\n\nYou can build custom prompts, or use open sourced ones. See [`@inquirer/core` documentation for building custom prompts](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\nYou can either call the custom prompts directly (preferred), or you can register them (depreciated):\n\n```js\nimport customPrompt from '$$$/custom-prompt';\n\n// 1. Preferred solution with new plugins\nconst answer = await customPrompt({ ...config });\n\n// 2. Depreciated interface (or for old plugins)\ninquirer.registerPrompt('custom', customPrompt);\nconst answers = await inquirer.prompt([\n  {\n    type: 'custom',\n    ...config,\n  },\n]);\n```\n\nWhen using Typescript and `registerPrompt`, you'll also need to define your prompt signature. Since Typescript is static, we cannot infer available plugins from function calls.\n\n```ts\nimport customPrompt from '$$$/custom-prompt';\n\ndeclare module 'inquirer' {\n  interface QuestionMap {\n    // 1. Easiest option\n    custom: Parameters<typeof customPrompt>[0];\n\n    // 2. Or manually define the prompt config\n    custom_alt: { message: string; option: number[] };\n  }\n}\n```\n\n### Prompts\n\n[**autocomplete**](https://github.com/mokkabonna/inquirer-autocomplete-prompt)<br>\nPresents a list of options as the user types, compatible with other packages such as fuzzy (for search)<br>\n<br>\n![autocomplete prompt](https://raw.githubusercontent.com/mokkabonna/inquirer-autocomplete-prompt/master/packages/inquirer-autocomplete-prompt/inquirer.gif)\n\n[**checkbox-plus**](https://github.com/faressoft/inquirer-checkbox-plus-prompt)<br>\nCheckbox list with autocomplete and other additions<br>\n<br>\n![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif)\n\n[**inquirer-date-prompt**](https://github.com/haversnail/inquirer-date-prompt)<br>\nCustomizable date/time selector with localization support<br>\n<br>\n![Date Prompt](https://github.com/haversnail/inquirer-date-prompt/raw/master/examples/demo.gif)\n\n[**datetime**](https://github.com/DerekTBrown/inquirer-datepicker-prompt)<br>\nCustomizable date/time selector using both number pad and arrow keys<br>\n<br>\n![Datetime Prompt](https://github.com/DerekTBrown/inquirer-datepicker-prompt/raw/master/example/datetime-prompt.png)\n\n[**inquirer-select-line**](https://github.com/adam-golab/inquirer-select-line)<br>\nPrompt for selecting index in array where add new element<br>\n<br>\n![inquirer-select-line gif](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif)\n\n[**command**](https://github.com/sullof/inquirer-command-prompt)<br>\nSimple prompt with command history and dynamic autocomplete<br>\n\n[**inquirer-fuzzy-path**](https://github.com/adelsz/inquirer-fuzzy-path)<br>\nPrompt for fuzzy file/directory selection.<br>\n<br>\n![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif)\n\n[**inquirer-emoji**](https://github.com/tannerntannern/inquirer-emoji)<br>\nPrompt for inputting emojis.<br>\n<br>\n![inquirer-emoji](https://github.com/tannerntannern/inquirer-emoji/raw/master/demo.gif)\n\n[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)<br>\nPrompt for input chalk-pipe style strings<br>\n<br>\n![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/blob/main/screenshot.gif)\n\n[**inquirer-search-checkbox**](https://github.com/clinyong/inquirer-search-checkbox)<br>\nSearchable Inquirer checkbox<br>\n![inquirer-search-checkbox](https://github.com/clinyong/inquirer-search-checkbox/blob/master/screenshot.png)\n\n[**inquirer-search-list**](https://github.com/robin-rpr/inquirer-search-list)<br>\nSearchable Inquirer list<br>\n<br>\n![inquirer-search-list](https://github.com/robin-rpr/inquirer-search-list/blob/master/preview.gif)\n\n[**inquirer-prompt-suggest**](https://github.com/olistic/inquirer-prompt-suggest)<br>\nInquirer prompt for your less creative users.<br>\n<br>\n![inquirer-prompt-suggest](https://user-images.githubusercontent.com/5600126/40391192-d4f3d6d0-5ded-11e8-932f-4b75b642c09e.gif)\n\n[**inquirer-s3**](https://github.com/HQarroum/inquirer-s3)<br>\nAn S3 object selector for Inquirer.<br>\n<br>\n![inquirer-s3](https://github.com/HQarroum/inquirer-s3/raw/master/docs/inquirer-screenshot.png)\n\n[**inquirer-autosubmit-prompt**](https://github.com/yaodingyd/inquirer-autosubmit-prompt)<br>\nAuto submit based on your current input, saving one extra enter<br>\n\n[**inquirer-file-tree-selection-prompt**](https://github.com/anc95/inquirer-file-tree-selection)<br>\nInquirer prompt for to select a file or directory in file tree<br>\n<br>\n![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif)\n\n[**inquirer-tree-prompt**](https://github.com/insightfuls/inquirer-tree-prompt)<br>\nInquirer prompt to select from a tree<br>\n<br>\n![inquirer-tree-prompt](https://github.com/insightfuls/inquirer-tree-prompt/blob/main/example/screenshot.gif)\n\n[**inquirer-table-prompt**](https://github.com/eduardoboucas/inquirer-table-prompt)<br>\nA table-like prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/eduardoboucas/inquirer-table-prompt/master/screen-capture.gif)\n\n[**inquirer-table-input**](https://github.com/edelciomolina/inquirer-table-input)<br>\nA table editing prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/edelciomolina/inquirer-table-input/master/screen-capture.gif)\n\n[**inquirer-interrupted-prompt**](https://github.com/lnquy065/inquirer-interrupted-prompt)<br>\nTurning any existing inquirer and its plugin prompts into prompts that can be interrupted with a custom key.<br>\n<br>\n![inquirer-interrupted-prompt](https://raw.githubusercontent.com/lnquy065/inquirer-interrupted-prompt/master/example/demo-menu.gif)\n\n[**inquirer-press-to-continue**](https://github.com/leonzalion/inquirer-press-to-continue)<br>\nA \"press any key to continue\" prompt for Inquirer.js<br>\n<br>\n![inquirer-press-to-continue](https://raw.githubusercontent.com/leonzalion/inquirer-press-to-continue/main/assets/demo.gif)\n","isInternal":false,"tokens":5628,"sizeBytes":22512},{"name":"README.md","path":"packages/number/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/number/README.md","title":"number Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/number`\n\nInteractive free number input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/number\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/number\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { number } from '@inquirer/prompts';\n// Or\n// import number from '@inquirer/number';\n\nconst answer = await number({ message: 'Enter your age' });\n```\n\n## Options\n\n| Property | Type                                                                       | Required | Description                                                                                                                                                                                                                                                     |\n| -------- | -------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                                   | yes      | The question to ask                                                                                                                                                                                                                                             |\n| default  | `number`                                                                   | no       | Default value if no answer is provided (clear it by pressing backspace)                                                                                                                                                                                         |\n| min      | `number`                                                                   | no       | The minimum value to accept for this input.                                                                                                                                                                                                                     |\n| max      | `number`                                                                   | no       | The maximum value to accept for this input.                                                                                                                                                                                                                     |\n| step     | `number \\| 'any'`                                                          | no       | The step option is a number that specifies the granularity that the value must adhere to. Only values which are equal to the basis for stepping (min if specified) are valid. This value defaults to 1, meaning by default the prompt will only allow integers. |\n| required | `boolean`                                                                  | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                                                         |\n| validate | `(number \\| undefined) => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                         |\n| theme    | [See Theming](#Theming)                                                    | no       | Customize look of the prompt.                                                                                                                                                                                                                                   |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1237,"sizeBytes":4947},{"name":"README.md","path":"packages/password/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/password/README.md","title":"password Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/password`\n\nInteractive password input component for command line interfaces. Supports input validation and masked or transparent modes.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/password\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/password\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { password } from '@inquirer/prompts';\n// Or\n// import password from '@inquirer/password';\n\nconst answer = await password({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| mask     | `boolean`                                                   | no       | Show a `*` mask over the input or keep it transparent                                                                                                                                                                   |\n| validate | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme    | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":833,"sizeBytes":3329},{"name":"README.md","path":"packages/prompts/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/prompts/README.md","title":"prompts Documentation","category":"plugin-manifest","format":"markdown","content":"<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer\n\n[![npm](https://badge.fury.io/js/@inquirer%2Fprompts.svg)](https://www.npmjs.com/package/@inquirer/prompts)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\nGive it a try in your own terminal!\n\n```sh\nnpx @inquirer/demo@latest\n```\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\npnpm add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nbun add @inquirer/prompts\n```\n\n</td>\n</tr>\n</table>\n\n> [!NOTE]\n> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer).\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n# Prompts\n\n## [Input](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input)\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n```js\nimport { input } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input) for usage example and options documentation.\n\n## [Select](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select)\n\n![Select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n```js\nimport { select } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select) for usage example and options documentation.\n\n## [Checkbox](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox)\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n```js\nimport { checkbox } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox) for usage example and options documentation.\n\n## [Confirm](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm)\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n```js\nimport { confirm } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm) for usage example and options documentation.\n\n## [Search](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search)\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n```js\nimport { search } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search) for usage example and options documentation.\n\n## [Password](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password)\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n```js\nimport { password } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password) for usage example and options documentation.\n\n## [Expand](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand)\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n```js\nimport { expand } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand) for usage example and options documentation.\n\n## [Editor](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor)\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)\n\n```js\nimport { editor } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor) for usage example and options documentation.\n\n## [Number](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number)\n\nVery similar to the `input` prompt, but with built-in number validation configuration option.\n\n```js\nimport { number } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number) for usage example and options documentation.\n\n## [Raw List](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist) for usage example and options documentation.\n\n# Internationalization (i18n)\n\nNeed prompts in a language other than English? The [`@inquirer/i18n`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) package is a drop-in replacement for `@inquirer/prompts` with built-in localization.\n\nThe root import automatically detects your locale from the `LANGUAGE`, `LC_ALL`, `LC_MESSAGES`, and `LANG` environment variables (falling back to the `Intl` API). If no supported locale is found, English is used.\n\n```js\n// Drop-in replacement — locale is auto-detected from environment variables\nimport { input, select, confirm } from '@inquirer/i18n';\n```\n\nBuilt-in locales include English, French, Spanish, Chinese (Simplified), and Portuguese. You can also pin to a specific language via sub-path imports (e.g. `@inquirer/i18n/fr`), or use the `createLocalizedPrompts` and `registerLocale` APIs to add your own.\n\n[See the full documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) for available languages and how to create a custom locale.\n\n# Create your own prompts\n\nThe [API documentation is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core), and our [testing utilities here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/testing).\n\n# Advanced usage\n\nAll inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration.\n\nThe context options are:\n\n| Property          | Type                    | Required | Description                                                  |\n| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ |\n| input             | `NodeJS.ReadableStream` | no       | The stdin stream (defaults to `process.stdin`)               |\n| output            | `NodeJS.WritableStream` | no       | The stdout stream (defaults to `process.stdout`)             |\n| clearPromptOnDone | `boolean`               | no       | If true, we'll clear the screen after the prompt is answered |\n| signal            | `AbortSignal`           | no       | An AbortSignal to cancel prompts asynchronously              |\n\n> [!WARNING]\n> When providing an input stream or piping `process.stdin`, it's very likely you need to call `process.stdin.setRawMode(true)`\n> before calling inquirer functions. Node.js usually does it automatically, but when we shadow the stdin, Node can loss track\n> and not know it has to. If the prompt isn't interactive (arrows don't work, etc), it's likely due to this.\n\nWhen running Inquirer from an existing `node:readline` interface, pause the readline instance before starting the prompt, then resume it after the prompt settles. This makes the handoff of `process.stdin` ownership explicit and prevents the parent readline loop from losing control of the input stream.\n\n```js\nconst answer = await rl.question('Command: ');\n\nif (answer === 'configure') {\n  rl.pause();\n\n  try {\n    const value = await input({ message: 'Configuration value' });\n  } finally {\n    rl.resume();\n  }\n}\n```\n\nExample:\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm(\n  { message: 'Do you allow us to send you email?' },\n  {\n    output: new Stream.Writable({\n      write(chunk, _encoding, next) {\n        // Do something\n        next();\n      },\n    }),\n    clearPromptOnDone: true,\n  },\n);\n```\n\n## Canceling prompt\n\nThis can be done with either an `AbortController` or `AbortSignal`.\n\n```js\n// Example 1: using built-in AbortSignal utilities\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });\n```\n\n```js\n// Example 2: implementing custom cancellation with an AbortController\nimport { confirm } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nsetTimeout(() => {\n  controller.abort(); // This will reject the promise\n}, 5000);\n\nconst answer = await confirm({ ... }, { signal: controller.signal });\n```\n\n# Recipes\n\n## Handling `ctrl+c` gracefully\n\nWhen a user press `ctrl+c` to exit a prompt, Inquirer rejects the prompt promise. This is the expected behavior in order to allow your program to teardown/cleanup its environment. When using `async/await`, rejected promises throw their error. When unhandled, those errors print their stack trace in your user's terminal.\n\n```\nExitPromptError: User force closed the prompt with 0 null\n  at file://example/packages/core/dist/esm/lib/create-prompt.js:55:20\n  at Emitter.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:67:19)\n  at #processEmit (file://example/node_modules/signal-exit/dist/mjs/index.js:236:27)\n  at #process.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:187:37)\n  at process.callbackTrampoline (node:internal/async_hooks:130:17)\n```\n\nThis isn't a great UX, which is why we highly recommend you to handle those errors gracefully.\n\nFirst option is to wrap your scripts in `try/catch`; like [we do in our demo program](https://github.com/SBoudrias/Inquirer.js/blob/649e78147cbb6390a162ff842d4b21d53a233472/packages/demo/src/index.ts#L89-L95). Or handle the error in your CLI framework mechanism; for example [`Clipanion catch` method](https://mael.dev/clipanion/docs/errors#custom-error-handling).\n\nLastly, you could handle the error globally with an event listener and silence it.\n\n```ts\nprocess.on('uncaughtException', (error) => {\n  if (error instanceof Error && error.name === 'ExitPromptError') {\n    console.log('👋 until next time!');\n  } else {\n    // Rethrow unknown errors\n    throw error;\n  }\n});\n```\n\n## Get answers in an object\n\nWhen asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst answers = {\n  firstName: await input({ message: \"What's your first name?\" }),\n  allowEmail: await confirm({ message: 'Do you allow us to send you email?' }),\n};\n\nconsole.log(answers.firstName);\n```\n\n## Ask a question conditionally\n\nMaybe some questions depend on some other question's answer.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm({ message: 'Do you allow us to send you email?' });\n\nlet email;\nif (allowEmail) {\n  email = await input({ message: 'What is your email address' });\n}\n```\n\n## Get default value after timeout\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nconst timeout = setTimeout(() => {\n  controller.abort();\n}, 5000);\nconst clearInputTimeout = () => clearTimeout(timeout);\n\nprocess.stdin.once('keypress', clearInputTimeout);\n\nconst answer = await input(\n  { message: 'Enter a value (timing out in 5 seconds)' },\n  { signal: controller.signal },\n)\n  .catch((error) => {\n    if (error.name === 'AbortPromptError') {\n      return 'Default value';\n    }\n\n    throw error;\n  })\n  .finally(() => {\n    clearInputTimeout();\n    process.stdin.off('keypress', clearInputTimeout);\n  });\n```\n\n## Using as pre-commit/git hooks, or scripts\n\nBy default scripts ran from tools like `husky`/`lint-staged` might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process.\n\nFor it to work, you must make sure you start a `tty` (or \"interactive\" input stream.)\n\nIf those scripts are set within your `package.json`, you can define the stream like so:\n\n```json\n  \"precommit\": \"my-script < /dev/tty\"\n```\n\nOr if in a shell script file, you'll do it like so: (on Windows that's likely your only option)\n\n```sh\n#!/bin/sh\nexec < /dev/tty\n\nnode my-script.js\n```\n\n## Using with nodemon\n\nWhen using inquirer prompts with nodemon, you need to pass the `--no-stdin` flag for everything to work as expected.\n\n```sh\nnpx nodemon ./packages/demo/demos/password.mjs --no-stdin\n```\n\nNote that for most of you, you'll be able to use the new watch-mode built-in Node. This mode works out of the box with inquirer.\n\n```sh\n# One of depending on your need\nnode --watch script.js\nnode --watch-path=packages/ packages/demo/\n```\n\n## Wait for config\n\nMaybe some question configuration require to await a value.\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ message: await getMessage() });\n```\n\n## Usage with `npx` within bash scripts\n\nYou can use Inquirer prompts directly in the shell via [`npx`](https://docs.npmjs.com/cli/v8/commands/npx), which is useful for quick scripts or `package.json` commands.\n\nA community library, [@inquirer-cli](https://github.com/fishballapp/inquirer-cli), exposes each prompt as a standalone CLI.\n\nFor example, to prompt for input:\n\n```bash\nname=$(npx -y @inquirer-cli/input -r \"What is your name?\")\necho \"Hello, $name!\"\n```\n\nOr to create an interactive version bump:\n\n```bash\n$ npm version $(npx -y @inquirer-cli/select -c patch -c minor -c major 'Select Version')\n```\n\nFind out more: [@inquirer-cli](https://github.com/fishballapp/inquirer-cli).\n\n# Community prompts\n\nIf you created a cool prompt, [send us a PR adding it](https://github.com/SBoudrias/Inquirer.js/edit/main/packages/prompts/README.md) to the list below!\n\n[**Interactive List Prompt**](https://github.com/pgibler/inquirer-interactive-list-prompt)<br/>\nSelect a choice either with arrow keys + Enter or by pressing a key associated with a choice.\n\n```\n? Choose an option:\n>   Run command (D)\n    Quit (Q)\n```\n\n[**Action Select Prompt**](https://github.com/zenithlight/inquirer-action-select)<br/>\nChoose an item from a list and choose an action to take by pressing a key.\n\n```\n? Choose a file Open <O> Edit <E> Delete <X>\n❯ image.png\n  audio.mp3\n  code.py\n```\n\n[**Table Multiple Prompt**](https://github.com/Bartheleway/inquirer-table-multiple)<br/>\nSelect multiple answer from a table display.\n\n```sh\nChoose between choices? (Press <space> to select, <Up and Down> to move rows,\n<Left and Right> to move columns)\n\n┌──────────┬───────┬───────┐\n│ 1-2 of 2 │ Yes?  │ No?   |\n├──────────┼───────┼───────┤\n│ Choice 1 │ [ ◯ ] │   ◯   |\n├──────────┼───────┼───────┤\n│ Choice 2 │   ◯   │   ◯   |\n└──────────┴───────┴───────┘\n\n```\n\n[**Toggle Prompt**](https://github.com/skarahoda/inquirer-toggle)<br/>\nConfirm with a toggle. Select a choice with arrow keys + Enter.\n\n```\n? Do you want to continue? no / yes\n```\n\n[**Sortable Checkbox Prompt**](https://github.com/th0r/inquirer-sortable-checkbox)<br/>\nThe same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down.\n\n```\n? Which PRs and in what order would you like to merge? (Press <space> to select, <a> to toggle all, <i> to invert selection, <ctrl+up> to move item up, <ctrl+down> to move item down, and <enter> to proceed)\n❯ ◯ PR 1\n  ◯ PR 2\n  ◯ PR 3\n```\n\n[**Multi Select Prompt**](https://github.com/jeffwcx/inquirer-select-pro)\n\nAn inquirer select that supports multiple selections and filtering/searching.\n\n```\n? Choose your OS, IDE, PL, etc. (Press <tab> to select/deselect, <backspace> to remove selected\noption, <enter> to select option)\n>>  vue\n>[ ] vue\n [ ] vuejs\n [ ] fuelphp\n [ ] venv\n [ ] vercel\n (Use arrow keys to reveal more options)\n```\n\n[**File Selector Prompt**](https://github.com/br14n-sol/inquirer-file-selector)<br/>\nA file selector, you can navigate freely between directories, choose what type of files you want to allow and it is fully customizable.\n\n```sh\n? Select a file:\n/main/path/\n├── folder1/\n├── folder2/\n├── folder3/\n├── file1.txt\n├── file2.pdf\n└── file3.jpg (not allowed)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nUse ↑↓ to navigate through the list\nPress <esc> to navigate to the parent directory\nPress <enter> to select a file or navigate to a directory\n```\n\n[**Select Prompt with Stateful Banner**](https://github.com/patik/inquirer-select-with-state)<br/>\nThe same as built-in select prompt, but it also displays a banner above the prompt which can be updated with a `setState` function. For example, it can display the results of a long-running command without making the user wait to see the prompt.\n\nInitial display:\n\n```\nDirectory size: loading...\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\nA moment later:\n\n```\nDirectory size: 123M\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\n[**Ordered Checkbox Prompt**](https://github.com/kyou-izumi/inquirer-ordered-checkbox)<br/>\nA sortable checkbox prompt that maintains the order of selection. Perfect for prioritizing tasks or ranking options.\n\n```\n? Configure your development workflow:\n  [1] Set up CI/CD pipeline\n❯ [3] Code quality tools\n  [ ] Documentation\n  [2] Performance monitoring\n ──────────────\n- Legacy system (disabled)\n(Linting, formatting, and analysis)\n```\n\n[**Checkbox Plus Plus Prompt**](https://github.com/behnamazimi/inquirer-checkbox-plus-plus)<br/>\nA modern multiselect checkbox prompt with search and filter capabilities, highlighting, autocomplete, and improved UX. Supports both ESM and CommonJS and is compatible with @inquirer/core v10+.\n\n```\n? Select colors [searching: \"re\"]\n❯ ◉ The red color\n  ◯ The green color\n  ◉ The purple color\n  ◯ The orange color\n\n↑↓ navigate • space de/select • type search • 2 selected  • ⏎ submit\n```\n\n[**Tree Prompt**](https://github.com/3z3qu13l/inquirer-tree-prompt)<br/>\nNavigate a tree of choices, expanding and collapsing branches with the arrow keys. Children can be loaded lazily, and single or multiple items can be selected.\n\n```\n? Where is my phone?\n  ▼ in the house\n    ▼ in the living room\n      ❯ on the sofa\n        on the TV cabinet\n    ▶ in the bedroom\n      in the bathroom\n  ▶ in the car\n----------------\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":4979,"sizeBytes":20400},{"name":"README.md","path":"packages/rawlist/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/rawlist/README.md","title":"rawlist Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/rawlist`\n\nSimple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.\n\n![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/rawlist\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/rawlist\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n// Or\n// import rawlist from '@inquirer/rawlist';\n\nconst answer = await rawlist({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    { name: 'pnpm', value: 'pnpm' },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                       |\n| -------- | ----------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                               |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                    |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |\n| default  | `Value`                 | no       | The value of the choice to preselect. If the value is not found, no choice is preselected.                                        |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                     |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  short?: string;\n  key?: string;\n  description?: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await rawlist()`.\n- `name`: This is the string displayed in the choice list.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `key`: The key of the choice. Displayed as `key) name`.\n- `description`: Option description which appears below the list when the choice is selected.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1072,"sizeBytes":4288},{"name":"README.md","path":"packages/search/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/search/README.md","title":"search Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/search`\n\nInteractive search prompt component for command line interfaces.\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/search\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/search\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { search, Separator } from '@inquirer/prompts';\n// Or\n// import search, { Separator } from '@inquirer/search';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    if (!input) {\n      return [];\n    }\n\n    const response = await fetch(\n      `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`,\n      { signal },\n    );\n    const data = await response.json();\n\n    return data.objects.map((pkg) => ({\n      name: pkg.package.name,\n      value: pkg.package.name,\n      description: pkg.package.description,\n    }));\n  },\n});\n```\n\n## Options\n\n| Property     | Type                                                       | Required | Description                                                                                                                                                                                          |\n| ------------ | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                   | yes      | The question to ask                                                                                                                                                                                  |\n| source       | `(term: string \\| void) => Promise<Choice[]>`              | yes      | This function returns the choices relevant to the search term.                                                                                                                                       |\n| pageSize     | `number`                                                   | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                          |\n| default      | `Value`                                                    | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.                                                                  |\n| initialValue | `string`                                                   | no       | The value used to pre-populate the search input. `source` will be called with this value as the initial search term.                                                                                 |\n| validate     | `Value => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme        | [See Theming](#Theming)                                    | no       | Customize look of the prompt.                                                                                                                                                                        |\n\n### `source` function\n\nThe full signature type of `source` is as follow:\n\n```ts\nfunction(\n  term: string | void,\n  opt: { signal: AbortSignal },\n): Promise<ReadonlyArray<Choice<Value> | Separator>>;\n```\n\nWhen `term` is `undefined`, it means the search term input is empty. You can use this to return default choices, or return an empty array.\n\nAside from returning the choices:\n\n1. An `AbortSignal` is passed in to cancel ongoing network calls when the search term change.\n2. `Separator`s can be used to organize the list.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await search()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nChoices can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n### Validation & autocomplete interaction\n\nThe validation within the search prompt acts as a signal for the autocomplete feature.\n\nWhen a list value is submitted and fail validation, the prompt will compare it to the search term. If they're the same, the prompt display the error. If they're not the same, we'll autocomplete the search term to match the value. Doing this will trigger a new search.\n\nYou can rely on this behavior to implement progressive autocomplete searches. Where you want the user to narrow the search in a progressive manner.\n\nPressing `tab` also triggers the term autocomplete.\n\nYou can see this behavior in action in [our search demo](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/src/demos/search.ts).\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    searchTerm: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n## Recipes\n\n### Debounce search\n\n```js\nimport { setTimeout } from 'node:timers/promises';\nimport { search } from '@inquirer/prompts';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    await setTimeout(300);\n    if (signal.aborted) return [];\n\n    // Do the search\n    fetch(...)\n  },\n});\n```\n\n# License\n\nCopyright (c) 2024 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1969,"sizeBytes":7874},{"name":"README.md","path":"packages/select/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/select/README.md","title":"select Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/select`\n\nSimple interactive command line prompt to display a list of choices (single select.)\n\n![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/select\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/select\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { select, Separator } from '@inquirer/prompts';\n// Or\n// import select, { Separator } from '@inquirer/select';\n\nconst answer = await select({\n  message: 'Select a package manager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm',\n      description: 'npm is the most popular package manager',\n    },\n    {\n      name: 'yarn',\n      value: 'yarn',\n      description: 'yarn is an awesome package manager',\n    },\n    new Separator(),\n    {\n      name: 'jspm',\n      value: 'jspm',\n      disabled: true,\n    },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                                 |\n| -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                                         |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                              |\n| default  | `string`                | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.         |\n| pageSize | `number`                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.           |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                               |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await select()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nWhen Vim keybindings are enabled, the prompt disables type-to-search so navigation keys are not interpreted as search input. You can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n  indexMode: 'hidden' | 'number';\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n### `theme.indexMode`\n\nControls how indices are displayed before each choice:\n\n- `hidden` (default): No indices are shown\n- `number`: Display a number before each choice (e.g. \"1. Option A\")\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1541,"sizeBytes":6162},{"name":"README.md","path":"packages/testing/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/packages/testing/README.md","title":"testing Documentation","category":"plugin-manifest","format":"markdown","content":"# `@inquirer/testing`\n\nThe `@inquirer/testing` package is Inquirer's answer to testing prompts [built with `@inquirer/core`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/testing --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/testing --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\nThis package provides two ways to test Inquirer prompts:\n\n1. **Unit testing** with `render()` - Test individual prompts in isolation\n2. **E2E testing** with `screen` - Test full CLI applications that use Inquirer\n\n## Unit Testing with `render()`\n\nThe `render()` function creates and instruments a command line interface for testing a single prompt.\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\ndescribe('input prompt', () => {\n  it('handle simple use case', async () => {\n    const { answer, events, getScreen } = await render(input, {\n      message: 'What is your name',\n    });\n\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name\"`);\n\n    events.type('J');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name J\"`);\n\n    events.type('ohn');\n    events.keypress('enter');\n\n    await expect(answer).resolves.toEqual('John');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name John\"`);\n  });\n});\n```\n\n### `render()` API\n\n`render` takes 2 arguments:\n\n1. The Inquirer prompt to test (the return value of `createPrompt()`)\n2. The prompt configuration (the first prompt argument)\n\n`render` returns a promise that resolves once the prompt is rendered. This promise returns:\n\n- `answer` (`Promise`) - Resolves when an answer is provided and valid\n- `getScreen` (`({ raw?: boolean }) => string`) - Returns the current screen content. By default strips ANSI codes\n- `nextRender` (`() => Promise<void>`) - Wait for the next screen update. Use after triggering async actions (e.g. pressing enter with validation). Coalesces rapid back-to-back renders so a single `await nextRender()` captures the final settled state\n- `events` - Utilities to interact with the prompt:\n  - `keypress(key: string | KeyObject)` - Trigger a keypress event\n  - `type(text: string)` - Type text into the prompt\n- `getFullOutput` (`() => Promise<string>`) - Returns the full output interpreted through a virtual terminal, resolving ANSI escape sequences into the actual screen state\n\n### Async actions and `nextRender()`\n\nWhen a keypress triggers an asynchronous action (such as input validation), the screen won't update synchronously. Use `nextRender()` to wait for the prompt to settle before reading the screen:\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\nit('shows a validation error', async () => {\n  const { answer, events, getScreen, nextRender } = await render(input, {\n    message: 'Enter a number',\n    validate: (value) => /^\\d+$/.test(value) || 'Must be a number',\n  });\n\n  events.type('abc');\n  events.keypress('enter');\n\n  await nextRender(); // wait for validation to complete and the error to render\n  expect(getScreen()).toContain('Must be a number');\n\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.type('42');\n  events.keypress('enter');\n\n  await expect(answer).resolves.toEqual('42');\n});\n```\n\n### Unit Testing Example\n\nYou can refer to the [`@inquirer/input` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/input.test.ts) for a comprehensive unit testing example using `render()`.\n\n## E2E Testing with `screen`\n\nFor testing full CLI applications that use Inquirer prompts internally, use the framework-specific entry points:\n\n### Vitest\n\n```ts\nimport { describe, it, expect } from 'vitest';\nimport { screen } from '@inquirer/testing/vitest';\n\n// Import your CLI AFTER @inquirer/testing/vitest\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### Jest\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### `screen` API\n\nThe `screen` object provides:\n\n- `next()` - Wait for the next screen update (prompt transitions, validation errors, async updates). The initial prompt render is available immediately via `getScreen()` — no `next()` needed\n- `getScreen({ raw?: boolean })` - Get the current prompt screen content. By default strips ANSI codes\n- `getFullOutput({ raw?: boolean })` - Get all accumulated output interpreted through a virtual terminal (returns a `Promise`). By default resolves ANSI escape sequences into actual screen state\n- `type(text)` - Type text (writes to stream AND emits keypresses)\n- `keypress(key)` - Send a keypress event\n- `clear()` - Reset screen state (called automatically before each test)\n\n### Mocking Third-Party Prompts\n\nAll `@inquirer/*` prompts are mocked automatically. To mock a third-party or custom prompt package, use `wrapPrompt` in your own mock call:\n\n#### Vitest\n\n```ts\nimport { screen, wrapPrompt } from '@inquirer/testing/vitest';\n\nvi.mock('@my-company/custom-prompt', async (importOriginal) => {\n  const actual = await importOriginal<typeof import('@my-company/custom-prompt')>();\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n#### Jest\n\nIn Jest, `jest.mock()` factories are hoisted before imports, so `wrapPrompt` must be accessed via `jest.requireActual()` inside the factory:\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\n\njest.mock('@my-company/custom-prompt', () => {\n  const { wrapPrompt } = jest.requireActual('@inquirer/testing/jest');\n  const actual = jest.requireActual('@my-company/custom-prompt');\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n### Important Notes\n\n1. **Import order matters**: Import `@inquirer/testing/vitest` or `@inquirer/testing/jest` BEFORE importing modules that use Inquirer prompts\n2. **Editor prompt**: The external editor is mocked — `screen.type()` buffers text, and `screen.keypress('enter')` submits it (same pattern as other prompts). Works with both `waitForUserInput: true` and `false`\n3. **Sequential prompts**: Multiple prompts are supported, but they must run sequentially (not concurrently)\n\n### E2E Testing Example\n\nYou can refer to the [`@inquirer/demo` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/demo.test.ts) for a comprehensive E2E testing example using `screen`.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":1861,"sizeBytes":7448},{"name":"README.md","path":"tools/isolate-monorepo-package/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/tools/isolate-monorepo-package/README.md","title":"isolate-monorepo-package Documentation","category":"plugin-manifest","format":"markdown","content":"# isolate-monorepo-package\n\nTool to isolate a package within a monorepo, locally replicating the release flow to ensure dependencies will work together post build.\n\nAiming to simulate how packages work once published to npm, it:\n\n1. Auto-discovers all workspace dependencies (direct and transitive)\n2. Packs workspace dependencies as tarballs\n3. Creates an isolated temp directory with modified package.json\n4. Outputs the temp directory path for testing\n\nWhile it uses `yarn` behind the scenes, it should work with any package manager that supports workspaces.\n\n## Installation\n\nThis tool is automatically available in the Inquirer workspace. No separate installation needed.\n\nLet me know if you'd like to see this published.\n\n## Usage\n\n```bash\n# Basic usage - outputs the path to isolated directory\nisolate-monorepo-package @inquirer/demo\n\n# One-liner approach - CD directly into the isolated directory\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nyarn set version stable # specific to yarn, this repo isn't setup, so it'll need to know which version to run.\nyarn install\nyarn test\ncd -\n\n# Or with npm\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nnpm install\nnpm test\ncd -\n```\n\n## Command Line Options\n\n- `<package-name>`: The workspace package to isolate (required)\n- `-v, --verbose`: Show detailed progress information\n\n## Output\n\nThe tool outputs only the path to the isolated directory to stdout. All other messages go to stderr, making it easy to capture the path in scripts:\n\n```bash\n# Capture path in variable\nTEST_DIR=$(isolate-monorepo-package @inquirer/demo)\n\n# Or CD directly\ncd $(isolate-monorepo-package @inquirer/demo)\n```\n\n## Troubleshooting\n\nIf the tool fails:\n\n1. Check that you're in a Yarn workspace (`.yarnrc.yml` must exist)\n2. Verify the package name exists in the workspace\n3. Use `-v` flag for detailed output\n4. Ensure `/tmp/artifacts/` is writable\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","isInternal":false,"tokens":506,"sizeBytes":2024},{"name":"README.md","path":"tools/package/README.md","rawUrl":"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/HEAD/tools/package/README.md","title":"package Documentation","category":"plugin-manifest","format":"markdown","content":"# @sboudrias/package\n\nPackage metadata tools for JavaScript packages and monorepos.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @sboudrias/package --dev\n```\n\n</td>\n<td>\n\n```sh\npnpm add @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nbun add @sboudrias/package --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```bash\npackage lint\n```\n\n`package lint` validates public workspace packages and fixes safe package metadata issues in place.\n\n```bash\npackage lint --check\n```\n\n`package lint --check` runs the same validation without writing files. It exits non-zero when any package needs a fix or has a manual conflict.\n\n# Lint Rules\n\n## Valid Peer Dependencies\n\nRuntime dependencies can declare their own peer dependencies. `package lint` makes those peer requirements visible on the package that uses the runtime dependency.\n\nIt adds missing peers to `peerDependencies` and copies matching `peerDependenciesMeta` entries so optional peers stay optional.\n\n## Matching engines\n\nPackages should only advertise Node.js support that their runtime dependencies can also support.\n\n`package lint` sets missing, invalid, or out-of-root-range `engines.node` values to the root package `engines.node` range. It fails when a runtime dependency supports a narrower Node.js range than the package.\n\nThat failure is intentional. Bumping a dependency can raise the minimum supported Node.js version and break dependants that still install the package under the previous `engines.node` range. In that case, manually narrow the package engine range or choose a compatible dependency version.\n\n## Ensure package.json is exposed\n\nPackages should expose their manifest for tools that inspect package metadata at runtime.\n\n`package lint` ensures public packages expose `\"./package.json\": \"./package.json\"` in `exports`.\n\n# Workspace Discovery\n\nThe CLI discovers workspaces from `package.json` `workspaces` fields and `pnpm-workspace.yaml` files.\n\nIf no workspaces are configured, the root `package.json` is linted as a single-package project.\n\nPrivate packages are ignored by default.\n","isInternal":false,"tokens":551,"sizeBytes":2202}],"systemPromptSnippet":"<agent_rules repository=\"SBoudrias/Inquirer.js\">\n\n<!-- Skill/Rule: AI Agent Protocol & Instructions (AGENTS.md) -->\n# Repository Guidelines\n\n## Project Structure & Module Organization\n\nThe repo is a Yarn workspaces monorepo. Core runtime logic shared primitives and shared primitives live in `packages/core/src`, and individual prompt implementations under `packages/<prompt>/src`. Testing utilities sit in `packages/testing`, while `packages/demo` provides the interactive showcase. Integration suites reside in `integration/cjs` and `integration/esm` to verify bundling. Tooling scripts and repo wiring (tsconfig, release helpers) live in `tools/`. Treat `packages/*/dist` and `tools/*/dist` as generated output.\n\n## Build, Test, and Development Commands\n\nInstall deps with `yarn install`. Use `yarn dev` for Turbo-powered incremental TypeScript builds. Launch the playground with `yarn demo`. Run `yarn tsc` for a project-wide compile. Execute `yarn pretest` for lint, format, and type gates, then `yarn test` for Vitest unit coverage followed by Node integration tests. After adding or moving workspaces, run `yarn setup` to refresh shared TS references.\n\n## Coding Style & Naming Conventions\n\nCode is ESM-first TypeScript targeting Node ≥ 18. Prettier enforces two-space indentation, trailing commas, and single quotes—lean on it rather than hand formatting. Prefer named exports, keep prompt IDs aligned with folder names, and store assets beside their entry points. Use `camelCase` for variables/functions and `PascalCase` for classes/components. Run `yarn oxlint --fix` and `yarn eslint --fix` before committing to maintain rule compliance.\n\n## TypeScript Best Practices\n\nPrioritize type safety and leverage existing types from the codebase. Use `Question<A>` from `packages/inquirer/src/types.ts` instead of generic `Record<string, unknown>` when working with question objects. Prefer `unknown` over `any` for truly unknown types, and use `Partial<T>` for optional properties. Leverage generic type parameters (like `<A extends Answers>`) throughout to maintain type consistency. Avoid eslint-disable comments by refactoring to proper types rather than suppressing warnings. When extending types, use intersection types (`Type & { prop: T }`) for explicit signatures rather than casting to `any`.\n\n## Testing Guidelines\n\nVitest owns unit coverage via `vitest.config.ts`, with `coverage.all = true` so untested files fail CI. Co-locate specs as `*.test.ts` next to source, and model cross-package flows under `integration/**/**/*.test.ts`. Iterate with `yarn vitest --run packages`, then finish with `yarn test` to exercise the full matrix. Update snapshots using `yarn vitest --update`.\n\nKeep tests simple and focused. Reuse existing test stubs and fixtures rather than creating custom mocks. If a behavior affects all prompts, test it with an existing prompt type rather than creating a specialized stub. Write tests that verify actual behavior rather than implementation details. Prefer straightforward assertions over complex validation logic.\n\n## Package-Specific Code Style\n\n### Type Declarations\n\nPrefer `type` over `interface` for all object shapes. Never prefix type names with `I` (no `IEditorParams`, `IFileOptions`). Use descriptive names without Hungarian notation: `EditorParams`, `FileOptions`.\n\n### Node.js Built-in Imports\n\nAlways use the `node:` protocol prefix for Node.js built-in modules: `import { spawn } from 'node:child_process'`, `import { readFileSync } from 'node:fs'`. This is enforced by linting.\n\n### Error Classes\n\nModel custom error classes after the style in `packages/core/src/lib/errors.ts`:\n\n- Declare `override name = 'ErrorName'` as a class field (not set in the constructor).\n- Pass `{ cause: originalError }` to `super()` to populate `this.cause` per the standard `Error` API.\n- Do not add a separate `originalError` instance field.\n- Do not include copyright header comments.\n\n### Async Patterns\n\nAll async operations must be Promise-based. Do not use Node-style callbacks `(err, result) => void`. Do not use `setImmediate` to defer callbacks; use `await` and `Promise` directly. Wrap event-emitter-based APIs (like `child_process.spawn`) in `new Promise(...)`.\n\n### Test File Location\n\nUnit tests must be co-located as `*.test.ts` files beside their source files inside `src/`. Separate `test/` directories are not used.\n\n## Commit & Pull Request Guidelines\n\nFollow Conventional Commit prefixes such as `feat:`, `fix:`, `docs:`, or `chore:`; keep scopes lowercase (`feat(@inquirer/package-name): add fuzzy search`). Summaries should stay imperative and under 80 characters. Pull requests must describe the change, list the commands run (for example `yarn test`), and link issues or discussions. Attach terminal recordings or screenshots for UX-facing changes, and ensure lockfiles and generated readme fragments stay current.\n\n\n<!-- Skill/Rule: Claude Agent Guidelines & System Prompt (CLAUDE.md) -->\nRead @AGENTS.md\n\n\n<!-- Skill/Rule: ansi Documentation (packages/ansi/README.md) -->\n# @inquirer/ansi\n\nA lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/ansi\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/ansi\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\n```js\nimport {\n  cursorUp,\n  cursorDown,\n  cursorTo,\n  cursorLeft,\n  cursorHide,\n  cursorShow,\n  eraseLines,\n} from '@inquirer/ansi';\n\n// Move cursor up 3 lines\nprocess.stdout.write(cursorUp(3));\n\n// Move cursor to specific position (x: 10, y: 5)\nprocess.stdout.write(cursorTo(10, 5));\n\n// Hide/show cursor\nprocess.stdout.write(cursorHide);\nprocess.stdout.write(cursorShow);\n\n// Clear 5 lines\nprocess.stdout.write(eraseLines(5));\n```\n\nOr when used inside an inquirer prompt:\n\n```js\nimport { cursorHide } from '@inquirer/ansi';\nimport { createPrompt } from '@inquirer/core';\n\nexport default createPrompt((config, done: (value: void) => void) => {\n  return `Choose an option${cursorHide}`;\n});\n```\n\n## API\n\n### Cursor Movement\n\n- **`cursorUp(count?: number)`** - Move cursor up by `count` lines (default: 1)\n- **`cursorDown(count?: number)`** - Move cursor down by `count` lines (default: 1)\n- **`cursorTo(x: number, y?: number)`** - Move cursor to position (x, y). If y is omitted, only moves horizontally\n- **`cursorLeft`** - Move cursor to beginning of line\n\n### Cursor Visibility\n\n- **`cursorHide`** - Hide the cursor\n- **`cursorShow`** - Show the cursor\n\n### Screen Manipulation\n\n- **`eraseLines(count: number)`** - Clear `count` lines and position cursor at the beginning of the first cleared line\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: checkbox Documentation (packages/checkbox/README.md) -->\n# `@inquirer/checkbox`\n\nSimple interactive command line prompt to display a list of checkboxes (multi select).\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/checkbox\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/checkbox\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { checkbox, Separator } from '@inquirer/prompts';\n// Or\n// import checkbox, { Separator } from '@inquirer/checkbox';\n\nconst answer = await checkbox({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    new Separator(),\n    { name: 'pnpm', value: 'pnpm', disabled: true },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property  | Type                                    | Required | Description                                                                                                                                                                                           |\n| --------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message   | `string`                                | yes      | The question to ask                                                                                                                                                                                   |\n| choices   | `Choice[]`                              | yes      | List of the available choices.                                                                                                                                                                        |\n| pageSize  | `number`                                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                           |\n| loop      | `boolean`                               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.                                                                     |\n| required  | `boolean`                               | no       | When set to `true`, ensures at least one choice must be selected.                                                                                                                                     |\n| validate  | `async (Choice[]) => boolean \\| string` | no       | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| shortcuts | [See Shortcuts](#Shortcuts)             | no       | Customize shortcut keys for `all` and `invert`.                                                                                                                                                       |\n| theme     | [See Theming](#Theming)                 | no       | Customize look of the prompt.                                                                                                                                                                         |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  checkedName?: string;\n  description?: string;\n  short?: string;\n  checked?: boolean;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await checkbox()`.\n- `name`: This is the string displayed in the choice list.\n- `checkedName`: Alternative `name` (or format) displayed when the choice is checked.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `checked`: If `true`, the option will be checked by default.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nAlso note the `choices` array can contain `Separator`s to help organize long lists.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Shortcuts\n\nYou can customize the shortcut keys for `all` and `invert` or disable them by setting them to `null`.\n\n```ts\ntype Shortcuts = {\n  all?: string | null; // default: 'a'\n  invert?: string | null; // default: 'i'\n};\n```\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n    disabledChoice: (text: string) => string;\n    description: (text: string) => string;\n    renderSelectedChoices: <T>(\n      selectedChoices: ReadonlyArray<Choice<T>>,\n      allChoices: ReadonlyArray<Choice<T> | Separator>,\n    ) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    checked: string;\n    unchecked: string;\n    cursor: string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: confirm Documentation (packages/confirm/README.md) -->\n# `@inquirer/confirm`\n\nSimple interactive command line prompt to gather boolean input from users.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/confirm\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/confirm\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { confirm } from '@inquirer/prompts';\n// Or\n// import confirm from '@inquirer/confirm';\n\nconst answer = await confirm({ message: 'Continue?' });\n```\n\n## Options\n\n| Property    | Type                    | Required | Description                                             |\n| ----------- | ----------------------- | -------- | ------------------------------------------------------- |\n| message     | `string`                | yes      | The question to ask                                     |\n| default     | `boolean`               | no       | Default answer (true or false)                          |\n| transformer | `(boolean) => string`   | no       | Transform the prompt printed message to a custom string |\n| theme       | [See Theming](#Theming) | no       | Customize look of the prompt.                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: core Documentation (packages/core/README.md) -->\n# `@inquirer/core`\n\nThe `@inquirer/core` package is the library enabling the creation of Inquirer prompts.\n\nIt aims to implements a lightweight API similar to React hooks - but without JSX.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/core\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/core\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n## Basic concept\n\nVisual terminal apps are at their core strings rendered onto the terminal.\n\nThe most basic prompt is a function returning a string that'll be rendered in the terminal. This function will run every time the prompt state change, and the new returned string will replace the previously rendered one. The prompt cursor appears after the string.\n\nWrapping the rendering function with `createPrompt()` will setup the rendering layer, inject the state management utilities, and wait until the `done` callback is called.\n\n```ts\nimport { createPrompt } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  // Implement logic\n\n  return '? My question';\n});\n\n// And it is then called as\nconst answer = await input({/* config */});\n```\n\n## Hooks\n\nState management and user interactions are handled through hooks. Hooks are common [within the React ecosystem](https://react.dev/reference/react/hooks), and Inquirer reimplement the common ones.\n\n### State hook\n\nState lets a component “remember” information like user input. For example, an input prompt can use state to store the input value, while a list prompt can use state to track the cursor index.\n\n`useState` declares a state variable that you can update directly.\n\nThe setter also accepts an updater function to compute the next state from the current one (mirroring React):\n\n```ts\nconst [index, setIndex] = useState(0);\n\nsetIndex((current) => current + 1);\n```\n\n```ts\nimport { createPrompt, useState } from '@inquirer/core';\n\nconst input = createPrompt((config, done) => {\n  const [index, setIndex] = useState(0);\n\n  // ...\n```\n\n### Keypress hook\n\nAlmost all prompts need to react to user actions. In a terminal, this is done through typing.\n\n`useKeypress` allows you to react to keypress events, and access the prompt line.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key) => {\n    if (key.name === 'enter') {\n      done(answer);\n    }\n  });\n\n  // ...\n```\n\nBehind the scenes, Inquirer prompts are wrappers around [readlines](https://nodejs.org/api/readline.html). Aside the keypress event object, the hook also pass the active readline instance to the event handler.\n\n```ts\nconst input = createPrompt((config, done) => {\n  useKeypress((key, readline) => {\n    setValue(readline.line);\n  });\n\n  // ...\n```\n\n### Ref hook\n\nRefs let a prompt hold some information that isn’t used for rendering, like a class instance or a timeout ID. Unlike with state, updating a ref does not re-render your prompt. Refs are an “escape hatch” from the rendering paradigm.\n\n`useRef` declares a ref. You can hold any value in it, but most often it’s used to hold a timeout ID.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const timeout = useRef(null);\n\n  // ...\n```\n\n### Effect Hook\n\nEffects let a prompt connect to and synchronize with external systems. This includes dealing with network or animations.\n\n`useEffect` connects a component to an external system.\n\n```ts\nconst chat = createPrompt((config, done) => {\n  useEffect(() => {\n    const connection = createConnection(roomId);\n    connection.connect();\n    return () => connection.disconnect();\n  }, [roomId]);\n\n  // ...\n```\n\n### Performance hook\n\nA common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell Inquirer to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render.\n\n`useMemo` lets you cache the result of an expensive calculation.\n\n```ts\nconst todoSelect = createPrompt((config, done) => {\n  const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]);\n\n  // ...\n```\n\n### Rendering hooks\n\n#### Prefix / loading\n\nAll default prompts, and most custom ones, uses a prefix at the beginning of the prompt line. This helps visually delineate different questions, and provides a convenient area to render a loading spinner.\n\n`usePrefix` is a built-in hook to do this.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const prefix = usePrefix({ status });\n\n  return `${prefix} My question`;\n});\n```\n\n#### Pagination\n\nWhen looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options.\n\nPagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`.\n\n```js\nexport default createPrompt((config, done) => {\n  const [active, setActive] = useState(0);\n\n  const allChoices = config.choices.map((choice) => choice.name);\n\n  const page = usePagination({\n    items: allChoices,\n    active: active,\n    renderItem: ({ item, index, isActive }) => `${isActive ? \">\" : \" \"}${index}. ${item.toString()}`\n    pageSize: config.pageSize,\n    loop: config.loop,\n  });\n\n  return `... ${page}`;\n});\n```\n\n## `createPrompt()` API\n\nAs we saw earlier, the rendering function should return a string, and eventually call `done` to close the prompt and return the answer.\n\n```ts\nconst input = createPrompt((config, done) => {\n  const [value, setValue] = useState();\n\n  useKeypress((key, readline) => {\n    if (key.name === 'enter') {\n      done(answer);\n    } else {\n      setValue(readline.line);\n    }\n  });\n\n  return `? ${config.message} ${value}`;\n});\n```\n\nThe rendering function can also return a tuple of 2 string (`[string, string]`.) The first string represents the prompt. The second one is content to render under the prompt, like an error message. The text input cursor will appear after the first string.\n\n```ts\nconst number = createPrompt((config, done) => {\n  // Add some logic here\n\n  return [`? My question ${input}`, `! The input must be a number`];\n});\n```\n\n### Typescript\n\nIf using typescript, `createPrompt` takes 2 generic arguments.\n\n```ts\n// createPrompt<Value, Config>\nconst input = createPrompt<string, { message: string }>(// ...\n```\n\nThe first one is the type of the resolved value\n\n```ts\nconst answer: string = await input();\n```\n\nThe second one is the type of the prompt config; in other words the interface the created prompt will provide to users.\n\n```ts\nconst answer = await input({\n  message: 'My question',\n});\n```\n\n## Key utilities\n\nListening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean:\n\n- `isEnterKey()`\n- `isBackspaceKey()`\n- `isSpaceKey()`\n- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`)\n- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`)\n- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally. Prompt-level `theme.keybindings` values override the environment variable.\n\n## Theming\n\nTheming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts.\n\nTo allow standard customization:\n\n```ts\nimport { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.style.highlight('hello')}`;\n});\n```\n\nTo setup a custom theme:\n\n```ts\nimport { createPrompt, makeTheme, type Theme } from '@inquirer/core';\nimport type { PartialDeep } from '@inquirer/type';\n\ntype PromptTheme = {};\n\nconst promptTheme: PromptTheme = {\n  icon: '!',\n};\n\ntype PromptConfig = {\n  theme?: PartialDeep<Theme<PromptTheme>>;\n};\n\nexport default createPrompt<string, PromptConfig>((config, done) => {\n  const theme = makeTheme(promptTheme, config.theme);\n\n  const prefix = usePrefix({ status, theme });\n\n  return `${prefix} ${theme.icon}`;\n});\n```\n\nThe [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts):\n\n```ts\ntype DefaultTheme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n  };\n};\n```\n\n# Examples\n\nYou can refer to any `@inquirer/prompts` prompts for real examples:\n\n- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts)\n- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts)\n- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts)\n- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts)\n- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts)\n- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts)\n- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts)\n- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts)\n\n```ts\nimport { styleText } from 'node:util';\nimport {\n  createPrompt,\n  useState,\n  useKeypress,\n  isEnterKey,\n  usePrefix,\n  type Status,\n} from '@inquirer/core';\n\nconst confirm = createPrompt<boolean, { message: string; default?: boolean }>(\n  (config, done) => {\n    const [status, setStatus] = useState<Status>('idle');\n    const [value, setValue] = useState('');\n    const prefix = usePrefix({});\n\n    useKeypress((key, rl) => {\n      if (isEnterKey(key)) {\n        const answer = value ? /^y(es)?/i.test(value) : config.default !== false;\n        setValue(answer ? 'yes' : 'no');\n        setStatus('done');\n        done(answer);\n      } else {\n        setValue(rl.line);\n      }\n    });\n\n    let formattedValue = value;\n    let defaultValue = '';\n    if (status === 'done') {\n      formattedValue = styleText('cyan', value);\n    } else {\n      defaultValue = styleText('dim', config.default === false ? ' (y/N)' : ' (Y/n)');\n    }\n\n    const message = styleText('bold', config.message);\n    return `${prefix} ${message}${defaultValue} ${formattedValue}`;\n  },\n);\n\n/**\n *  Which then can be used like this:\n */\nconst answer = await confirm({ message: 'Do you want to continue?' });\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: editor Documentation (packages/editor/README.md) -->\n# `@inquirer/editor`\n\nPrompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line.\n\nThe editor launched is the one [defined by the user's `EDITOR` environment variable](https://dev.to/jonasbn/til-integrate-visual-studio-code-with-shell--cli-2l1l).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/editor\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { editor } from '@inquirer/prompts';\n// Or\n// import editor from '@inquirer/editor';\n\nconst answer = await editor({\n  message: 'Enter a description',\n});\n```\n\n## Options\n\n| Property         | Type                                                                           | Required               | Description                                                                                                                                                                                                                            |\n| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message          | `string`                                                                       | yes                    | The question to ask                                                                                                                                                                                                                    |\n| default          | `string`                                                                       | no                     | Default value which will automatically be present in the editor                                                                                                                                                                        |\n| validate         | `string => boolean \\| string \\| Promise<boolean \\| string>`                    | no                     | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                  |\n| postfix          | `string`                                                                       | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.                                                                                                                     |\n| file             | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no                     | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file.                                                                                         |\n| waitForUserInput | `boolean`                                                                      | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |\n| theme            | [See Theming](#Theming)                                                        | no                     | Customize look of the prompt.                                                                                                                                                                                                          |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    key: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to the default value or empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: expand Documentation (packages/expand/README.md) -->\n# `@inquirer/expand`\n\nCompact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/expand\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/expand\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { expand } from '@inquirer/prompts';\n// Or\n// import expand from '@inquirer/expand';\n\nconst answer = await expand({\n  message: 'Conflict on file.js',\n  default: 'y',\n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite',\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all',\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff',\n    },\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                               |\n| -------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                       |\n| choices  | `Choice[]`              | yes      | Array of the different allowed choices. The `h`/help option is always provided by default |\n| default  | `string`                | no       | Default choices to be selected. (value must be one of the choices `key`)                  |\n| expanded | `boolean`               | no       | Expand the choices by default                                                             |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                             |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  key: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await expand()`.\n- `name`: The string displayed in the choice list. It'll default to the stringify `value`.\n- `key`: The input the use must provide to select the choice. Must be a lowercase single alphanumeric character string.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    highlight: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: external-editor Documentation (packages/external-editor/README.md) -->\n# `@inquirer/external-editor`\n\nA Node.js module to edit a string with the user's preferred text editor using $VISUAL or $EDITOR.\n\n> [!NOTE]\n> This package is a replacement for the unmaintained `external-editor`. It includes security fixes.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/external-editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/external-editor\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\nA simple example using the `edit` function\n\n```ts\nimport { edit } from '@inquirer/external-editor';\n\nconst data = edit('\\n\\n# Please write your text above');\nconsole.log(data);\n```\n\nExample relying on the class construct\n\n```ts\nimport {\n  ExternalEditor,\n  CreateFileError,\n  ReadFileError,\n  RemoveFileError,\n  LaunchEditorError,\n} from '@inquirer/external-editor';\n\ntry {\n  const editor = new ExternalEditor();\n  const text = editor.run(); // the text is also available in editor.text\n\n  if (editor.lastExitStatus !== 0) {\n    console.log('The editor exited with a non-zero code');\n  }\n\n  // Do things with the text\n  editor.cleanup();\n} catch (err) {\n  if (err instanceof CreateFileError) {\n    console.log('Failed to create the temporary file');\n  } else if (err instanceof ReadFileError) {\n    console.log('Failed to read the temporary file');\n  } else if (err instanceof LaunchEditorError) {\n    console.log('Failed to launch your editor');\n  } else if (err instanceof RemoveFileError) {\n    console.log('Failed to remove the temporary file');\n  } else {\n    throw err;\n  }\n}\n```\n\n### Windows editor commands\n\nOn Windows, prefer setting `$VISUAL` or `$EDITOR` to the editor executable\nrather than a `.cmd` or `.bat` shim. This package launches the editor directly\ninstead of through a shell so editor arguments and temporary file paths are not\ninterpreted as shell commands.\n\nFor example, use `Code.exe` with `--wait` instead of `code.cmd`:\n\n```powershell\nsetx VISUAL '\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" --wait'\n```\n\n#### API\n\n**Convenience Functions**\n\n- `edit(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - **Returns** (string) The contents of the file\n  - Could throw `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError`\n- `editAsync(text, callback, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `callback` (function (error?, text?))\n    - `error` could be of type `CreateFileError`, `ReadFileError`, `LaunchEditorError`, or `RemoveFileError`\n    - `text` (string) The contents of the file\n  - `config` (Config) _Optional_ Options for temporary file creation\n\n**Errors**\n\n- `CreateFileError` Error thrown if the temporary file could not be created.\n- `ReadFileError` Error thrown if the temporary file could not be read.\n- `RemoveFileError` Error thrown if the temporary file could not be removed during cleanup.\n- `LaunchEditorError` Error thrown if the editor could not be launched.\n\n**External Editor Public Methods**\n\n- `new ExternalEditor(text, config)`\n  - `text` (string) _Optional_ Defaults to empty string\n  - `config` (Config) _Optional_ Options for temporary file creation\n  - Could throw `CreateFileError`\n- `run()` Launches the editor.\n  - **Returns** (string) The contents of the file\n  - Could throw `LaunchEditorError` or `ReadFileError`\n- `runAsync(callback)` Launches the editor in an async way\n  - `callback` (function (error?, text?))\n    - `error` could be of type `ReadFileError` or `LaunchEditorError`\n    - `text` (string) The contents of the file\n- `cleanup()` Removes the temporary file.\n  - Could throw `RemoveFileError`\n\n**External Editor Public Properties**\n\n- `text` (string) _readonly_ The text in the temporary file.\n- `editor.bin` (string) The editor determined from the environment.\n- `editor.args` (array) Default arguments for the bin\n- `tempFile` (string) Path to temporary file. Can be changed, but be careful as the temporary file probably already\n  exists and would need be removed manually.\n- `lastExitStatus` (number) The last exit code emitted from the editor.\n\n**Config Options**\n\n- `prefix` (string) _Optional_ A prefix for the file name.\n- `postfix` (string) _Optional_ A postfix for the file name. Useful if you want to provide an extension.\n- `mode` (number) _Optional_ Which mode to create the file with. e.g. 644\n- `dir` (string) _Optional_ Which path to store the file.\n\n## Why Synchronous?\n\nEverything is synchronous to make sure the editor has complete control of the stdin and stdout. Testing has shown\nasync launching of the editor can lead to issues when using readline or other packages which try to read from stdin or\nwrite to stdout. Seeing as this will be used in an interactive CLI environment, I made the decision to force the package\nto be synchronous. If you know a reliable way to force all stdin and stdout to be limited only to the child_process,\nplease submit a PR.\n\nIf async is really needed, you can use `editAsync` or `runAsync`. If you are using readline or have anything else\nlistening to the stdin or you write to stdout, you will most likely have problem, so make sure to remove any other\nlisteners on stdin, stdout, or stderr.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s.png)](https://asciinema.org/a/a1qh9lypbe65mj0ivfuoslz2s)\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: input Documentation (packages/input/README.md) -->\n# `@inquirer/input`\n\nInteractive free text input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/input\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/input\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n// Or\n// import input from '@inquirer/input';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property     | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| ------------ | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| default      | `string`                                                    | no       | Default value if no answer is provided; see the prefill option below for governing it's behaviour.                                                                                                                      |\n| prefill      | `'tab' \\| 'editable'`                                       | no       | Defaults to `'tab'`. If set to `'tab'`, pressing `backspace` will clear the default and pressing `tab` will inline the value for edits; If set to `'editable'`, the default value will already be inlined to edit.      |\n| required     | `boolean`                                                   | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                 |\n| transformer  | `(string, { isFinal: boolean }) => string`                  | no       | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed.                                   |\n| validate     | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| pattern      | `RegExp`                                                    | no       | Regular expression to validate the input against. If the input doesn't match the pattern, validation will fail with the error message specified in `patternError`.                                                      |\n| patternError | `string`                                                    | no       | Error message to display when the input doesn't match the `pattern`. Defaults to `'Invalid input'`.                                                                                                                     |\n| theme        | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to an empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: inquirer Documentation (packages/inquirer/README.md) -->\n<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer.js\n\n[![npm](https://badge.fury.io/js/inquirer.svg)](https://www.npmjs.com/package/inquirer)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n> [!IMPORTANT]\n> This is the legacy version of Inquirer.js. While it still receives maintenance, it is not actively developed. For the new Inquirer, see [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts).\n\n## Table of Contents\n\n1.  [Documentation](#documentation)\n    1.  [Installation](#installation)\n    2.  [Examples](#examples)\n    3.  [Methods](#methods)\n    4.  [Objects](#objects)\n    5.  [Question](#question)\n    6.  [Answers](#answers)\n    7.  [Separator](#separator)\n    8.  [Prompt Types](#prompt-types)\n2.  [User Interfaces and Layouts](#user-interfaces-and-layouts)\n    1.  [Reactive Interface](#reactive-interface)\n3.  [Support](#support)\n4.  [Known issues](#issues)\n5.  [News](#news)\n6.  [Contributing](#contributing)\n7.  [License](#license)\n8.  [Plugins](#plugins)\n\n## Goal and Philosophy\n\n**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the \"CLI [Xanadu](https://en.wikipedia.org/wiki/Citizen_Kane)\").\n\n**`Inquirer.js`** should ease the process of\n\n- providing _error feedback_\n- _asking questions_\n- _parsing_ input\n- _validating_ answers\n- managing _hierarchical prompts_\n\n> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [commander](https://github.com/visionmedia/commander.js), [vorpal](https://github.com/dthree/vorpal) or [args](https://github.com/leo/args).\n\n## [Documentation](#documentation)\n\n<a name=\"documentation\"></a>\n\n### Installation\n\n<a name=\"installation\"></a>\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install inquirer\n```\n\n</td>\n<td>\n\n```sh\nyarn add inquirer\n```\n\n</td>\n</tr>\n</table>\n\n```javascript\nimport inquirer from 'inquirer';\n\ninquirer\n  .prompt([/* Pass your questions in here */])\n  .then((answers) => {\n    // Use user feedback for... whatever!!\n  })\n  .catch((error) => {\n    if (error.isTtyError) {\n      // Prompt couldn't be rendered in the current environment\n    } else {\n      // Something else went wrong\n    }\n  });\n```\n\n<a name=\"examples\"></a>\n\n### Examples (Run it and see it)\n\nCheck out the [`packages/inquirer/examples/`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer/examples) folder for code and interface examples.\n\n```shell\nyarn node packages/inquirer/examples/pizza.js\nyarn node packages/inquirer/examples/checkbox.js\n# etc...\n```\n\n### Methods\n\n<a name=\"methods\"></a>\n\n> [!WARNING]\n> Those interfaces are not necessary for modern Javascript, while still maintained, they're depreciated. We highly encourage you to adopt the more ergonomic and modern API with [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts). Both `inquirer` and `@inquirer/prompts` are usable at the same time, so you can progressively migrate.\n\n#### `inquirer.prompt(questions, answers) -> promise`\n\nLaunch the prompt interface (inquiry session)\n\n- **questions** a [Question Object](#question), an array or map of questions, or an RxJS-compatible Observable of questions\n- **answers** (object) contains values of already answered questions. Inquirer will avoid asking answers already provided here. Defaults `{}`.\n- returns a **Promise**\n\n#### `inquirer.registerPrompt(name, prompt)`\n\nRegister prompt plugins under `name`.\n\n- **name** (string) name of the this new prompt. (used for question `type`)\n- **prompt** (object) the prompt object itself (the plugin)\n\n#### `inquirer.createPromptModule() -> prompt function`\n\nCreate a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types.\n\n```js\nconst prompt = inquirer.createPromptModule();\n\nprompt(questions).then(/* ... */);\n```\n\n### Objects\n\n<a name=\"objects\"></a>\n\n#### Question\n\n<a name=\"questions\"></a>\nA question object is a `hash` containing question related values:\n\n- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `number`, `confirm`, `list`, `rawlist`, `expand`, `checkbox`, `password`, `editor`\n- **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash.\n- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon).\n- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.\n- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers.\n  Array values can be simple `numbers`, `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash), and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator).\n- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided.\n- **filter**: (Function) Receive the user input and answers hash. Returns the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash.\n- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash.\n- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean.\n- **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`.\n- **prefix**: (String) Change the default _prefix_ message.\n- **suffix**: (String) Change the default _suffix_ message.\n- **askAnswered**: (Boolean) Force to prompt the question if the answer already exists.\n- **loop**: (Boolean) Enable list looping. Defaults: `true`\n- **waitUserInput**: (Boolean) Flag to enable/disable wait for user input before opening system editor - Defaults: `true`\n\n`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value.\n\n```javascript\n{\n  /* Preferred way: with promise */\n  filter() {\n    return new Promise(/* etc... */);\n  },\n\n  /* Legacy way: with this.async */\n  validate: function (input) {\n    // Declare function as asynchronous, and save the done callback\n    const done = this.async();\n\n    // Do async stuff\n    setTimeout(function() {\n      if (typeof input !== 'number') {\n        // Pass the return value in the done callback\n        done('You need to provide a number');\n      } else {\n        // Pass the return value in the done callback\n        done(null, true);\n      }\n    }, 3000);\n  }\n}\n```\n\n### Answers\n\n<a name=\"answers\"></a>\nA key/value hash containing the client answers in each prompt.\n\n- **Key** The `name` property of the _question_ object\n- **Value** (Depends on the prompt)\n  - `confirm`: (Boolean)\n  - `input` : User input (filtered if `filter` is defined) (String)\n  - `number`: User input (filtered if `filter` is defined) (Number)\n  - `rawlist`, `list` : Selected choice value (or name if no value specified) (String)\n\n### Separator\n\n<a name=\"separator\"></a>\nA separator can be added to any `choices` array:\n\n```\n// In the question object\nchoices: [ \"Choice A\", new inquirer.Separator(), \"choice B\" ]\n\n// Which'll be displayed this way\n[?] What do you want to do?\n > Order a pizza\n   Make a reservation\n   --------\n   Ask opening hours\n   Talk to the receptionist\n```\n\nThe constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`.\n\nSeparator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists.\n\n<a name=\"prompt\"></a>\n\n### Prompt types\n\n---\n\n> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._\n\n#### List - `{type: 'list'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` or `value` of one of the entries in `choices`)\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n---\n\n#### Raw List - `{type: 'rawlist'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`, `filter`, `loop`] properties.\n(Note: `default` must be set to the `index` of one of the entries in `choices`)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n---\n\n#### Expand - `{type: 'expand'}`\n\nTake `type`, `name`, `message`, `choices`[, `default`] properties.\nNote: `default` must be the `index` of the desired default selection of the array. If `default` key not provided, then `help` will be used as default choice\n\nNote that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user.\n\nSee `examples/expand.js` for a running example.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n---\n\n#### Checkbox - `{type: 'checkbox'}`\n\nTake `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`, `loop`] properties. `default` is expected to be an Array of the checked choices value.\n\nChoices marked as `{checked: true}` will be checked by default.\n\nChoices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `\"Disabled\"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string.\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n---\n\n#### Confirm - `{type: 'confirm'}`\n\nTake `type`, `name`, `message`, [`default`, `transformer`] properties. `default` is expected to be a boolean if used.\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n---\n\n#### Input - `{type: 'input'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n---\n\n#### Input - `{type: 'number'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.\n\n---\n\n#### Password - `{type: 'password'}`\n\nTake `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n---\n\nNote that `mask` is required to hide the actual user input.\n\n#### Editor - `{type: 'editor'}`\n\nTake `type`, `name`, `message`[, `default`, `filter`, `validate`, `postfix`, `waitUserInput`] properties\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the contents of the temporary file are read in as the result. The editor to use is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used.\n\nThe `postfix` property is useful if you want to provide an extension.\n\n<a name=\"layouts\"></a>\n\n### Use in Non-Interactive Environments\n\n`prompt()` requires that it is run in an interactive environment. (I.e. [One where `process.stdin.isTTY` is `true`](https://nodejs.org/docs/latest-v12.x/api/process.html#process_a_note_on_process_i_o)). If `prompt()` is invoked outside of such an environment, then `prompt()` will return a rejected promise with an error. For convenience, the error will have a `isTtyError` property to programmatically indicate the cause.\n\n<a name=\"reactive\"></a>\n\n## Reactive interface\n\n`inquirer.prompt()` accepts an RxJS-compatible Observable of questions. This supports dynamic flows where questions are emitted over time:\n\n```js\nconst prompts = new Rx.Subject();\ninquirer.prompt(prompts);\n\n// At some point in the future, push new questions\nprompts.next({/* question... */});\nprompts.next({/* question... */});\n\n// When you're done\nprompts.complete();\n```\n\nAnd using the return value `process` property, you can access more fine grained callbacks:\n\n```js\ninquirer.prompt(prompts).ui.process.subscribe(onEachAnswer, onError, onComplete);\n```\n\n## Support (OS Terminals)\n\n<a name=\"support\"></a>\n\nYou should expect mostly good support for the CLI below. This does not mean we won't\nlook at issues found on other command line - feel free to report any!\n\n- **Mac OS**:\n  - Terminal.app\n  - iTerm\n- **Windows ([Known issues](#issues))**:\n  - [Windows Terminal](https://github.com/microsoft/terminal)\n  - [ConEmu](https://conemu.github.io/)\n  - cmd.exe\n  - Powershell\n  - Cygwin\n- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**:\n  - gnome-terminal (Terminal GNOME)\n  - konsole\n\n## Known issues\n\n<a name=\"issues\"></a>\n\n- **nodemon** - Makes the arrow keys print gibrish on list prompts.\n  Workaround: Add `{ stdin : false }` in the configuration file or pass `--no-stdin` in the CLI.\n  Please refer to [this issue](https://github.com/SBoudrias/Inquirer.js/issues/844#issuecomment-736675867)\n\n- **grunt-exec** - Calling a node script that uses Inquirer from grunt-exec can cause the program to crash. To fix this, add to your grunt-exec config `stdio: 'inherit'`.\n  Please refer to [this issue](https://github.com/jharding/grunt-exec/issues/85)\n\n- **Windows network streams** - Running Inquirer together with network streams in Windows platform inside some terminals can result in process hang.\n  Workaround: run inside another terminal.\n  Please refer to [this issue](https://github.com/nodejs/node/issues/21771)\n\n## News on the march (Release notes)\n\n<a name=\"news\"></a>\n\nPlease refer to the [GitHub releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases)\n\n## Contributing\n\n<a name=\"contributing\"></a>\n\n**Unit test**\nPlease add a unit test for every new feature or bug fix. `yarn test` to run the test suite.\n\n**Documentation**\nAdd documentation for every API change. Feel free to send typo fixes and better docs!\n\nWe're looking to offer good support for multiple prompts and environments. If you want to\nhelp, we'd like to keep a list of testers for each terminal/OS so we can contact you and\nget feedback before release. Let us know if you want to be added to the list (just tweet\nto [@vaxilart](https://twitter.com/Vaxilart)) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers)\n\n## License\n\n<a name=\"license\"></a>\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n## Plugins\n\n<a name=\"plugins\"></a>\n\nYou can build custom prompts, or use open sourced ones. See [`@inquirer/core` documentation for building custom prompts](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\nYou can either call the custom prompts directly (preferred), or you can register them (depreciated):\n\n```js\nimport customPrompt from '$$$/custom-prompt';\n\n// 1. Preferred solution with new plugins\nconst answer = await customPrompt({ ...config });\n\n// 2. Depreciated interface (or for old plugins)\ninquirer.registerPrompt('custom', customPrompt);\nconst answers = await inquirer.prompt([\n  {\n    type: 'custom',\n    ...config,\n  },\n]);\n```\n\nWhen using Typescript and `registerPrompt`, you'll also need to define your prompt signature. Since Typescript is static, we cannot infer available plugins from function calls.\n\n```ts\nimport customPrompt from '$$$/custom-prompt';\n\ndeclare module 'inquirer' {\n  interface QuestionMap {\n    // 1. Easiest option\n    custom: Parameters<typeof customPrompt>[0];\n\n    // 2. Or manually define the prompt config\n    custom_alt: { message: string; option: number[] };\n  }\n}\n```\n\n### Prompts\n\n[**autocomplete**](https://github.com/mokkabonna/inquirer-autocomplete-prompt)<br>\nPresents a list of options as the user types, compatible with other packages such as fuzzy (for search)<br>\n<br>\n![autocomplete prompt](https://raw.githubusercontent.com/mokkabonna/inquirer-autocomplete-prompt/master/packages/inquirer-autocomplete-prompt/inquirer.gif)\n\n[**checkbox-plus**](https://github.com/faressoft/inquirer-checkbox-plus-prompt)<br>\nCheckbox list with autocomplete and other additions<br>\n<br>\n![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif)\n\n[**inquirer-date-prompt**](https://github.com/haversnail/inquirer-date-prompt)<br>\nCustomizable date/time selector with localization support<br>\n<br>\n![Date Prompt](https://github.com/haversnail/inquirer-date-prompt/raw/master/examples/demo.gif)\n\n[**datetime**](https://github.com/DerekTBrown/inquirer-datepicker-prompt)<br>\nCustomizable date/time selector using both number pad and arrow keys<br>\n<br>\n![Datetime Prompt](https://github.com/DerekTBrown/inquirer-datepicker-prompt/raw/master/example/datetime-prompt.png)\n\n[**inquirer-select-line**](https://github.com/adam-golab/inquirer-select-line)<br>\nPrompt for selecting index in array where add new element<br>\n<br>\n![inquirer-select-line gif](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif)\n\n[**command**](https://github.com/sullof/inquirer-command-prompt)<br>\nSimple prompt with command history and dynamic autocomplete<br>\n\n[**inquirer-fuzzy-path**](https://github.com/adelsz/inquirer-fuzzy-path)<br>\nPrompt for fuzzy file/directory selection.<br>\n<br>\n![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif)\n\n[**inquirer-emoji**](https://github.com/tannerntannern/inquirer-emoji)<br>\nPrompt for inputting emojis.<br>\n<br>\n![inquirer-emoji](https://github.com/tannerntannern/inquirer-emoji/raw/master/demo.gif)\n\n[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)<br>\nPrompt for input chalk-pipe style strings<br>\n<br>\n![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/blob/main/screenshot.gif)\n\n[**inquirer-search-checkbox**](https://github.com/clinyong/inquirer-search-checkbox)<br>\nSearchable Inquirer checkbox<br>\n![inquirer-search-checkbox](https://github.com/clinyong/inquirer-search-checkbox/blob/master/screenshot.png)\n\n[**inquirer-search-list**](https://github.com/robin-rpr/inquirer-search-list)<br>\nSearchable Inquirer list<br>\n<br>\n![inquirer-search-list](https://github.com/robin-rpr/inquirer-search-list/blob/master/preview.gif)\n\n[**inquirer-prompt-suggest**](https://github.com/olistic/inquirer-prompt-suggest)<br>\nInquirer prompt for your less creative users.<br>\n<br>\n![inquirer-prompt-suggest](https://user-images.githubusercontent.com/5600126/40391192-d4f3d6d0-5ded-11e8-932f-4b75b642c09e.gif)\n\n[**inquirer-s3**](https://github.com/HQarroum/inquirer-s3)<br>\nAn S3 object selector for Inquirer.<br>\n<br>\n![inquirer-s3](https://github.com/HQarroum/inquirer-s3/raw/master/docs/inquirer-screenshot.png)\n\n[**inquirer-autosubmit-prompt**](https://github.com/yaodingyd/inquirer-autosubmit-prompt)<br>\nAuto submit based on your current input, saving one extra enter<br>\n\n[**inquirer-file-tree-selection-prompt**](https://github.com/anc95/inquirer-file-tree-selection)<br>\nInquirer prompt for to select a file or directory in file tree<br>\n<br>\n![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif)\n\n[**inquirer-tree-prompt**](https://github.com/insightfuls/inquirer-tree-prompt)<br>\nInquirer prompt to select from a tree<br>\n<br>\n![inquirer-tree-prompt](https://github.com/insightfuls/inquirer-tree-prompt/blob/main/example/screenshot.gif)\n\n[**inquirer-table-prompt**](https://github.com/eduardoboucas/inquirer-table-prompt)<br>\nA table-like prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/eduardoboucas/inquirer-table-prompt/master/screen-capture.gif)\n\n[**inquirer-table-input**](https://github.com/edelciomolina/inquirer-table-input)<br>\nA table editing prompt for Inquirer.<br>\n<br>\n![inquirer-table-prompt](https://raw.githubusercontent.com/edelciomolina/inquirer-table-input/master/screen-capture.gif)\n\n[**inquirer-interrupted-prompt**](https://github.com/lnquy065/inquirer-interrupted-prompt)<br>\nTurning any existing inquirer and its plugin prompts into prompts that can be interrupted with a custom key.<br>\n<br>\n![inquirer-interrupted-prompt](https://raw.githubusercontent.com/lnquy065/inquirer-interrupted-prompt/master/example/demo-menu.gif)\n\n[**inquirer-press-to-continue**](https://github.com/leonzalion/inquirer-press-to-continue)<br>\nA \"press any key to continue\" prompt for Inquirer.js<br>\n<br>\n![inquirer-press-to-continue](https://raw.githubusercontent.com/leonzalion/inquirer-press-to-continue/main/assets/demo.gif)\n\n\n<!-- Skill/Rule: number Documentation (packages/number/README.md) -->\n# `@inquirer/number`\n\nInteractive free number input component for command line interfaces. Supports validation, filtering, transformation, etc.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/number\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/number\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { number } from '@inquirer/prompts';\n// Or\n// import number from '@inquirer/number';\n\nconst answer = await number({ message: 'Enter your age' });\n```\n\n## Options\n\n| Property | Type                                                                       | Required | Description                                                                                                                                                                                                                                                     |\n| -------- | -------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                                   | yes      | The question to ask                                                                                                                                                                                                                                             |\n| default  | `number`                                                                   | no       | Default value if no answer is provided (clear it by pressing backspace)                                                                                                                                                                                         |\n| min      | `number`                                                                   | no       | The minimum value to accept for this input.                                                                                                                                                                                                                     |\n| max      | `number`                                                                   | no       | The maximum value to accept for this input.                                                                                                                                                                                                                     |\n| step     | `number \\| 'any'`                                                          | no       | The step option is a number that specifies the granularity that the value must adhere to. Only values which are equal to the basis for stepping (min if specified) are valid. This value defaults to 1, meaning by default the prompt will only allow integers. |\n| required | `boolean`                                                                  | no       | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this.                                                                                                                                                                         |\n| validate | `(number \\| undefined) => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                         |\n| theme    | [See Theming](#Theming)                                                    | no       | Customize look of the prompt.                                                                                                                                                                                                                                   |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: password Documentation (packages/password/README.md) -->\n# `@inquirer/password`\n\nInteractive password input component for command line interfaces. Supports input validation and masked or transparent modes.\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/password\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/password\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { password } from '@inquirer/prompts';\n// Or\n// import password from '@inquirer/password';\n\nconst answer = await password({ message: 'Enter your name' });\n```\n\n## Options\n\n| Property | Type                                                        | Required | Description                                                                                                                                                                                                             |\n| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                                                    | yes      | The question to ask                                                                                                                                                                                                     |\n| mask     | `boolean`                                                   | no       | Show a `*` mask over the input or keep it transparent                                                                                                                                                                   |\n| validate | `string => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme    | [See Theming](#Theming)                                     | no       | Customize look of the prompt.                                                                                                                                                                                           |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: prompts Documentation (packages/prompts/README.md) -->\n<img width=\"75px\" height=\"75px\" align=\"right\" alt=\"Inquirer Logo\" src=\"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true\" title=\"Inquirer.js\"/>\n\n# Inquirer\n\n[![npm](https://badge.fury.io/js/@inquirer%2Fprompts.svg)](https://www.npmjs.com/package/@inquirer/prompts)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield)\n\nA collection of common interactive command line user interfaces.\n\n![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\nGive it a try in your own terminal!\n\n```sh\nnpx @inquirer/demo@latest\n```\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\npnpm add @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nbun add @inquirer/prompts\n```\n\n</td>\n</tr>\n</table>\n\n> [!NOTE]\n> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/inquirer).\n\n# Usage\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst answer = await input({ message: 'Enter your name' });\n```\n\n# Prompts\n\n## [Input](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input)\n\n![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg)\n\n```js\nimport { input } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/input) for usage example and options documentation.\n\n## [Select](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select)\n\n![Select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n```js\nimport { select } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/select) for usage example and options documentation.\n\n## [Checkbox](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox)\n\n![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg)\n\n```js\nimport { checkbox } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox) for usage example and options documentation.\n\n## [Confirm](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm)\n\n![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg)\n\n```js\nimport { confirm } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/confirm) for usage example and options documentation.\n\n## [Search](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search)\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n```js\nimport { search } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/search) for usage example and options documentation.\n\n## [Password](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password)\n\n![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg)\n\n```js\nimport { password } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/password) for usage example and options documentation.\n\n## [Expand](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand)\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\n\n```js\nimport { expand } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/expand) for usage example and options documentation.\n\n## [Editor](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor)\n\nLaunches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)\n\n```js\nimport { editor } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/editor) for usage example and options documentation.\n\n## [Number](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number)\n\nVery similar to the `input` prompt, but with built-in number validation configuration option.\n\n```js\nimport { number } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/number) for usage example and options documentation.\n\n## [Raw List](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist)\n\n![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n```\n\n[See documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/rawlist) for usage example and options documentation.\n\n# Internationalization (i18n)\n\nNeed prompts in a language other than English? The [`@inquirer/i18n`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) package is a drop-in replacement for `@inquirer/prompts` with built-in localization.\n\nThe root import automatically detects your locale from the `LANGUAGE`, `LC_ALL`, `LC_MESSAGES`, and `LANG` environment variables (falling back to the `Intl` API). If no supported locale is found, English is used.\n\n```js\n// Drop-in replacement — locale is auto-detected from environment variables\nimport { input, select, confirm } from '@inquirer/i18n';\n```\n\nBuilt-in locales include English, French, Spanish, Chinese (Simplified), and Portuguese. You can also pin to a specific language via sub-path imports (e.g. `@inquirer/i18n/fr`), or use the `createLocalizedPrompts` and `registerLocale` APIs to add your own.\n\n[See the full documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/i18n) for available languages and how to create a custom locale.\n\n# Create your own prompts\n\nThe [API documentation is over here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core), and our [testing utilities here](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/testing).\n\n# Advanced usage\n\nAll inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration.\n\nThe context options are:\n\n| Property          | Type                    | Required | Description                                                  |\n| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ |\n| input             | `NodeJS.ReadableStream` | no       | The stdin stream (defaults to `process.stdin`)               |\n| output            | `NodeJS.WritableStream` | no       | The stdout stream (defaults to `process.stdout`)             |\n| clearPromptOnDone | `boolean`               | no       | If true, we'll clear the screen after the prompt is answered |\n| signal            | `AbortSignal`           | no       | An AbortSignal to cancel prompts asynchronously              |\n\n> [!WARNING]\n> When providing an input stream or piping `process.stdin`, it's very likely you need to call `process.stdin.setRawMode(true)`\n> before calling inquirer functions. Node.js usually does it automatically, but when we shadow the stdin, Node can loss track\n> and not know it has to. If the prompt isn't interactive (arrows don't work, etc), it's likely due to this.\n\nWhen running Inquirer from an existing `node:readline` interface, pause the readline instance before starting the prompt, then resume it after the prompt settles. This makes the handoff of `process.stdin` ownership explicit and prevents the parent readline loop from losing control of the input stream.\n\n```js\nconst answer = await rl.question('Command: ');\n\nif (answer === 'configure') {\n  rl.pause();\n\n  try {\n    const value = await input({ message: 'Configuration value' });\n  } finally {\n    rl.resume();\n  }\n}\n```\n\nExample:\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm(\n  { message: 'Do you allow us to send you email?' },\n  {\n    output: new Stream.Writable({\n      write(chunk, _encoding, next) {\n        // Do something\n        next();\n      },\n    }),\n    clearPromptOnDone: true,\n  },\n);\n```\n\n## Canceling prompt\n\nThis can be done with either an `AbortController` or `AbortSignal`.\n\n```js\n// Example 1: using built-in AbortSignal utilities\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });\n```\n\n```js\n// Example 2: implementing custom cancellation with an AbortController\nimport { confirm } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nsetTimeout(() => {\n  controller.abort(); // This will reject the promise\n}, 5000);\n\nconst answer = await confirm({ ... }, { signal: controller.signal });\n```\n\n# Recipes\n\n## Handling `ctrl+c` gracefully\n\nWhen a user press `ctrl+c` to exit a prompt, Inquirer rejects the prompt promise. This is the expected behavior in order to allow your program to teardown/cleanup its environment. When using `async/await`, rejected promises throw their error. When unhandled, those errors print their stack trace in your user's terminal.\n\n```\nExitPromptError: User force closed the prompt with 0 null\n  at file://example/packages/core/dist/esm/lib/create-prompt.js:55:20\n  at Emitter.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:67:19)\n  at #processEmit (file://example/node_modules/signal-exit/dist/mjs/index.js:236:27)\n  at #process.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:187:37)\n  at process.callbackTrampoline (node:internal/async_hooks:130:17)\n```\n\nThis isn't a great UX, which is why we highly recommend you to handle those errors gracefully.\n\nFirst option is to wrap your scripts in `try/catch`; like [we do in our demo program](https://github.com/SBoudrias/Inquirer.js/blob/649e78147cbb6390a162ff842d4b21d53a233472/packages/demo/src/index.ts#L89-L95). Or handle the error in your CLI framework mechanism; for example [`Clipanion catch` method](https://mael.dev/clipanion/docs/errors#custom-error-handling).\n\nLastly, you could handle the error globally with an event listener and silence it.\n\n```ts\nprocess.on('uncaughtException', (error) => {\n  if (error instanceof Error && error.name === 'ExitPromptError') {\n    console.log('👋 until next time!');\n  } else {\n    // Rethrow unknown errors\n    throw error;\n  }\n});\n```\n\n## Get answers in an object\n\nWhen asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst answers = {\n  firstName: await input({ message: \"What's your first name?\" }),\n  allowEmail: await confirm({ message: 'Do you allow us to send you email?' }),\n};\n\nconsole.log(answers.firstName);\n```\n\n## Ask a question conditionally\n\nMaybe some questions depend on some other question's answer.\n\n```js\nimport { input, confirm } from '@inquirer/prompts';\n\nconst allowEmail = await confirm({ message: 'Do you allow us to send you email?' });\n\nlet email;\nif (allowEmail) {\n  email = await input({ message: 'What is your email address' });\n}\n```\n\n## Get default value after timeout\n\n```js\nimport { input } from '@inquirer/prompts';\n\nconst controller = new AbortController();\nconst timeout = setTimeout(() => {\n  controller.abort();\n}, 5000);\nconst clearInputTimeout = () => clearTimeout(timeout);\n\nprocess.stdin.once('keypress', clearInputTimeout);\n\nconst answer = await input(\n  { message: 'Enter a value (timing out in 5 seconds)' },\n  { signal: controller.signal },\n)\n  .catch((error) => {\n    if (error.name === 'AbortPromptError') {\n      return 'Default value';\n    }\n\n    throw error;\n  })\n  .finally(() => {\n    clearInputTimeout();\n    process.stdin.off('keypress', clearInputTimeout);\n  });\n```\n\n## Using as pre-commit/git hooks, or scripts\n\nBy default scripts ran from tools like `husky`/`lint-staged` might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process.\n\nFor it to work, you must make sure you start a `tty` (or \"interactive\" input stream.)\n\nIf those scripts are set within your `package.json`, you can define the stream like so:\n\n```json\n  \"precommit\": \"my-script < /dev/tty\"\n```\n\nOr if in a shell script file, you'll do it like so: (on Windows that's likely your only option)\n\n```sh\n#!/bin/sh\nexec < /dev/tty\n\nnode my-script.js\n```\n\n## Using with nodemon\n\nWhen using inquirer prompts with nodemon, you need to pass the `--no-stdin` flag for everything to work as expected.\n\n```sh\nnpx nodemon ./packages/demo/demos/password.mjs --no-stdin\n```\n\nNote that for most of you, you'll be able to use the new watch-mode built-in Node. This mode works out of the box with inquirer.\n\n```sh\n# One of depending on your need\nnode --watch script.js\nnode --watch-path=packages/ packages/demo/\n```\n\n## Wait for config\n\nMaybe some question configuration require to await a value.\n\n```js\nimport { confirm } from '@inquirer/prompts';\n\nconst answer = await confirm({ message: await getMessage() });\n```\n\n## Usage with `npx` within bash scripts\n\nYou can use Inquirer prompts directly in the shell via [`npx`](https://docs.npmjs.com/cli/v8/commands/npx), which is useful for quick scripts or `package.json` commands.\n\nA community library, [@inquirer-cli](https://github.com/fishballapp/inquirer-cli), exposes each prompt as a standalone CLI.\n\nFor example, to prompt for input:\n\n```bash\nname=$(npx -y @inquirer-cli/input -r \"What is your name?\")\necho \"Hello, $name!\"\n```\n\nOr to create an interactive version bump:\n\n```bash\n$ npm version $(npx -y @inquirer-cli/select -c patch -c minor -c major 'Select Version')\n```\n\nFind out more: [@inquirer-cli](https://github.com/fishballapp/inquirer-cli).\n\n# Community prompts\n\nIf you created a cool prompt, [send us a PR adding it](https://github.com/SBoudrias/Inquirer.js/edit/main/packages/prompts/README.md) to the list below!\n\n[**Interactive List Prompt**](https://github.com/pgibler/inquirer-interactive-list-prompt)<br/>\nSelect a choice either with arrow keys + Enter or by pressing a key associated with a choice.\n\n```\n? Choose an option:\n>   Run command (D)\n    Quit (Q)\n```\n\n[**Action Select Prompt**](https://github.com/zenithlight/inquirer-action-select)<br/>\nChoose an item from a list and choose an action to take by pressing a key.\n\n```\n? Choose a file Open <O> Edit <E> Delete <X>\n❯ image.png\n  audio.mp3\n  code.py\n```\n\n[**Table Multiple Prompt**](https://github.com/Bartheleway/inquirer-table-multiple)<br/>\nSelect multiple answer from a table display.\n\n```sh\nChoose between choices? (Press <space> to select, <Up and Down> to move rows,\n<Left and Right> to move columns)\n\n┌──────────┬───────┬───────┐\n│ 1-2 of 2 │ Yes?  │ No?   |\n├──────────┼───────┼───────┤\n│ Choice 1 │ [ ◯ ] │   ◯   |\n├──────────┼───────┼───────┤\n│ Choice 2 │   ◯   │   ◯   |\n└──────────┴───────┴───────┘\n\n```\n\n[**Toggle Prompt**](https://github.com/skarahoda/inquirer-toggle)<br/>\nConfirm with a toggle. Select a choice with arrow keys + Enter.\n\n```\n? Do you want to continue? no / yes\n```\n\n[**Sortable Checkbox Prompt**](https://github.com/th0r/inquirer-sortable-checkbox)<br/>\nThe same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down.\n\n```\n? Which PRs and in what order would you like to merge? (Press <space> to select, <a> to toggle all, <i> to invert selection, <ctrl+up> to move item up, <ctrl+down> to move item down, and <enter> to proceed)\n❯ ◯ PR 1\n  ◯ PR 2\n  ◯ PR 3\n```\n\n[**Multi Select Prompt**](https://github.com/jeffwcx/inquirer-select-pro)\n\nAn inquirer select that supports multiple selections and filtering/searching.\n\n```\n? Choose your OS, IDE, PL, etc. (Press <tab> to select/deselect, <backspace> to remove selected\noption, <enter> to select option)\n>>  vue\n>[ ] vue\n [ ] vuejs\n [ ] fuelphp\n [ ] venv\n [ ] vercel\n (Use arrow keys to reveal more options)\n```\n\n[**File Selector Prompt**](https://github.com/br14n-sol/inquirer-file-selector)<br/>\nA file selector, you can navigate freely between directories, choose what type of files you want to allow and it is fully customizable.\n\n```sh\n? Select a file:\n/main/path/\n├── folder1/\n├── folder2/\n├── folder3/\n├── file1.txt\n├── file2.pdf\n└── file3.jpg (not allowed)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nUse ↑↓ to navigate through the list\nPress <esc> to navigate to the parent directory\nPress <enter> to select a file or navigate to a directory\n```\n\n[**Select Prompt with Stateful Banner**](https://github.com/patik/inquirer-select-with-state)<br/>\nThe same as built-in select prompt, but it also displays a banner above the prompt which can be updated with a `setState` function. For example, it can display the results of a long-running command without making the user wait to see the prompt.\n\nInitial display:\n\n```\nDirectory size: loading...\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\nA moment later:\n\n```\nDirectory size: 123M\n? Choose an option\n❯ Rename\n  Copy\n  Delete\n```\n\n[**Ordered Checkbox Prompt**](https://github.com/kyou-izumi/inquirer-ordered-checkbox)<br/>\nA sortable checkbox prompt that maintains the order of selection. Perfect for prioritizing tasks or ranking options.\n\n```\n? Configure your development workflow:\n  [1] Set up CI/CD pipeline\n❯ [3] Code quality tools\n  [ ] Documentation\n  [2] Performance monitoring\n ──────────────\n- Legacy system (disabled)\n(Linting, formatting, and analysis)\n```\n\n[**Checkbox Plus Plus Prompt**](https://github.com/behnamazimi/inquirer-checkbox-plus-plus)<br/>\nA modern multiselect checkbox prompt with search and filter capabilities, highlighting, autocomplete, and improved UX. Supports both ESM and CommonJS and is compatible with @inquirer/core v10+.\n\n```\n? Select colors [searching: \"re\"]\n❯ ◉ The red color\n  ◯ The green color\n  ◉ The purple color\n  ◯ The orange color\n\n↑↓ navigate • space de/select • type search • 2 selected  • ⏎ submit\n```\n\n[**Tree Prompt**](https://github.com/3z3qu13l/inquirer-tree-prompt)<br/>\nNavigate a tree of choices, expanding and collapsing branches with the arrow keys. Children can be loaded lazily, and single or multiple items can be selected.\n\n```\n? Where is my phone?\n  ▼ in the house\n    ▼ in the living room\n      ❯ on the sofa\n        on the TV cabinet\n    ▶ in the bedroom\n      in the bathroom\n  ▶ in the car\n----------------\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: rawlist Documentation (packages/rawlist/README.md) -->\n# `@inquirer/rawlist`\n\nSimple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.\n\n![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/rawlist\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/rawlist\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n// Or\n// import rawlist from '@inquirer/rawlist';\n\nconst answer = await rawlist({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    { name: 'pnpm', value: 'pnpm' },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                       |\n| -------- | ----------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                               |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                    |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |\n| default  | `Value`                 | no       | The value of the choice to preselect. If the value is not found, no choice is preselected.                                        |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                     |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  short?: string;\n  key?: string;\n  description?: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await rawlist()`.\n- `name`: This is the string displayed in the choice list.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `key`: The key of the choice. Displayed as `key) name`.\n- `description`: Option description which appears below the list when the choice is selected.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nYou can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: search Documentation (packages/search/README.md) -->\n# `@inquirer/search`\n\nInteractive search prompt component for command line interfaces.\n\n![search prompt](https://raw.githubusercontent.com/SBoudrias/Inquirer.js/f459199e679aec7676cecc0fc12ef8a4cd3dda0b/assets/screenshots/search.png)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/search\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/search\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { search, Separator } from '@inquirer/prompts';\n// Or\n// import search, { Separator } from '@inquirer/search';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    if (!input) {\n      return [];\n    }\n\n    const response = await fetch(\n      `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`,\n      { signal },\n    );\n    const data = await response.json();\n\n    return data.objects.map((pkg) => ({\n      name: pkg.package.name,\n      value: pkg.package.name,\n      description: pkg.package.description,\n    }));\n  },\n});\n```\n\n## Options\n\n| Property     | Type                                                       | Required | Description                                                                                                                                                                                          |\n| ------------ | ---------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message      | `string`                                                   | yes      | The question to ask                                                                                                                                                                                  |\n| source       | `(term: string \\| void) => Promise<Choice[]>`              | yes      | This function returns the choices relevant to the search term.                                                                                                                                       |\n| pageSize     | `number`                                                   | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.                                                          |\n| default      | `Value`                                                    | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.                                                                  |\n| initialValue | `string`                                                   | no       | The value used to pre-populate the search input. `source` will be called with this value as the initial search term.                                                                                 |\n| validate     | `Value => boolean \\| string \\| Promise<boolean \\| string>` | no       | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme        | [See Theming](#Theming)                                    | no       | Customize look of the prompt.                                                                                                                                                                        |\n\n### `source` function\n\nThe full signature type of `source` is as follow:\n\n```ts\nfunction(\n  term: string | void,\n  opt: { signal: AbortSignal },\n): Promise<ReadonlyArray<Choice<Value> | Separator>>;\n```\n\nWhen `term` is `undefined`, it means the search term input is empty. You can use this to return default choices, or return an empty array.\n\nAside from returning the choices:\n\n1. An `AbortSignal` is passed in to cancel ongoing network calls when the search term change.\n2. `Separator`s can be used to organize the list.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await search()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\nChoices can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n### Validation & autocomplete interaction\n\nThe validation within the search prompt acts as a signal for the autocomplete feature.\n\nWhen a list value is submitted and fail validation, the prompt will compare it to the search term. If they're the same, the prompt display the error. If they're not the same, we'll autocomplete the search term to match the value. Doing this will trigger a new search.\n\nYou can rely on this behavior to implement progressive autocomplete searches. Where you want the user to narrow the search in a progressive manner.\n\nPressing `tab` also triggers the term autocomplete.\n\nYou can see this behavior in action in [our search demo](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/src/demos/search.ts).\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    searchTerm: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n## Recipes\n\n### Debounce search\n\n```js\nimport { setTimeout } from 'node:timers/promises';\nimport { search } from '@inquirer/prompts';\n\nconst answer = await search({\n  message: 'Select an npm package',\n  source: async (input, { signal }) => {\n    await setTimeout(300);\n    if (signal.aborted) return [];\n\n    // Do the search\n    fetch(...)\n  },\n});\n```\n\n# License\n\nCopyright (c) 2024 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: select Documentation (packages/select/README.md) -->\n# `@inquirer/select`\n\nSimple interactive command line prompt to display a list of choices (single select.)\n\n![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/select\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/select\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { select, Separator } from '@inquirer/prompts';\n// Or\n// import select, { Separator } from '@inquirer/select';\n\nconst answer = await select({\n  message: 'Select a package manager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm',\n      description: 'npm is the most popular package manager',\n    },\n    {\n      name: 'yarn',\n      value: 'yarn',\n      description: 'yarn is an awesome package manager',\n    },\n    new Separator(),\n    {\n      name: 'jspm',\n      value: 'jspm',\n      disabled: true,\n    },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                                 |\n| -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                                         |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                              |\n| default  | `string`                | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.         |\n| pageSize | `number`                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.           |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                               |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await select()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nWhen Vim keybindings are enabled, the prompt disables type-to-search so navigation keys are not interpreted as search input. You can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n  indexMode: 'hidden' | 'number';\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n### `theme.indexMode`\n\nControls how indices are displayed before each choice:\n\n- `hidden` (default): No indices are shown\n- `number`: Display a number before each choice (e.g. \"1. Option A\")\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: testing Documentation (packages/testing/README.md) -->\n# `@inquirer/testing`\n\nThe `@inquirer/testing` package is Inquirer's answer to testing prompts [built with `@inquirer/core`](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/core).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/testing --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/testing --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\nThis package provides two ways to test Inquirer prompts:\n\n1. **Unit testing** with `render()` - Test individual prompts in isolation\n2. **E2E testing** with `screen` - Test full CLI applications that use Inquirer\n\n## Unit Testing with `render()`\n\nThe `render()` function creates and instruments a command line interface for testing a single prompt.\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\ndescribe('input prompt', () => {\n  it('handle simple use case', async () => {\n    const { answer, events, getScreen } = await render(input, {\n      message: 'What is your name',\n    });\n\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name\"`);\n\n    events.type('J');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name J\"`);\n\n    events.type('ohn');\n    events.keypress('enter');\n\n    await expect(answer).resolves.toEqual('John');\n    expect(getScreen()).toMatchInlineSnapshot(`\"? What is your name John\"`);\n  });\n});\n```\n\n### `render()` API\n\n`render` takes 2 arguments:\n\n1. The Inquirer prompt to test (the return value of `createPrompt()`)\n2. The prompt configuration (the first prompt argument)\n\n`render` returns a promise that resolves once the prompt is rendered. This promise returns:\n\n- `answer` (`Promise`) - Resolves when an answer is provided and valid\n- `getScreen` (`({ raw?: boolean }) => string`) - Returns the current screen content. By default strips ANSI codes\n- `nextRender` (`() => Promise<void>`) - Wait for the next screen update. Use after triggering async actions (e.g. pressing enter with validation). Coalesces rapid back-to-back renders so a single `await nextRender()` captures the final settled state\n- `events` - Utilities to interact with the prompt:\n  - `keypress(key: string | KeyObject)` - Trigger a keypress event\n  - `type(text: string)` - Type text into the prompt\n- `getFullOutput` (`() => Promise<string>`) - Returns the full output interpreted through a virtual terminal, resolving ANSI escape sequences into the actual screen state\n\n### Async actions and `nextRender()`\n\nWhen a keypress triggers an asynchronous action (such as input validation), the screen won't update synchronously. Use `nextRender()` to wait for the prompt to settle before reading the screen:\n\n```ts\nimport { render } from '@inquirer/testing';\nimport input from '@inquirer/input';\n\nit('shows a validation error', async () => {\n  const { answer, events, getScreen, nextRender } = await render(input, {\n    message: 'Enter a number',\n    validate: (value) => /^\\d+$/.test(value) || 'Must be a number',\n  });\n\n  events.type('abc');\n  events.keypress('enter');\n\n  await nextRender(); // wait for validation to complete and the error to render\n  expect(getScreen()).toContain('Must be a number');\n\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.keypress('backspace');\n  events.type('42');\n  events.keypress('enter');\n\n  await expect(answer).resolves.toEqual('42');\n});\n```\n\n### Unit Testing Example\n\nYou can refer to the [`@inquirer/input` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/input.test.ts) for a comprehensive unit testing example using `render()`.\n\n## E2E Testing with `screen`\n\nFor testing full CLI applications that use Inquirer prompts internally, use the framework-specific entry points:\n\n### Vitest\n\n```ts\nimport { describe, it, expect } from 'vitest';\nimport { screen } from '@inquirer/testing/vitest';\n\n// Import your CLI AFTER @inquirer/testing/vitest\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### Jest\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\nimport { runMyCli } from './my-cli.js';\n\ndescribe('my CLI', () => {\n  it('asks for name and confirms', async () => {\n    const result = runMyCli();\n\n    // First prompt is immediately available\n    expect(screen.getScreen()).toContain('What is your name?');\n    screen.type('John');\n    screen.keypress('enter');\n\n    // Wait for next prompt\n    await screen.next();\n    expect(screen.getScreen()).toContain('Confirm?');\n    screen.keypress('enter');\n\n    await result;\n  });\n});\n```\n\n### `screen` API\n\nThe `screen` object provides:\n\n- `next()` - Wait for the next screen update (prompt transitions, validation errors, async updates). The initial prompt render is available immediately via `getScreen()` — no `next()` needed\n- `getScreen({ raw?: boolean })` - Get the current prompt screen content. By default strips ANSI codes\n- `getFullOutput({ raw?: boolean })` - Get all accumulated output interpreted through a virtual terminal (returns a `Promise`). By default resolves ANSI escape sequences into actual screen state\n- `type(text)` - Type text (writes to stream AND emits keypresses)\n- `keypress(key)` - Send a keypress event\n- `clear()` - Reset screen state (called automatically before each test)\n\n### Mocking Third-Party Prompts\n\nAll `@inquirer/*` prompts are mocked automatically. To mock a third-party or custom prompt package, use `wrapPrompt` in your own mock call:\n\n#### Vitest\n\n```ts\nimport { screen, wrapPrompt } from '@inquirer/testing/vitest';\n\nvi.mock('@my-company/custom-prompt', async (importOriginal) => {\n  const actual = await importOriginal<typeof import('@my-company/custom-prompt')>();\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n#### Jest\n\nIn Jest, `jest.mock()` factories are hoisted before imports, so `wrapPrompt` must be accessed via `jest.requireActual()` inside the factory:\n\n```ts\nimport { screen } from '@inquirer/testing/jest';\n\njest.mock('@my-company/custom-prompt', () => {\n  const { wrapPrompt } = jest.requireActual('@inquirer/testing/jest');\n  const actual = jest.requireActual('@my-company/custom-prompt');\n  return { ...actual, default: wrapPrompt(actual.default) };\n});\n```\n\n### Important Notes\n\n1. **Import order matters**: Import `@inquirer/testing/vitest` or `@inquirer/testing/jest` BEFORE importing modules that use Inquirer prompts\n2. **Editor prompt**: The external editor is mocked — `screen.type()` buffers text, and `screen.keypress('enter')` submits it (same pattern as other prompts). Works with both `waitForUserInput: true` and `false`\n3. **Sequential prompts**: Multiple prompts are supported, but they must run sequentially (not concurrently)\n\n### E2E Testing Example\n\nYou can refer to the [`@inquirer/demo` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/demo.test.ts) for a comprehensive E2E testing example using `screen`.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: isolate-monorepo-package Documentation (tools/isolate-monorepo-package/README.md) -->\n# isolate-monorepo-package\n\nTool to isolate a package within a monorepo, locally replicating the release flow to ensure dependencies will work together post build.\n\nAiming to simulate how packages work once published to npm, it:\n\n1. Auto-discovers all workspace dependencies (direct and transitive)\n2. Packs workspace dependencies as tarballs\n3. Creates an isolated temp directory with modified package.json\n4. Outputs the temp directory path for testing\n\nWhile it uses `yarn` behind the scenes, it should work with any package manager that supports workspaces.\n\n## Installation\n\nThis tool is automatically available in the Inquirer workspace. No separate installation needed.\n\nLet me know if you'd like to see this published.\n\n## Usage\n\n```bash\n# Basic usage - outputs the path to isolated directory\nisolate-monorepo-package @inquirer/demo\n\n# One-liner approach - CD directly into the isolated directory\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nyarn set version stable # specific to yarn, this repo isn't setup, so it'll need to know which version to run.\nyarn install\nyarn test\ncd -\n\n# Or with npm\ncd $(yarn isolate-monorepo-package @inquirer/demo)\nnpm install\nnpm test\ncd -\n```\n\n## Command Line Options\n\n- `<package-name>`: The workspace package to isolate (required)\n- `-v, --verbose`: Show detailed progress information\n\n## Output\n\nThe tool outputs only the path to the isolated directory to stdout. All other messages go to stderr, making it easy to capture the path in scripts:\n\n```bash\n# Capture path in variable\nTEST_DIR=$(isolate-monorepo-package @inquirer/demo)\n\n# Or CD directly\ncd $(isolate-monorepo-package @inquirer/demo)\n```\n\n## Troubleshooting\n\nIf the tool fails:\n\n1. Check that you're in a Yarn workspace (`.yarnrc.yml` must exist)\n2. Verify the package name exists in the workspace\n3. Use `-v` flag for detailed output\n4. Ensure `/tmp/artifacts/` is writable\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n\n\n<!-- Skill/Rule: package Documentation (tools/package/README.md) -->\n# @sboudrias/package\n\nPackage metadata tools for JavaScript packages and monorepos.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n  <th>pnpm</th>\n  <th>bun</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nyarn add @sboudrias/package --dev\n```\n\n</td>\n<td>\n\n```sh\npnpm add @sboudrias/package --save-dev\n```\n\n</td>\n<td>\n\n```sh\nbun add @sboudrias/package --dev\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```bash\npackage lint\n```\n\n`package lint` validates public workspace packages and fixes safe package metadata issues in place.\n\n```bash\npackage lint --check\n```\n\n`package lint --check` runs the same validation without writing files. It exits non-zero when any package needs a fix or has a manual conflict.\n\n# Lint Rules\n\n## Valid Peer Dependencies\n\nRuntime dependencies can declare their own peer dependencies. `package lint` makes those peer requirements visible on the package that uses the runtime dependency.\n\nIt adds missing peers to `peerDependencies` and copies matching `peerDependenciesMeta` entries so optional peers stay optional.\n\n## Matching engines\n\nPackages should only advertise Node.js support that their runtime dependencies can also support.\n\n`package lint` sets missing, invalid, or out-of-root-range `engines.node` values to the root package `engines.node` range. It fails when a runtime dependency supports a narrower Node.js range than the package.\n\nThat failure is intentional. Bumping a dependency can raise the minimum supported Node.js version and break dependants that still install the package under the previous `engines.node` range. In that case, manually narrow the package engine range or choose a compatible dependency version.\n\n## Ensure package.json is exposed\n\nPackages should expose their manifest for tools that inspect package metadata at runtime.\n\n`package lint` ensures public packages expose `\"./package.json\": \"./package.json\"` in `exports`.\n\n# Workspace Discovery\n\nThe CLI discovers workspaces from `package.json` `workspaces` fields and `pnpm-workspace.yaml` files.\n\nIf no workspaces are configured, the root `package.json` is linted as a single-package project.\n\nPrivate packages are ignored by default.\n\n\n</agent_rules>"}