@clack/prompts

Opinionated, ready-to-use interactive prompt components for building beautiful command-line apps in Node.js.

Library
npm
v1.8.1
8,115 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
80 /100 Excellent
Development Activity 84
Maintenance 88
Community 56
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
89 /100 Excellent
Architecture 88
Code Quality 90
Innovation 92
Learning Curve 90

@clack/prompts is a small, opinionated library of pre-styled interactive prompt components for Node.js command-line applications. It wraps the headless @clack/core primitives with a beautiful, minimal terminal UI and a simple, consistent API, giving you text, password, confirm, date, select, multiselect, autocomplete, path, spinner, and progress components out of the box.

At roughly 80% smaller than comparable prompt libraries, it is designed to be dropped into CLI tools, scaffolding generators, and setup wizards with minimal boilerplate. Every prompt follows the same option-object pattern, ships with first-class TypeScript types, and integrates cancellation handling, grouping, task runners, and streaming log output.

What You Get

  • A complete set of prompt components: text, password, confirm, date, select, selectKey, multiselect, groupMultiselect, autocomplete, path, spinner, and progress.
  • Utility helpers for intro/outro framing, cancellation guards (isCancel/cancel), prompt grouping, task runners, and streaming log output.
  • First-class TypeScript types with a consistent option-object API across every component.
  • Automatic Unicode and CI-environment fallbacks so prompts render correctly across terminals.

Common Use Cases

  • Building create-* scaffolding CLIs and project generators that ask the user a series of configured questions.
  • Adding interactive setup wizards or configuration flows to developer tooling and internal scripts.
  • Surfacing long-running work with spinners, progress bars, and task lists during installs or builds.

Under The Hood

Architecture

@clack/prompts is the styled layer of a two-package monorepo: it re-exports headless interaction primitives from @clack/core (isCancel, settings, block, getColumns) and wraps them with terminal styling. Each prompt lives in its own module under packages/prompts/src (text.ts, select.ts, spinner.ts, autocomplete.ts, and so on), all barrel-exported from index.ts. Rendering is driven by ANSI escape sequences via sisteransi for cursor and erase control, Node’s built-in node:util styleText for color, and fast-wrap-ansi / fast-string-width for correct width-aware wrapping. Shared symbols and CI/Unicode fallbacks are centralized in common.ts, so components like spinner.ts degrade gracefully to ASCII frames when Unicode or a CI environment is detected.

Tech Stack

Written entirely in TypeScript (99.99% of the codebase) and shipped ESM-only, built with unbuild. Runtime dependencies are deliberately minimal: @clack/core (workspace peer), fast-string-width, fast-wrap-ansi, and sisteransi. The monorepo uses pnpm workspaces, Biome for lint/format, and requires Node >= 20.12. Versioning and changelogs are managed with Changesets.

Code Quality

Test coverage is strong: packages/prompts/test contains a dedicated Vitest spec for nearly every component (text, select, multi-select, autocomplete, date, password, spinner, path, and more), backed by snapshot fixtures and a vitest-ansi-serializer plus memfs mocks for filesystem-dependent prompts like path. Public options and results are expressed as exported TypeScript interfaces (e.g. SpinnerOptions, SpinnerResult), and default behavior is factored through option destructuring with sensible fallbacks.

API Design

The developer experience is the library’s standout trait. Every prompt is an async function taking a single option object with a shared vocabulary (message, validate, initialValue, options), so the mental model transfers across components. Cancellation is handled with one consistent pattern — the isCancel guard plus the cancel helper — and higher-level ergonomics (group, tasks, stream, log, intro/outro) reduce boilerplate for multi-step flows. Documentation in the README is example-first, and a StackBlitz demo lets users try it without installing.

Used by 38 apps in this directory

TypeScript
84%
Apache 2.0

ktx

AI Development · Analytics · Data Engineering

1,623

ktx builds a self-improving context layer over your data warehouse so AI agents like Claude Code and Codex query it with approved metric definitions instead of reinventing SQL logic from scratch.

View details
52
Repo Health
85
Technical
71
Dependency
Built with
TypeScript 84%
Updated 1 weeks ago
Go
95%
MIT

cli

Developer Tools · Team Chat

17,815

The official Lark/Feishu CLI tool built for both humans and AI agents, delivering 200+ commands and 26 AI agent skills across 18 business domains from messaging and calendar to docs, sheets, and approvals.

View details
84
Repo Health
83
Technical
75
Dependency
Built with
Go 95%
Updated 1 weeks ago
TypeScript
78%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,733

Open-source AI agent monitoring that catches what will break next before your users do.

View details
87
Repo Health
88
Technical
67
Dependency
Built with
TypeScript 78%
Python 11%
Rust 11%
Updated 1 weeks ago
Python
53%
AGPL 3.0

LearnHouse

CMS · Learning Management

2,413

Open-source LMS with AI tutoring, real-time collaboration boards, live code execution, and built-in course monetization — self-hosted in minutes.

View details
90
Repo Health
77
Technical
65
Dependency
Built with
Python 53%
TypeScript 45%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
53%
MIT

MentraOS

AI Development · Developer Tools

2,391

The open source operating system and SDK that lets developers build one app and run it across smart glasses from Even Realities, Vuzix, Mentra Live, and more.

View details
92
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 53%
Java 16%
Updated 6 days ago
Python
58%
Apache 2.0

MLflow

AI Development · Monitoring

28,512

The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.

View details
96
Repo Health
86
Technical
67
Dependency
Built with
Python 58%
TypeScript 35%
Updated 6 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
90%
MIT

OpenClaw

AI Agents · AI Assistants

392,894

An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.

View details
88
Repo Health
88
Technical
66
Dependency
Built with
TypeScript 90%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers