docs | npmjs.com | github.com
- A single library to build the entire command line interface application.
- A modern, crash-resistant library for creating seamless, typesafe prompts in CLI applications.
- Designed for simplicity and elegance, it enables intuitive and robust user interactions.
Install via your preferred package manager:
bun add @reliverse/prompts # instead of bun you can use: npm, pnpm, or yarn (deno support is coming soon)
- Type Safety: Built with TypeScript, ensuring robust types and preventing runtime errors.
- Schema Validation: Define and validate inputs using schemas for reliable data handling.
- Flexibility: Supports various prompt types including text, password, number, select, and multiselect.
- Crash Resilience: Structured to handle cancellations and errors gracefully, keeping your application stable.
- Text: Simple text input.
- Password: Secure, hidden input for passwords.
- Number: Numeric input with validation.
- Confirm: Yes/No prompt.
- Select: Dropdown selection from multiple choices.
- Multiselect: Multiple choice selection from a list.
Each prompt can include custom validation logic to provide immediate feedback to the user.
Install the @reliverse/prompts library locally and run the following examples to see the library in action. Alternatively, you can just visit the following links to see the code:
bun dev:id
- examples/reliverse/install-deps.ts - An advanced example of a CLI that installs dependencies. Trying to create a drop-in replacement for @clack/prompts, unjs/consola, @inquirer/prompts, terkelg/prompts, withastro/astro, etc.bun dev:us
- examples/reliverse/user-signup.ts - An advanced example of a CLI application that simulates a user signup process.bun dev:wm
- examples/reliverse/win-mln-js.ts - A fun example of a quiz game. Inspired by this video created by Fireship.bun dev:sc
- examples/reliverse/simple-check.ts - Just a very basic example to check the library.
clone https://github.com/reliverse/prompts.git
cd prompts
bun i