API Reference

@clack/prompts

Beautifully minimal CLI prompt library with text, confirm, select, multiselect, and group prompts for interactive CLIs.

Official Documentation ↗
CompatibilityThis documentation covers version v0.9. Check the official docs for the latest API surface.

Installation

npmnpm install @clack/prompts

Methods

@clack/prompts is beautifully minimal cli prompt library with text, confirm, select, multiselect, and group prompts for interactive clis. This page documents the core methods, installation, and common usage patterns for the current stable release.

Installation

Install @clack/prompts with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.

Core methods

The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v0.9 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.

Frequently asked questions

The faq section in the frontmatter answers the most common questions about @clack/prompts, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.

FAQ

Does it support cancellation?
Yes. If the user presses Ctrl+C, the prompt rejects with an isCancel symbol; check with isCancel(result).
Can I group prompts?
Yes. Use group({ name: () => text(...), lang: () => select(...) }) to run them in sequence.
Is it framework-agnostic?
It is Node.js only; it writes to stdout with ANSI escape codes.