From f091f948ee1b44177f187b4d0d5884d7b5dbbbf5 Mon Sep 17 00:00:00 2001 From: Luca Martial Date: Tue, 12 May 2026 15:46:56 -0700 Subject: [PATCH] feat(cli): add box-drawing prefixes to setup informational messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align stdout informational messages in setup flows with the existing Clack prompt visual style by prefixing them with │. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/cli/src/setup-databases.ts | 8 ++++---- packages/cli/src/setup-embeddings.ts | 2 +- packages/cli/src/setup-models.ts | 4 ++-- packages/cli/src/setup-project.test.ts | 2 +- packages/cli/src/setup-project.ts | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/cli/src/setup-databases.ts b/packages/cli/src/setup-databases.ts index 113fd048..2210338c 100644 --- a/packages/cli/src/setup-databases.ts +++ b/packages/cli/src/setup-databases.ts @@ -1110,7 +1110,7 @@ async function maybeRunHistoricSqlSetupProbe(input: { return; } - input.io.stdout.write('Historic SQL probe...\n'); + input.io.stdout.write('│ Historic SQL probe...\n'); const probe = input.deps.historicSqlProbe ?? defaultHistoricSqlProbe; const result = await probe({ projectDir: input.projectDir, @@ -1118,10 +1118,10 @@ async function maybeRunHistoricSqlSetupProbe(input: { dialect: 'postgres', }); for (const line of result.lines) { - input.io.stdout.write(`${line}\n`); + input.io.stdout.write(`│${line}\n`); } if (!result.ok) { - input.io.stdout.write('Setup written; first ingest run will fail until fixed.\n'); + input.io.stdout.write('│ Setup written; first ingest run will fail until fixed.\n'); } } @@ -1256,7 +1256,7 @@ async function chooseDrivers( return 'back'; } - io.stdout.write('KTX cannot work without at least one primary source. Select a source or press Escape to go back.\n'); + io.stdout.write('│ KTX cannot work without at least one primary source. Select a source or press Escape to go back.\n'); } } diff --git a/packages/cli/src/setup-embeddings.ts b/packages/cli/src/setup-embeddings.ts index d6579a05..0c617c3e 100644 --- a/packages/cli/src/setup-embeddings.ts +++ b/packages/cli/src/setup-embeddings.ts @@ -257,7 +257,7 @@ async function chooseCredentialRef( } if (choice === 'paste') { io.stdout.write( - `${[ + `│ ${[ `KTX will save the key in .ktx/secrets/${backend}-api-key with local file permissions,`, 'then write a file: reference in ktx.yaml.', ].join(' ')}\n`, diff --git a/packages/cli/src/setup-models.ts b/packages/cli/src/setup-models.ts index 5b0dea18..f69d6506 100644 --- a/packages/cli/src/setup-models.ts +++ b/packages/cli/src/setup-models.ts @@ -254,7 +254,7 @@ async function chooseCredentialRef( const prompts = deps.prompts ?? createPromptAdapter(); if (args.showPromptInstructions !== false) { io.stdout.write( - 'Use Up/Down to move, Enter to confirm the current selection, choose Back to return to the previous step, Ctrl+C to exit.\n', + '│ Use Up/Down to move, Enter to confirm the current selection, choose Back to return to the previous step, Ctrl+C to exit.\n', ); } while (true) { @@ -271,7 +271,7 @@ async function chooseCredentialRef( } if (choice === 'paste') { io.stdout.write( - 'KTX will save the key in .ktx/secrets/anthropic-api-key with local file permissions, then write a file: reference in ktx.yaml.\n', + '│ KTX will save the key in .ktx/secrets/anthropic-api-key with local file permissions, then write a file: reference in ktx.yaml.\n', ); const value = await prompts.password({ message: withTextInputNavigation('Anthropic API key') }); if (value === undefined) { diff --git a/packages/cli/src/setup-project.test.ts b/packages/cli/src/setup-project.test.ts index 6c75d554..8cf94a9b 100644 --- a/packages/cli/src/setup-project.test.ts +++ b/packages/cli/src/setup-project.test.ts @@ -187,7 +187,7 @@ describe('setup project step', () => { ); expect(prompts.text).not.toHaveBeenCalled(); expect(result.status === 'ready' ? result.project.config.project : '').toBe('ktx-project'); - expect(testIo.stdout()).toContain(`KTX will create:\n ${projectDir}`); + expect(testIo.stdout()).toContain(`│ KTX will create:\n│ ${projectDir}`); await expect(stat(join(projectDir, 'ktx.yaml'))).resolves.toBeDefined(); }); diff --git a/packages/cli/src/setup-project.ts b/packages/cli/src/setup-project.ts index 094f3f3f..669e3f34 100644 --- a/packages/cli/src/setup-project.ts +++ b/packages/cli/src/setup-project.ts @@ -148,8 +148,8 @@ async function promptForNewProjectDir( const defaultProjectDir = join(projectDir, DEFAULT_NEW_PROJECT_FOLDER_NAME); while (true) { - io.stdout.write(`Relative paths are resolved from:\n ${projectDir}\n`); - io.stdout.write(`Home paths are resolved from:\n ${homeDir}\n`); + io.stdout.write(`│ Relative paths are resolved from:\n│ ${projectDir}\n`); + io.stdout.write(`│ Home paths are resolved from:\n│ ${homeDir}\n`); const destinationChoice = await prompts.select({ message: 'Where should KTX create the project?', options: [ @@ -213,7 +213,7 @@ async function promptForNewProjectDir( confirmedCreation = true; } - io.stdout.write(`KTX will create:\n ${selectedDir}\n`); + io.stdout.write(`│ KTX will create:\n│ ${selectedDir}\n`); if (state !== 'non-empty-directory') { const createAction = await prompts.select({ message: `Create KTX project at ${selectedDir}?`, @@ -317,7 +317,7 @@ export async function runKtxSetupProjectStep( const prompts = deps.prompts ?? createClackSetupProjectPromptAdapter(); io.stdout.write( - 'Use Up/Down to move, Enter to confirm the current selection, choose Back to return to the previous step, Ctrl+C to exit.\n', + '│ Use Up/Down to move, Enter to confirm the current selection, choose Back to return to the previous step, Ctrl+C to exit.\n', ); while (true) { const choice = await prompts.select({