feat: Replace prompts library with @clack/prompts - #604
Merged
Conversation
The prompts package is unmaintained (last published October 2021). Replace it with @clack/prompts, which covers every prompt type the CLI uses, including autocomplete, autocomplete multiselect, and toggle-style confirm, and ships its own TypeScript types. The prompt wrapper now exposes one typed helper per prompt kind instead of passing through prompts question objects. Each helper keeps the TTY guard and renders to stderr, and normalizes clack's cancel symbol into a PromptCancelledError that the CLI entrypoint reports as a quiet 'Cancelled' instead of cascading undefined answers. Timestamps are now collected with a validated text prompt defaulting to the current time, since the clack date picker has no time-of-day segments and API timestamps need them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N2Ch14ybwrTTFwM7sHFWr6
…ement-explore-m8h9vq # Conflicts: # src/lib/interact-for-server-selection.ts # src/lib/interact-for-workspace-id.ts # src/lib/util/prompt.ts
razor-x
marked this pull request as ready for review
August 4, 2026 21:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrated the CLI's interactive prompting system from the
promptslibrary to@clack/prompts, providing a more modern and composable API for user interactions.Key Changes
promptsand added@clack/promptsas the new prompting solutionprompt()function with specialized, type-safe functions:promptText()- for text inputpromptNumber()- for numeric input with validationpromptConfirm()- for yes/no confirmationspromptSelect()- for single-choice selectionpromptAutocomplete()- for searchable selectionpromptAutocompleteMultiselect()- for multi-select with searchPromptCancelledErrorto handle user cancellations (Ctrl+C/Escape)PromptChoice<Value>interface withlabel,value, and optionalhintfields, replacing the previoustitle/descriptionformatinteract-for-blueprint-object.tsinteract-for-custom-metadata.tsinteract-for-use-remote-api-defs.tsinteract-for-array.tsinteract-for-server-selection.tsinteract-for-timestamp.tsinteract-for-command-selection.tsinteract-for-workspace-id.tsinteract-for-resource.tsinteract-for-action-attempt-poll.tsinteract-for-login.tscli.tsdateprompt type withpromptText()and added custom validation for ISO timestamp formatNotable Implementation Details
stderrto prevent interference with stdout when pipedensureInteractive()helper validates that a TTY is available before promptingunwrap()helper converts@clack/promptscancel symbols toPromptCancelledErrorexceptionsundefinedfor valid input (instead oftrue) to match@clack/promptsconventionshttps://claude.ai/code/session_01N2Ch14ybwrTTFwM7sHFWr6