[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

[ci] format

authored by

James Garbutt and committed by
bombshell-bot
(Jul 24, 2025, 2:17 PM UTC) d4de920c d45408fd

+62 -69
+45 -45
biome.json
··· 1 1 { 2 - "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json", 3 - "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, 4 - "files": { "ignoreUnknown": false, "includes": ["**", "!**/dist/**"] }, 5 - "formatter": { 6 - "enabled": true, 7 - "useEditorconfig": true, 8 - "formatWithErrors": false, 9 - "indentStyle": "tab", 10 - "indentWidth": 2, 11 - "lineEnding": "lf", 12 - "lineWidth": 100, 13 - "attributePosition": "auto", 14 - "bracketSpacing": true, 15 - "includes": [ 16 - "**", 17 - "!**/.github/workflows/**/*.yml", 18 - "!**/.changeset/**/*.md", 19 - "!**/pnpm-lock.yaml", 20 - "!**/package.json" 21 - ] 22 - }, 23 - "assist": { "actions": { "source": { "organizeImports": "on" } } }, 24 - "linter": { 25 - "enabled": true, 26 - "rules": { "recommended": true, "suspicious": { "noExplicitAny": "off" } } 27 - }, 28 - "javascript": { 29 - "formatter": { 30 - "jsxQuoteStyle": "double", 31 - "quoteProperties": "asNeeded", 32 - "trailingCommas": "es5", 33 - "semicolons": "always", 34 - "arrowParentheses": "always", 35 - "bracketSameLine": false, 36 - "quoteStyle": "single", 37 - "attributePosition": "auto", 38 - "bracketSpacing": true 39 - } 40 - }, 41 - "overrides": [ 42 - { 43 - "includes": ["**/*.json", "**/*.toml", "**/*.yml"], 44 - "formatter": { "indentStyle": "space" } 45 - } 46 - ] 2 + "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json", 3 + "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, 4 + "files": { "ignoreUnknown": false, "includes": ["**", "!**/dist/**"] }, 5 + "formatter": { 6 + "enabled": true, 7 + "useEditorconfig": true, 8 + "formatWithErrors": false, 9 + "indentStyle": "tab", 10 + "indentWidth": 2, 11 + "lineEnding": "lf", 12 + "lineWidth": 100, 13 + "attributePosition": "auto", 14 + "bracketSpacing": true, 15 + "includes": [ 16 + "**", 17 + "!**/.github/workflows/**/*.yml", 18 + "!**/.changeset/**/*.md", 19 + "!**/pnpm-lock.yaml", 20 + "!**/package.json" 21 + ] 22 + }, 23 + "assist": { "actions": { "source": { "organizeImports": "on" } } }, 24 + "linter": { 25 + "enabled": true, 26 + "rules": { "recommended": true, "suspicious": { "noExplicitAny": "off" } } 27 + }, 28 + "javascript": { 29 + "formatter": { 30 + "jsxQuoteStyle": "double", 31 + "quoteProperties": "asNeeded", 32 + "trailingCommas": "es5", 33 + "semicolons": "always", 34 + "arrowParentheses": "always", 35 + "bracketSameLine": false, 36 + "quoteStyle": "single", 37 + "attributePosition": "auto", 38 + "bracketSpacing": true 39 + } 40 + }, 41 + "overrides": [ 42 + { 43 + "includes": ["**/*.json", "**/*.toml", "**/*.yml"], 44 + "formatter": { "indentStyle": "space" } 45 + } 46 + ] 47 47 }
+1 -1
examples/basic/progress.ts
··· 1 1 import { setTimeout } from 'node:timers/promises'; 2 - import * as p from '@clack/prompts'; 3 2 import type { ProgressResult } from '@clack/prompts'; 3 + import * as p from '@clack/prompts'; 4 4 5 5 async function fakeProgress(progressbar: ProgressResult): Promise<void> { 6 6 await setTimeout(1000);
+5 -6
packages/core/src/index.ts
··· 1 - export type { ClackState as State } from './types.js'; 2 - export type { ClackSettings } from './utils/settings.js'; 3 - 1 + export { default as AutocompletePrompt } from './prompts/autocomplete.js'; 4 2 export { default as ConfirmPrompt } from './prompts/confirm.js'; 5 3 export { default as GroupMultiSelectPrompt } from './prompts/group-multiselect.js'; 6 4 export { default as MultiSelectPrompt } from './prompts/multi-select.js'; ··· 9 7 export { default as SelectPrompt } from './prompts/select.js'; 10 8 export { default as SelectKeyPrompt } from './prompts/select-key.js'; 11 9 export { default as TextPrompt } from './prompts/text.js'; 12 - export { default as AutocompletePrompt } from './prompts/autocomplete.js'; 13 - export { block, isCancel, getColumns } from './utils/index.js'; 14 - export { updateSettings, settings } from './utils/settings.js'; 10 + export type { ClackState as State } from './types.js'; 11 + export { block, getColumns, isCancel } from './utils/index.js'; 12 + export type { ClackSettings } from './utils/settings.js'; 13 + export { settings, updateSettings } from './utils/settings.js';
+1 -3
packages/core/src/prompts/prompt.ts
··· 3 3 import type { Readable, Writable } from 'node:stream'; 4 4 import { cursor, erase } from 'sisteransi'; 5 5 import wrap from 'wrap-ansi'; 6 - 7 - import { CANCEL_SYMBOL, diffLines, isActionKey, setRawMode, settings } from '../utils/index.js'; 8 - 9 6 import type { ClackEvents, ClackState } from '../types.js'; 10 7 import type { Action } from '../utils/index.js'; 8 + import { CANCEL_SYMBOL, diffLines, isActionKey, setRawMode, settings } from '../utils/index.js'; 11 9 12 10 export interface PromptOptions<TValue, Self extends Prompt<TValue>> { 13 11 render(this: Omit<Self, 'prompt'>): string | undefined;
+1 -1
packages/core/src/utils/index.ts
··· 6 6 import { cursor } from 'sisteransi'; 7 7 import { isActionKey } from './settings.js'; 8 8 9 - export * from './string.js'; 10 9 export * from './settings.js'; 10 + export * from './string.js'; 11 11 12 12 const isWindows = globalThis.process.platform.startsWith('win'); 13 13
-1
packages/core/test/prompts/confirm.test.ts
··· 1 - 2 1 import { cursor } from 'sisteransi'; 3 2 import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; 4 3 import { default as ConfirmPrompt } from '../../src/prompts/confirm.js';
-1
packages/core/test/prompts/select.test.ts
··· 1 - 2 1 import { cursor } from 'sisteransi'; 3 2 import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; 4 3 import { default as SelectPrompt } from '../../src/prompts/select.js';
+1 -3
packages/prompts/src/group.ts
··· 13 13 * Control how the group can be canceled 14 14 * if one of the prompts is canceled. 15 15 */ 16 - onCancel?: (opts: { 17 - results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>; 18 - }) => void; 16 + onCancel?: (opts: { results: Prettify<Partial<PromptGroupAwaitedReturn<T>>> }) => void; 19 17 } 20 18 21 19 export type PromptGroup<T> = {
+3 -3
packages/prompts/src/index.ts
··· 1 - export { isCancel, updateSettings, settings, type ClackSettings } from '@clack/core'; 1 + export { type ClackSettings, isCancel, settings, updateSettings } from '@clack/core'; 2 2 3 3 export * from './autocomplete.js'; 4 4 export * from './common.js'; 5 5 export * from './confirm.js'; 6 - export * from './group-multi-select.js'; 7 6 export * from './group.js'; 7 + export * from './group-multi-select.js'; 8 8 export * from './limit-options.js'; 9 9 export * from './log.js'; 10 10 export * from './messages.js'; ··· 13 13 export * from './password.js'; 14 14 export * from './path.js'; 15 15 export * from './progress-bar.js'; 16 - export * from './select-key.js'; 17 16 export * from './select.js'; 17 + export * from './select-key.js'; 18 18 export * from './spinner.js'; 19 19 export * from './stream.js'; 20 20 export * from './task.js';
+2 -2
packages/prompts/src/spinner.ts
··· 3 3 import { cursor, erase } from 'sisteransi'; 4 4 import { 5 5 type CommonOptions, 6 + isCI as isCIFn, 6 7 S_BAR, 7 8 S_STEP_CANCEL, 8 9 S_STEP_ERROR, 9 10 S_STEP_SUBMIT, 10 - isCI as isCIFn, 11 11 unicode, 12 12 } from './common.js'; 13 13 ··· 44 44 let isSpinnerActive = false; 45 45 let isCancelled = false; 46 46 let _message = ''; 47 - let _prevMessage: string | undefined ; 47 + let _prevMessage: string | undefined; 48 48 let _origin: number = performance.now(); 49 49 50 50 const handleExit = (code: number) => {
+2 -2
packages/prompts/src/task-log.ts
··· 4 4 import { erase } from 'sisteransi'; 5 5 import { 6 6 type CommonOptions, 7 + isCI as isCIFn, 8 + isTTY as isTTYFn, 7 9 S_BAR, 8 10 S_STEP_SUBMIT, 9 - isCI as isCIFn, 10 - isTTY as isTTYFn, 11 11 } from './common.js'; 12 12 import { log } from './log.js'; 13 13
+1 -1
packages/prompts/test/progress-bar.test.ts
··· 1 1 import process from 'node:process'; 2 2 import { EventEmitter } from 'node:stream'; 3 3 import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'; 4 - import * as prompts from '../src/index.js'; 5 4 import type { ProgressOptions } from '../src/index.js'; 5 + import * as prompts from '../src/index.js'; 6 6 import { MockWritable } from './test-utils.js'; 7 7 8 8 describe.each(['true', 'false'])('prompts - progress (isCI = %s)', (isCI) => {