Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 3.28 KB

README.md

File metadata and controls

102 lines (70 loc) · 3.28 KB

@reliverse/prompts

💖 GitHub Sponsors💬 Discord📦 NPM📚 Docs✨ GitHub

@reliverse/prompts is your modern, type-safe toolkit for building delightful CLI experiences. It's fast, flexible, and built with developer joy in mind. Forget the clutter — this is how CLI should feel.

⚡ Why It Rocks

  • TypeScript-first — fully typed prompts and helpers, with great DX
  • 🔧 Flexible Prompt Types — input, password, select, multiselect, confirm, toggle, number, spinner, and more
  • 🧠 Smart validation — works with Zod, TypeBox, or your own validators
  • 🌈 Accessible & Adaptive — meets WCAG AA, handles terminal resizing & color contrast
  • 🧯 Crash-resistant — gracefully exits on Ctrl+C or unexpected input
  • 🎨 Custom theming — make it match your CLI style
  • 🚀 Zero boilerplate — focus on the logic, not the wiring

🛠️ Install

bun add @reliverse/prompts
# or npm, pnpm, yarn

Make sure you have Bun, Node.js, and Git installed.

🧪 Try It Out (Playground Mode)

Wanna test drive before integrating? Clone the repo and run:

git clone https://github.com/reliverse/prompts.git
cd prompts
bun i
bun dev

Then open examples/launcher.ts and explore different prompts.

example

🧩 Example Usage

import {
  startPrompt, // Initialize prompt session (optional)
  inputPrompt, // Ask for user input
} from "@reliverse/prompts";

await startPrompt({
  clearConsole: true,
  titleColor: "inverse",
  packageName: "@reliverse/cli",
  packageVersion: "1.0.0",
});

const username = await inputPrompt({
  id: "username",
  title: "Welcome!",
  content: "What's your name?",
});

console.log(`Hey there, ${username}!`);

🔎 You can also use selectPrompt, multiselectPrompt, confirmPrompt, numberPrompt, spinnerPrompt, and more.

🧠 Bonus Goodies

  • ⚙️ Built-in argument parsing — parse CLI args without a separate lib
  • 🧪 Unit-test friendly — prompts can be mocked/stubbed
  • 📚 Minimal API surface — easy to learn, hard to outgrow
  • 💅 Custom styles — tweak colors, formats, and transitions

🔍 Why not Inquirer or Clack?

While we love other tools, @reliverse/prompts was built for:

  • Dev-first ergonomics
  • Fully typed workflows
  • Configurable theming
  • Better crash handling & UX polish

See feature comparison →

💡 Contributing

Wanna improve prompts or add something cool? PRs welcome!
This project favors functional programming over OOP — no classes, just clean, composable logic.

Open a PR or discussion on GitHub.

🙏 Shoutout

This wouldn't exist without these gems:

📄 License

💖 MIT © 2025 blefnk Nazar Kornienko