- #574
8f1c380Thanks @dreyfus92! - AddshowInstructionsoption toselect,multiselect, andgroupMultiselect. Keyboard hints remain shown by default; passshowInstructions: falseto hide them.
-
#582
4b24953Thanks @43081j! - Handle empty arrays in various prompts and utilities. -
Updated dependencies [
4b24953]:- @clack/core@1.4.3
-
#568
f87933fThanks @florian-lefebvre! - Updates default formatter ofnote()to note dim lines anymoreIf 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
cc6aab5Thanks @dreyfus92! - Add keyboard instruction footers toselect,multiselect, andgroupMultiselectin the active state, matching autocomplete. No option — always shown.
-
#548
2356e97Thanks @43081j! - Remove sourcemaps and enable pretty-ish build output. -
#546
56e9d67Thanks @ghostdevv! - docs: add jsdoc fordate,limit-options, andmessages -
Updated dependencies [
2356e97]:- @clack/core@1.4.1
-
#543
83428acThanks @florian-lefebvre! - Adds support for Standard Schema validationPrompts 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
adb6af9Thanks @ghostdevv! - docs: add jsdoc forbox,group, andgroup-multi-select -
#534
3dcb31aThanks @MattStypa! - Fixed spaces and uppercase characters in multiline prompt -
#540
3170ed9Thanks @ghostdevv! - docs: add jsdoc forautocomplete,confirm, andpathprompts -
Updated dependencies [
83428ac,3dcb31a]:- @clack/core@1.4.0
- 284677e: Support scrolling and
maxItemsoption forgroupMultiselect, and removes indent whenwithGuideis set tofalse
- aab46a2: docs: add jsdoc for
text,password, andmultilineprompts - 54be8d7: Fix line wrapping and overflow computation in group multi-select and other list-like prompts.
- Updated dependencies [54be8d7]
- @clack/core@1.3.1
- ea5702e: fix: add engines field expressing node >=20.12 requirement
- 814ab9a: Add new multiline prompt for multi-line text input.
- 5b897a7: Fix mixed type-only and runtime exports from @clack/core.
- Updated dependencies [78fd3ae]
- Updated dependencies [ea5702e]
- Updated dependencies [814ab9a]
- @clack/core@1.3.0
- 9786226: Externalize
fast-string-widthandfast-wrap-ansito avoid double dependencies - 090902c: Adds
dateprompt withformatsupport (YMD, MDY, DMY)
- 134a1a1: Fix the
pathprompt sodirectory: truecorrectly enforces directory-only selection while still allowing directory navigation, and add regression tests for both directory and default file selection behavior. - bdf89a5: Adds
placeholderoption toautocomplete. When the placeholder is set and the input is empty, pressingtabwill set the value toplaceholder. - 336495a: Apply guide to wrapped multi-line messages in confirm prompt.
- 9fe8de6: Respect
withGuide: falsein autocomplete and multiselect prompts. - 29a50cb: Fix
pathdirectory mode so pressing Enter with an existing directoryinitialValuesubmits that current directory instead of the first child option, and add regression coverage for immediate submit and child-directory navigation. - Updated dependencies [9786226]
- Updated dependencies [bdf89a5]
- Updated dependencies [417b451]
- Updated dependencies [090902c]
- @clack/core@1.2.0
- e3333fb: Replaces
picocolorswith Node.js built-instyleText.
- c3666e2: destruct
limitOptionparam for better code readability, tweak types definitions - ba3df8e: Fixes withGuide support in intro, outro, and cancel messages.
- Updated dependencies [e3333fb]
- @clack/core@1.1.0
- 6404dc1: Disallows selection of
disabledoptions in autocomplete. - 86e36d8: Adds
withGuidesupport to select prompt. - c697439: Fixes line wrapping behavior in autocomplete.
- 0ded19c: Simplifies
withGuideoption checks. - 0e4ddc9: Fixes
withGuidesupport in password and path prompts. - 76550d6: Adds
withGuidesupport to selectKey prompt. - f9b9953: Adds
withGuidesupport to password prompt. - 0e93ccb: Adds
verticalarrangement option toconfirmprompt. - 4e9ae13: Adds
withGuidesupport to confirm prompt. - 0256238: Adds
withGuidesupport to spinner prompt. - Updated dependencies [6404dc1]
- Updated dependencies [2533180]
- @clack/core@1.0.1
-
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().
-
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
userInputstored separately from theirvalue. -
8409f2c: feat: add styleFrame option for spinner
-
2837845: Adds suggestion and path prompts
-
99c3530: Adds
formatoption to the note prompt to allow formatting of individual lines -
0aaee4c: Added new
taskLogprompt 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
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 });
-
44df9af: Adds a new
groupSpacingoption 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
AutocompletePromptto core with comprehensive tests and implement bothautocompleteandautocomplete-multiselectcomponents 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
stopmethod that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods:stop(),cancel(), anderror():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
groupmethod, task logs can now have groups which themselves can have scrolling windows of logs. -
df4eea1: Remove
suggestionprompt and changepathprompt to be an autocomplete prompt. -
76fd17f: Added new
boxprompt for rendering boxed text, similar a note. -
9a09318: Adds new
progressprompt to display a progess-bar -
1604f97: Add
clearOnErroroption to password prompt to automatically clear input when validation fails -
9bd8072: Add a
requiredoption to autocomplete multiselect. -
19558b9: Added support for custom frames in spinner prompt
- 46dc0a4: Fixes multiselect only shows hints on the first item in the options list. Now correctly shows hints for all selected options with hint property.
- aea4573: Clamp scrolling windows to 5 rows.
- bfe0dd3: Prevents placeholder from being used as input value in text prompts
- 55eb280: Fix placeholder rendering when using autocomplete.
- 4d1d83b: Fixes rendering of multi-line messages and options in select prompt.
- 6176ced: Add withGuide support to note prompt
- 7b009df: Fix spinner clearing too many lines upwards when non-wrapping.
- 43aed55: Change styling of disabled multi-select options to have strikethrough.
- 17342d2: Exposes a new
SpinnerResulttype to describe the return type ofspinner - 282b39e: Wrap spinner output to allow for multi-line/wrapped messages.
- 2feaebb: Fix duplicated logs when scrolling through options with multiline messages by calculating
rowPaddingdynamically based on actual rendered lines instead of using a hardcoded value. - 69681ea: Strip destructive ANSI codes from task log messages.
- b0fa7d8: Add support for wrapped messages in multi line prompts
- 9999adf: fix note component overflow bug
- 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.
- 2839c66: fix(note): hard wrap text to column limit
- 7a556ad: Updates all prompts to accept a custom
outputandinputstream - 17d3650: Use a default import for picocolors to avoid run time errors in some environments.
- 7cc8a55: Messages passed to the
stopmethod of a spinner no longer have dots stripped. - b103ad3: Allow disabled options in multi-select and select prompts.
- 71b5029: Add missing nullish checks around values.
- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi
- f952592: Fixes missing guide when rendering empty log lines.
- 372b526: Add
clearmethod to spinner for stopping and clearing. - d25f6d0: fix(note, box): handle CJK correctly
- 94fee2a: Changes
placeholderto be a visual hint rather than a tabbable value. - 7530af0: Fixes wrapping of cancelled and success messages of select prompt
- 4c89dd7: chore: use more accurate type to replace any in group select
- 0b852e1: Handle
stopcalls on spinners which have not yet been started. - 42adff8: fix: add missing guide line in autocomplete-multiselect
- 8e2e30a: fix: fix autocomplete bar color when validate
- 2048eb1: Fix spinner's dots behavior with custom frames
- acc4c3a: Add a new
withGuideoption to all prompts to disable the default clack border - 9b92161: Show symbol when withGuide is true for log messages
- 68dbf9b: select-key: Fixed wrapping and added new
caseSensitiveoption - 09e596c: refactor(progress): remove unnecessary return statement in start function
- 2310b43: Allow custom writables as output stream.
- ae84dd0: Update key binding text to show tab/space when navigating, and tab otherwise.
- Updated dependency on
@clack/coreto1.0.0
-
613179d: Adds a new
indicatoroption tospinner, which supports the original"dots"loading animation or a new"timer"loading animation.import * as p from "@clack/prompts"; const spin = p.spinner({ indicator: "timer" }); spin.start("Loading"); await sleep(3000); spin.stop("Loaded");
-
a38b2bc: Adds
streamAPI which provides the same methods aslog, but for iterable (even async) message streams. This is particularly useful for AI responses which are dynamically generated by LLMs.import * as p from "@clack/prompts"; await p.stream.step( (async function* () { yield* generateLLMResponse(question); })() );
- 8093f3c: Adds
Errorsupport to thevalidatefunction - 98925e3: Exports the
Optiontype and improves JSDocannotations - 1904e57: Replace custom utility for stripping ANSI control sequences with Node's built-in
stripVTControlCharactersutility. - Updated dependencies [8093f3c]
- Updated dependencies [e5ba09a]
- Updated dependencies [8cba8e3]
- @clack/core@0.4.1
-
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/prompts"; // 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.One example use case is automatically cancelling a prompt after a timeout.
const shouldContinue = await confirm({ message: "This message will self destruct in 5 seconds", signal: AbortSignal.timeout(5000), });
Another use case is racing a long running task with a manual prompt.
const abortController = new AbortController(); const projectType = await Promise.race([ detectProjectType({ signal: abortController.signal, }), select({ message: "Pick a project type.", options: [ { value: "ts", label: "TypeScript" }, { value: "js", label: "JavaScript" }, { value: "coffee", label: "CoffeeScript", hint: "oh no" }, ], signal: abortController.signal, }), ]); abortController.abort();
-
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the
escapekey to cancel (ctrl+c).alias action kup lright jdown hleft esccancel
- f9f139d: Adapts
spinneroutput for static CI environments - Updated dependencies [a83d2f8]
- Updated dependencies [801246b]
- Updated dependencies [a83d2f8]
- Updated dependencies [51e12bc]
- @clack/core@0.4.0
- Updated dependencies [4845f4f]
- Updated dependencies [d7b2fb9]
- @clack/core@0.3.5
- 360afeb: feat: adaptative max items
- 9acccde: Add tasks function for executing tasks in spinners
- b5c6b9b: Feat multiselect maxItems option
- 50ed94a: fix: clear
spinnerhooks onspinner.stop - Updated dependencies [a04e418]
- Updated dependencies [4f6fcf5]
- @clack/core@0.3.4
- b27a701: add maxItems option to select prompt
- 89371be: added a new method called
spinner.message(msg: string)
- 52183c4: Fix
spinnerconflict with terminal on error betweenspinner.start()andspinner.stop() - ab51d29: Fixes cases where the note title length was miscalculated due to ansi characters
- Updated dependencies [cd79076]
- @clack/core@0.3.3
- c96eda5: Enable hard line-wrapping behavior for long words without spaces
- Updated dependencies [c96eda5]
- @clack/core@0.3.2
- 58a1df1: Fix line duplication bug by automatically wrapping prompts to
process.stdout.columns - Updated dependencies [58a1df1]
- @clack/core@0.3.1
- ca08fb6: Support complex value types for
select,multiselectandgroupMultiselect.
- 8a4a12f: add
groupMultiselectprompt - 165a1b3: Add
logAPIs. Supportslog.info,log.success,log.warn, andlog.error. For low-level control,log.messageis also exposed.
- Updated dependencies [8a4a12f]
- Updated dependencies [8a4a12f]
- @clack/core@0.3.0
- cc11917: Update default
passwordmask - Updated dependencies [ec812b6]
- @clack/core@0.2.1
- d74dd05: Adds a
selectKeyprompt type - 54c1bc3: Breaking Change
multiselecthas renamedinitialValuetoinitialValues
- Updated dependencies [d74dd05]
- Updated dependencies [54c1bc3]
- @clack/core@0.2.0
- 1251132: Multiselect: return
Value[]instead ofOption[]. - 8994382: Add a password prompt to
@clack/prompts - Updated dependencies [1251132]
- Updated dependencies [8994382]
- @clack/core@0.1.9
-
d96071c: Don't mutate
initialValueinmultiselect, fix parameter type forvalidate().Credits to @banjo for the bug report and initial PR!
-
Updated dependencies [d96071c]
- @clack/core@0.1.8
- 83d890e: Fix text cancel display bug
- Update README
- 7fb5375: Adds a new
defaultValueoption to the text prompt, removes automatic usage of the placeholder value. - Updated dependencies [7fb5375]
- @clack/core@0.1.6
- 61b88b6: Add
groupconstruct to group many prompts together
- de1314e: Support
requiredoption for multi-select - Updated dependencies [de1314e]
- @clack/core@0.1.5
- 493c592: Improve types for select/multiselect prompts. Numbers and booleans are now supported as the
valueoption. - 15558e3: Improved Windows/non-unicode support
- ca77da1: Fix multiselect initial value logic
- Updated dependencies [ca77da1]
- Updated dependencies [8aed606]
- @clack/core@0.1.4
- 94b24d9: Fix CJS
ansi-regexinterop
- a99c458: Support
initialValueoption for text prompt - Updated dependencies [a99c458]
- @clack/core@0.1.3
- Improved type safety
- b1341d6: Updated styles, new note component
- Updated dependencies [7dcad8f]
- Updated dependencies [2242f13]
- Updated dependencies [b1341d6]
- @clack/core@0.1.2
- fa09bf5: Use circle for radio, square for checkbox
- Updated dependencies [4be7dbf]
- Updated dependencies [b480679]
- @clack/core@0.1.1
- 7015ec9: Create new prompt: multi-select
- Updated dependencies [7015ec9]
- @clack/core@0.1.0
- e0b49e5: Update spinner so it actually spins
- Update README
- Updated dependencies [9d371c3]
- @clack/core@0.0.12
- Update README
- d20ef2a: Update keywords, URLs
- Updated dependencies [441d5b7]
- Updated dependencies [d20ef2a]
- Updated dependencies [fe13c2f]
- @clack/core@0.0.11
- Update README
- 80404ab: Update README
- a0cb382: Add
mainentrypoint - Updated dependencies [a0cb382]
- @clack/core@0.0.10
- Updated dependencies
- @clack/core@0.0.9
- a4b5e13: Initial release
- Updated dependencies [a4b5e13]
- @clack/core@0.0.8