feat(cli): add box-drawing prefixes to setup informational messages

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) <noreply@anthropic.com>
This commit is contained in:
Luca Martial 2026-05-12 15:46:56 -07:00
parent 80f298d652
commit f091f948ee
5 changed files with 12 additions and 12 deletions

View file

@ -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');
}
}

View file

@ -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`,

View file

@ -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) {

View file

@ -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();
});

View file

@ -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({