# @lexjs/prompts

> Interactive prompts

Latest version **1.2.1** (published 2026-08-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @lexjs/prompts
pnpm add @lexjs/prompts
yarn add @lexjs/prompts
bun add @lexjs/prompts
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2026-08-11 |
| First published | 2024-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 91.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Lex Borisoff |
| Maintainers | lexborisoff |
| Keywords | ui, prompts, cli, prompt, interface, command-line, input, command, stdin, menu, ask, interact |

## Links

- npm: https://www.npmjs.com/package/@lexjs/prompts
- Repository: https://github.com/LexBorisoff/prompts
- Issues: https://github.com/LexBorisoff/prompts/issues
- npm.io page: https://npm.io/package/@lexjs/prompts

## Dependencies (2)

- [kleur](https://npm.io/package/kleur.md) ^4.1.5
- [sisteransi](https://npm.io/package/sisteransi.md) ^1.0.5

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2026-08-11
- 1.2.0 — 2026-08-09
- 1.1.6 — 2026-07-25
- 1.1.5 — 2025-08-04
- 1.1.4 — 2025-01-29
- 1.1.3 — 2025-01-24
- 1.1.2 — 2025-01-23
- 1.1.1 — 2025-01-21
- 1.1.0 — 2025-01-14
- 1.0.0 — 2024-12-22

## README

# `@lexjs/prompts`

![Build](https://img.shields.io/github/actions/workflow/status/LexBorisoff/prompts/release.yml)
![NPM Version](https://img.shields.io/npm/v/@lexjs/prompts)

Interactive prompts

- [Installation](#installation)
- [Methods](#methods)
  - [`autocomplete`](#autocomplete)
  - [`autocompleteMultiselect`](#autocompletemultiselect)
  - [`confirm`](#confirm)
  - [`date`](#date)
  - [`invisible`](#invisible)
  - [`list`](#list)
  - [`multiselect`](#multiselect)
  - [`number`](#number)
  - [`password`](#password)
  - [`select`](#select)
  - [`text`](#text)
  - [`toggle`](#toggle)

## Installation

```bash
npm install @lexjs/prompts
```

```bash
pnpm add @lexjs/prompts
```

```bash
yarn add @lexjs/prompts
```

## Methods

### `autocomplete`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.autocomplete({
  message: 'Choose a city',
  name: 'city',
  choices: [
    { title: 'New York City' },
    { title: 'Toronto' },
    { title: 'London' },
    { title: 'Paris' },
  ],
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/autocomplete.gif?raw=true" alt="autocomplete prompt" width="500" />

### `autocompleteMultiselect`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.autocompleteMultiselect({
  message: 'Pick colors',
  name: 'colors',
  choices: [
    { title: 'Red', value: '#ff0000' },
    { title: 'Green', value: '#008000' },
    { title: 'Blue', value: '#0000ff' },
    { title: 'White', value: '#ffffff' },
    { title: 'Black', value: '#000000' },
  ],
  instructions: false,
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/autocomplete-multiselect.gif?raw=true" alt="autocompleteMultiselect prompt" width="500" />

### `confirm`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.confirm({
  message: 'Confirm?',
  name: 'value',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/confirm.gif?raw=true" alt="confirm prompt" width="500" />

### `date`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.date({
  message: 'Enter a date',
  name: 'date',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/date.gif?raw=true" alt="date prompt" width="500" />

### `invisible`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.invisible({
  message: 'Enter password',
  name: 'password',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/invisible.gif?raw=true" alt="invisible prompt" width="500" />

### `list`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.list({
  message: 'Enter values',
  name: 'values',
  separator: ' ',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/list.gif?raw=true" alt="list prompt" width="500" />

### `multiselect`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.multiselect({
  message: 'Pick colors',
  name: 'colors',
  choices: [
    { title: 'Red', value: '#ff0000' },
    { title: 'Green', value: '#008000' },
    { title: 'Blue', value: '#0000ff' },
    { title: 'White', value: '#ffffff' },
    { title: 'Black', value: '#000000' },
  ],
  instructions: false,
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/multiselect.gif?raw=true" alt="multiselect prompt" width="500" />

### `number`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.number({
  message: 'Enter a number between 10 and 100',
  name: 'number',
  min: 10,
  max: 100,
  initial: 0,
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/number.gif?raw=true" alt="number prompt" width="500" />

### `password`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.password({
  message: 'Enter password',
  name: 'password',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/password.gif?raw=true" alt="password prompt" width="500" />

### `select`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.select({
  message: 'Pick a color',
  name: 'color',
  choices: [
    { title: 'Red', value: '#ff0000' },
    { title: 'Green', value: '#008000' },
    { title: 'Blue', value: '#0000ff' },
    { title: 'White', value: '#ffffff' },
    { title: 'Black', value: '#000000' },
  ],
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/select.gif?raw=true" alt="select prompt" width="500" />

### `text`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.text({
  message: 'What is your name?',
  name: 'value',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/text.gif?raw=true" alt="text prompt" width="500" />

### `toggle`

```typescript
import $_ from '@lexjs/prompts';

const result = await $_.toggle({
  message: 'Confirm?',
  name: 'value',
});
```

<img src="https://github.com/LexBorisoff/prompts/blob/main/demo/toggle.gif?raw=true" alt="toggle prompt" width="500" />

## Credits

This library is a wrapper around the [prompts](https://www.npmjs.com/package/prompts) package.

---
_Source: https://npm.io/package/@lexjs/prompts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
