NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #2637 most downloaded on npm
Clack contains low-level primitives for implementing your own command-line applications.
Latest stable
1.6.0
Last release 13 days ago
09 Nov 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 47 of 47 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
55 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
If you want the old behavior, provide a format() function:
#568 f87933f Thanks @florian-lefebvre! - Updates default formatter of note() to note dim lines anymore
If you want the old behavior, provide a format() function:
import { note } from '@clack/prompts';
+import { styleText } from 'node:util';
note(
'You can edit the file src/index.jsx',
'Next steps.'
+ { format: (text) => styleText('dim', text) }
);
#567 cc6aab5 Thanks @dreyfus92! - Add keyboard instruction footers to select, multiselect, and groupMultiselect in the active state, matching autocomplete. No option — always shown.
1835f41 Thanks @btea! - Add support for disabled selectKey options: they are rendered dimmed, cannot be selected by keypress, and are ignored when set as the initial value.#610 be35482 Thanks @43081j! - Update sisteransi to 2.x (ESM only).
#631 9053625 Thanks @43081j! - Account for escape sequences in prefixes during line wrapping. Very narrow outputs will now render correctly.
#608 f2bc46b Thanks @kai-natori! - Treat an ideographic space (U+3000) committed by IMEs (e.g. Japanese or Chinese input) as space when toggling options in multi-select prompts.
#616 f325a53 Thanks @btea! - Fix that isCancelled returned after calling cancel and start methods in progress does not refresh.
#614 5ac9e73 Thanks @btea! - Allow multiselect to accept readonly option arrays, e.g. options declared with as const. The Value type parameter is now inferred as a literal union ('a' | 'b') from such arrays, and initialValues also accepts readonly arrays.
#630 e66ab12 Thanks @imharjot! - Use the configured output stream's width when wrapping and clearing prompt frames, including prompts written to stderr while stdout is redirected.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Updated dependencies [`2356e97`]:
8bd9129 Thanks @gameroman! - Return type for prompts now correctly specifies CANCEL_SYMBOL instead of symbol### Minor Changes - #595 `227583e` Thanks @dreyfus92! - Add an accessible option to the shared PromptOptions and a resolved accessible getter on the b
#595 227583e Thanks @dreyfus92! - Add an accessible option to the shared PromptOptions and a resolved accessible getter on the base Prompt, so any prompt can opt into accessible mode individually. Resolution order: per-prompt option > updateSettings({ accessible }) > the ACCESSIBLE environment variable.
#592 caa32e8 Thanks @gameroman! - Export CANCEL_SYMBOL constant from @clack/core and @clack/prompts
#594 37fca4e Thanks @dreyfus92! - Add tab-completion to the path prompt: pressing Tab fills the input with the focused suggestion, so you can quickly descend into deep directories (type / and Tab again). Powered by a new opt-in completeOnTab option on autocomplete, which also shows a Tab: complete hint in the instructions footer. Default autocomplete behavior is unchanged.
#583 ae636dd Thanks @43081j! - Add async validation support to prompts, and validation state rendering to text prompts.
#593 b20fa2b Thanks @dreyfus92! - Add isAccessible() and an accessible setting as the foundation for accessible mode. Resolution order: per-call option > updateSettings({ accessible }) > the ACCESSIBLE environment variable (any non-empty value enables it, except 0 and false).
#543 83428ac Thanks @florian-lefebvre! - Adds support for Standard Schema validation
Prompts accept an optional validate() function to validate user input. While a function provides more flexibility and customization over your validation, it can be a bit verbose. To help solve this, there are libraries that provide schema-based validation to make shorthand and type-strict validation substantially easier.
Libraries following the Standard Schema specification are now natively supported. For example, using Arktype:
import { text } from '@clack/prompts';
import { type } from 'arktype';
const name = await text({
message: 'Enter your email',
+ validate: type('string.email').describe('Invalid email'),
});
#542 adb6af9 Thanks @ghostdevv! - docs: add jsdoc for box, group, and group-multi-select
#534 3dcb31a Thanks @MattStypa! - Fixed spaces and uppercase characters in multiline prompt
#540 3170ed9 Thanks @ghostdevv! - docs: add jsdoc for autocomplete, confirm, and path prompts
Updated dependencies [83428ac, 3dcb31a]:
### Patch Changes - #582 `4b24953` Thanks @43081j! - Handle empty arrays in various prompts and utilities.
Initial value is used as initial user input for multi-line prompts
#561 2f2b52f Thanks @avallete! - Fix password prompt resolving to undefined on empty submit. It now normalizes an empty submission to "", matching the text prompt behavior and the documented Promise<string | symbol> return type.
#569 e1b6ee7 Thanks @43081j! - fix: only submit multi-line prompt when double-return happens at end of input.
Also fixes two minor things:
### Patch Changes - #548 `2356e97` Thanks @43081j! - Remove sourcemaps and enable pretty-ish build output.
Prompts accept an optional validate() function to validate user input. While a function provides more flexibility and customization over your validati
#543 83428ac Thanks @florian-lefebvre! - Adds support for Standard Schema validation
Prompts accept an optional validate() function to validate user input. While a function provides more flexibility and customization over your validation, it can be a bit verbose. To help solve this, there are libraries that provide schema-based validation to make shorthand and type-strict validation substantially easier.
Libraries following the Standard Schema specification are now natively supported. For example, using Arktype:
import { text } from '@clack/prompts';
import { type } from 'arktype';
const name = await text({
message: 'Enter your email',
+ validate: type('string.email').describe('Invalid email'),
});
3dcb31a Thanks @MattStypa! - Fixed spaces and uppercase characters in multiline promptmaxItems option for groupMultiselect, and removes indent when withGuide is set to falsetext, password, and multiline prompts54be8d7: Fix line wrapping and overflow computation in group multi-select and other list-like prompts.
ea5702e: fix: add engines field expressing node >=20.12 requirement
debug option key.9786226: Externalize fast-string-width and fast-wrap-ansi to avoid double dependencies
fast-string-width and fast-wrap-ansi to avoid double dependenciesdate prompt with format support (YMD, MDY, DMY)path prompt so directory: true correctly enforces directory-only selection while still allowing directory navigation, and add regression tests for both directory and default file selection behavior.placeholder option to autocomplete. When the placeholder is set and the input is empty, pressing tab will set the value to placeholder.withGuide: false in autocomplete and multiselect prompts.path directory mode so pressing Enter with an existing directory initialValue submits that current directory instead of the first child option, and add regression coverage for immediate submit and child-directory navigation.fast-string-width and fast-wrap-ansi to avoid double dependenciesdate prompt with format support (YMD, MDY, DMY)placeholder option to autocomplete. When the placeholder is set and the input is empty, pressing tab will set the value to placeholder.e3333fb: Replaces picocolors with Node.js built-in styleText.
picocolors with Node.js built-in styleText.limitOption param for better code readability, tweak types definitions6404dc1: Disallows selection of disabled options in autocomplete.
disabled options in autocomplete.withGuide support to select prompt.withGuide option checks.withGuide support in password and path prompts.withGuide support to selectKey prompt.withGuide support to password prompt.vertical arrangement option to confirm prompt.withGuide support to confirm prompt.withGuide support to spinner prompt.disabled options in autocomplete.userInputWithCursor when using the TextPrompt primitive.c713fd5: The package is now distributed as ESM-only. In v0 releases, the package was dual-published as CJS and ESM.
c713fd5: The package is now distributed as ESM-only. In v0 releases, the package was dual-published as CJS and ESM.
For existing CJS projects using Node v20+, please see Node's guide on Loading ECMAScript modules using require().
415410b: This adds a custom filter function to autocompleteMultiselect. It could be used, for example, to support fuzzy searching logic.
7bc3301: Prompts now have a userInput stored separately from their value.
8409f2c: feat: add styleFrame option for spinner
2837845: Adds suggestion and path prompts
99c3530: Adds format option to the note prompt to allow formatting of individual lines
0aaee4c: Added new taskLog prompt for log output which is cleared on success
729bbb6: Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the updateSettings function to support multilingual CLIs.
This update also improves the architecture by exposing the core settings to the prompts package, enabling more consistent default message handling across the codebase.
// Per-instance customization
const spinner = prompts.spinner({
cancelMessage: "Operación cancelada", // "Operation cancelled" in Spanish
errorMessage: "Se produjo un error", // "An error occurred" in Spanish
});
// Global customization via updateSettings
prompts.updateSettings({
messages: {
cancel: "Operación cancelada", // "Operation cancelled" in Spanish
error: "Se produjo un error", // "An error occurred" in Spanish
},
});
// Settings can now be accessed directly
console.log(prompts.settings.messages.cancel); // "Operación cancelada"
// Direct options take priority over global settings
const spinner = prompts.spinner({
cancelMessage: "Cancelled", // This will be used instead of the global setting
});
44df9af: Adds a new groupSpacing option to grouped multi-select prompts. If set to an integer greater than 0, it will add that number of new lines between each group.
55645c2: Support wrapping autocomplete and select prompts.
9e5bc6c: Add support for signals in prompts, allowing them to be aborted.
f2c2b89: Adds AutocompletePrompt to core with comprehensive tests and implement both autocomplete and autocomplete-multiselect components in prompts package.
38019c7: Updates the API for stopping spinners and progress bars to be clearer
Previously, both the spinner and progress bar components used a single stop method that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods: stop(), cancel(), and error():
const spinner = prompts.spinner();
spinner.start();
// Cancelling a spinner
- spinner.stop(undefined, 1);
+ spinner.cancel();
// Stopping with an error
- spinner.stop(undefined, 2);
+ spinner.error();
As before, you can pass a message to each method to customize the output displayed:
spinner.cancel("Operation cancelled by user");
progressBar.error("An error occurred during processing");
c45b9fb: Adds support for detecting spinner cancellation via CTRL+C. This allows for graceful handling of user interruptions during long-running operations.
f10071e: Using the group method, task logs can now have groups which themselves can have scrolling windows of logs.
df4eea1: Remove suggestion prompt and change path prompt to be an autocomplete prompt.
76fd17f: Added new box prompt for rendering boxed text, similar a note.
9a09318: Adds new progress prompt to display a progess-bar
1604f97: Add clearOnError option to password prompt to automatically clear input when validation fails
9bd8072: Add a required option to autocomplete multiselect.
19558b9: Added support for custom frames in spinner prompt
SpinnerResult type to describe the return type of spinnerrowPadding dynamically based on actual rendered lines instead of using a hardcoded value.selectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.output and input streamstop method of a spinner no longer have dots stripped.clear method to spinner for stopping and clearing.placeholder to be a visual hint rather than a tabbable value.stop calls on spinners which have not yet been started.withGuide option to all prompts to disable the default clack bordercaseSensitive option@clack/core to 1.0.0c713fd5: The package is now distributed as ESM-only. In v0 releases, the package was dual-published as CJS and ESM.
For existing CJS projects using Node v20+, please see Node's guide on Loading ECMAScript modules using require().
7bc3301: Prompts now have a userInput stored separately from their value.
2837845: Adds suggestion and path prompts
729bbb6: Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the updateSettings function to support multilingual CLIs.
This update also improves the architecture by exposing the core settings to the prompts package, enabling more consistent default message handling across the codebase.
// Per-instance customization
const spinner = prompts.spinner({
cancelMessage: "Operación cancelada", // "Operation cancelled" in Spanish
errorMessage: "Se produjo un error", // "An error occurred" in Spanish
});
// Global customization via updateSettings
prompts.updateSettings({
messages: {
cancel: "Operación cancelada", // "Operation cancelled" in Spanish
error: "Se produjo un error", // "An error occurred" in Spanish
},
});
// Settings can now be accessed directly
console.log(prompts.settings.messages.cancel); // "Operación cancelada"
// Direct options take priority over global settings
const spinner = prompts.spinner({
cancelMessage: "Cancelled", // This will be used instead of the global setting
});
55645c2: Support wrapping autocomplete and select prompts.
f2c2b89: Adds AutocompletePrompt to core with comprehensive tests and implement both autocomplete and autocomplete-multiselect components in prompts package.
df4eea1: Remove suggestion prompt and change path prompt to be an autocomplete prompt.
1604f97: Add clearOnError option to password prompt to automatically clear input when validation fails
*Options types for prompts.selectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.enter on an empty prompt, placeholder values would be ignored. Now, placeholder values are treated as the prompt value.placeholder to be a visual hint rather than a tabbable value.withGuide option to all prompts to disable the default clack bordercaseSensitive option68dbf9b: select-key: Fixed wrapping and added new caseSensitive option
caseSensitive optionrowPadding dynamically based on actual rendered lines instead of using a hardcoded value.38019c7: Updates the API for stopping spinners and progress bars to be clearer
38019c7: Updates the API for stopping spinners and progress bars to be clearer
Previously, both the spinner and progress bar components used a single stop method that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods: stop(), cancel(), and error():
const spinner = prompts.spinner();
spinner.start();
// Cancelling a spinner
- spinner.stop(undefined, 1);
+ spinner.cancel();
// Stopping with an error
- spinner.stop(undefined, 2);
+ spinner.error();
As before, you can pass a message to each method to customize the output displayed:
spinner.cancel("Operation cancelled by user");
progressBar.error("An error occurred during processing");
withGuide option to all prompts to disable the default clack border*Options types for prompts.withGuide option to all prompts to disable the default clack borderb103ad3: Allow disabled options in multi-select and select prompts.
55645c2: Support wrapping autocomplete and select prompts.
stop calls on spinners which have not yet been started.d98e033: add invert selection for multiselect prompt
1604f97: Add clearOnError option to password prompt to automatically clear input when validation fails
clearOnError option to password prompt to automatically clear input when validation failsbox prompt for rendering boxed text, similar a note.clearOnError option to password prompt to automatically clear input when validation fails7bc3301: Prompts now have a userInput stored separately from their value.
userInput stored separately from their value.suggestion prompt and change path prompt to be an autocomplete prompt.required option to autocomplete multiselect.placeholder to be a visual hint rather than a tabbable value.c713fd5: The package is now distributed as ESM-only. In v0 releases, the package was dual-published as CJS and ESM.
c713fd5: The package is now distributed as ESM-only. In v0 releases, the package was dual-published as CJS and ESM.
For existing CJS projects using Node v20+, please see Node's guide on Loading ECMAScript modules using require().
99c3530: Adds format option to the note prompt to allow formatting of individual lines
0aaee4c: Added new taskLog prompt for log output which is cleared on success
729bbb6: Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the updateSettings function to support multilingual CLIs.
This update also improves the architecture by exposing the core settings to the prompts package, enabling more consistent default message handling across the codebase.
// Per-instance customization
const spinner = prompts.spinner({
cancelMessage: "Operación cancelada", // "Operation cancelled" in Spanish
errorMessage: "Se produjo un error", // "An error occurred" in Spanish
});
// Global customization via updateSettings
prompts.updateSettings({
messages: {
cancel: "Operación cancelada", // "Operation cancelled" in Spanish
error: "Se produjo un error", // "An error occurred" in Spanish
},
});
// Settings can now be accessed directly
console.log(prompts.settings.messages.cancel); // "Operación cancelada"
// Direct options take priority over global settings
const spinner = prompts.spinner({
cancelMessage: "Cancelled", // This will be used instead of the global setting
});
44df9af: Adds a new groupSpacing option to grouped multi-select prompts. If set to an integer greater than 0, it will add that number of new lines between each group.
f2c2b89: Adds AutocompletePrompt to core with comprehensive tests and implement both autocomplete and autocomplete-multiselect components in prompts package.
c45b9fb: Adds support for detecting spinner cancellation via CTRL+C. This allows for graceful handling of user interruptions during long-running operations.
9a09318: Adds new progress prompt to display a progess-bar
19558b9: Added support for custom frames in spinner prompt
SpinnerResult type to describe the return type of spinnerselectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.output and input streamstop method of a spinner no longer have dots stripped.54c1bc3: Breaking Change multiselect has renamed initialValue to initialValues
selectKey prompt typemultiselect has renamed initialValue to initialValues### Patch Changes - Update README
selectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.enter on an empty prompt, placeholder values would be ignored. Now, placeholder values are treated as the prompt value.8093f3c: Adds Error support to the validate function
Error support to the validate functionTextPromptdefaultValue option to the text prompt, removes automatic usage of the placeholder value.61b88b6: Add group construct to group many prompts together
group construct to group many prompts togetherrequired option for multi-selecta83d2f8: Adds a new updateSettings() function to support new global keybindings.
updateSettings() accepts an aliases object that maps custom keys to an action (up | down | left | right | space | enter | cancel).
import { updateSettings } from "@clack/core";
// Support custom keybindings
updateSettings({
aliases: {
w: "up",
a: "left",
s: "down",
d: "right",
},
});
[!WARNING] In order to enforce consistent, user-friendly defaults across the ecosystem,
updateSettingsdoes not support disabling Clack's default keybindings.
801246b: Adds a new signal option to support programmatic prompt cancellation with an abort controller.
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the escape key to cancel (ctrl+c).
| alias | action |
|---|---|
k |
up |
l |
right |
j |
down |
h |
left |
esc |
cancel |
4845f4f: Fixes a bug which kept the terminal cursor hidden after a prompt is cancelled
LICENSE file. Since the package.json file has always included "license": "MIT", please consider this a licensing clarification rather than a licensing change.a04e418: fix(@clack/core): keyboard input not working after await in spinner
cd79076: fix: restore raw mode on unblock
c96eda5: Enable hard line-wrapping behavior for long words without spaces
58a1df1: Fix line duplication bug by automatically wrapping prompts to process.stdout.columns
process.stdout.columns493c592: Improve types for select/multiselect prompts. Numbers and booleans are now supported as the value option.
value option.GroupMultiSelect promptgroupMultiselect prompta99c458: Support initialValue option for text prompt
initialValue option for text promptb1341d6: Updated styles, new note component
selectKey prompt typemultiselect has renamed initialValue to initialValues1251132: Multiselect: return Value[] instead of Option[].
Value[] instead of Option[].@clack/promptsd96071c: Don't mutate initialValue in multiselect, fix parameter type for validate().
d96071c: Don't mutate initialValue in multiselect, fix parameter type for validate().
Credits to @banjo for the bug report and initial PR!
6d9e675: Add support for neovim cursor motion (hjkl)
6d9e675: Add support for neovim cursor motion (hjkl)
Thanks @esau-morais for the assist!
7fb5375: Adds a new defaultValue option to the text prompt, removes automatic usage of the placeholder value.
defaultValue option to the text prompt, removes automatic usage of the placeholder value.de1314e: Support required option for multi-select
required option for multi-selectca77da1: Fix multiselect initial value logic
MaxListenersExceededWarning by detaching stdin listeners on closea99c458: Support initialValue option for text prompt
initialValue option for text promptAllow isCancel to type guard any unknown value
fa09bf5: Use circle for radio, square for checkbox
7015ec9: Create new prompt: multi-select
9d371c3: Fix rendering bug when using y/n to confirm
441d5b7: fix select return undefined
e0b49e5: Update spinner so it actually spins
Fix node@16 issue (cannot read "createInterface" of undefined)
a4b5e13: Bug fixes, exposes block utility
block utility### Patch Changes - Fix cursor bug
### Patch Changes - Fix error with character check
### Patch Changes - 491f9e0: update readme
7372d5c: Fix bug with line deletion
### Patch Changes - a0cb382: Add main entrypoint - Updated dependencies [a0cb382] - @clack/core@0.0.10
main entrypoint### Patch Changes - 2ee67cb: don't bundle deps
306598e: Initial publish, still WIP
One column per quarter.