- 9786226: Externalize
fast-string-widthandfast-wrap-ansito avoid double dependencies - 090902c: Adds
dateprompt withformatsupport (YMD, MDY, DMY)
- bdf89a5: Adds
placeholderoption toautocomplete. When the placeholder is set and the input is empty, pressingtabwill set the value toplaceholder. - 417b451: Only apply autocomplete default filter if it has been explicitly set or if options is not a getter.
- e3333fb: Replaces
picocolorswith Node.js built-instyleText.
- 6404dc1: Disallows selection of
disabledoptions in autocomplete. - 2533180: Updates the documentation to mention
userInputWithCursorwhen using theTextPromptprimitive.
-
c713fd5: The package is now distributed as ESM-only. In
v0releases, 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
userInputstored separately from theirvalue. -
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
updateSettingsfunction 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
AutocompletePromptto core with comprehensive tests and implement bothautocompleteandautocomplete-multiselectcomponents in prompts package. -
df4eea1: Remove
suggestionprompt and changepathprompt to be an autocomplete prompt. -
1604f97: Add
clearOnErroroption to password prompt to automatically clear input when validation fails
- 0718b07: fix: export
*Optionstypes for prompts. - bfe0dd3: Prevents placeholder from being used as input value in text prompts
- 6868c1c: Adds a new
selectableGroupsboolean to the group multi-select prompt. UsingselectableGroups: falsewill disable the ability to select a top-level group, but still allow every child to be selected individually. - 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs.
- a4f5034: Fixes an edge case for placeholder values. Previously, when pressing
enteron an empty prompt, placeholder values would be ignored. Now, placeholder values are treated as the prompt value. - b103ad3: Allow disabled options in multi-select and select prompts.
- 71b5029: Add missing nullish checks around values.
- a36292b: Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals.
- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi
- 4ba2d78: Support short terminal windows when re-rendering by accounting for off-screen lines
- 34f52fe: Validates initial values immediately when using text prompts with initialValue and validate props.
- 94fee2a: Changes
placeholderto be a visual hint rather than a tabbable value. - 4f6b3c2: Set initial values of auto complete prompt to first option when multiple is false.
- 8ead5d3: Avoid passing initial values to core when using auto complete prompt
- acc4c3a: Add a new
withGuideoption to all prompts to disable the default clack border - 68dbf9b: select-key: Fixed wrapping and added new
caseSensitiveoption - 2310b43: Allow custom writables as output stream.
- d98e033: add invert selection for multiselect prompt
- 8093f3c: Adds
Errorsupport to thevalidatefunction - e5ba09a: Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See Issue #127.
- 8cba8e3: Fixes a rendering bug with cursor positions for
TextPrompt
-
a83d2f8: Adds a new
updateSettings()function to support new global keybindings.updateSettings()accepts analiasesobject 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, updateSettings does not support disabling Clack's default keybindings.
-
801246b: Adds a new
signaloption to support programmatic prompt cancellation with an abort controller. -
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the
escapekey to cancel (ctrl+c).alias action kup lright jdown hleft esccancel
- 51e12bc: Improves types for events and interaction states.
- 4845f4f: Fixes a bug which kept the terminal cursor hidden after a prompt is cancelled
- d7b2fb9: Adds missing
LICENSEfile. Since thepackage.jsonfile 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
- 4f6fcf5: feat(@clack/core): allow tab completion for placeholders
- 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
- 8a4a12f: Add
GroupMultiSelectprompt
- 8a4a12f: add
groupMultiselectprompt
- ec812b6: fix
readlinehang on Windows
- d74dd05: Adds a
selectKeyprompt type - 54c1bc3: Breaking Change
multiselecthas renamedinitialValuetoinitialValues
- 1251132: Multiselect: return
Value[]instead ofOption[]. - 8994382: Add a password prompt to
@clack/prompts
-
d96071c: Don't mutate
initialValueinmultiselect, fix parameter type forvalidate().Credits to @banjo for the bug report and initial PR!
-
6d9e675: Add support for neovim cursor motion (
hjkl)Thanks @esau-morais for the assist!
- 7fb5375: Adds a new
defaultValueoption to the text prompt, removes automatic usage of the placeholder value.
- de1314e: Support
requiredoption for multi-select
- ca77da1: Fix multiselect initial value logic
- 8aed606: Fix
MaxListenersExceededWarningby detachingstdinlisteners on close
- a99c458: Support
initialValueoption for text prompt
- Allow isCancel to type guard any unknown value
- 7dcad8f: Allow placeholder to be passed to TextPrompt
- 2242f13: Fix multiselect returning undefined
- b1341d6: Improved placeholder handling
- 4be7dbf: Ensure raw mode is unset on submit
- b480679: Preserve value if validation fails
- 7015ec9: Create new prompt: multi-select
- 9d371c3: Fix rendering bug when using y/n to confirm
- 441d5b7: fix select return undefined
- d20ef2a: Update keywords, URLs
- fe13c2f: fix cursor missing after submit
- a0cb382: Add
mainentrypoint
- Fix node@16 issue (cannot read "createInterface" of undefined)
- a4b5e13: Bug fixes, exposes
blockutility
- Fix cursor bug
- Fix error with character check
- 491f9e0: update readme
- 7372d5c: Fix bug with line deletion
- 5605d28: Do not bundle dependencies (take II)
- 2ee67cb: don't bundle deps
- 306598e: Initial publish, still WIP