fix(cli): improve removed command guidance

This commit is contained in:
Andrey Avtomonov 2026-05-12 01:52:40 +02:00
parent 49a746af28
commit 9b0c15152d
6 changed files with 232 additions and 5 deletions

View file

@ -120,6 +120,22 @@ export function buildLiveDatabaseIngestArgs(projectDir, databaseIntrospectionUrl
];
}
export function buildSetupNewProjectArgs(projectDir) {
return [
'exec',
'ktx',
'setup',
'--new',
'--project-dir',
projectDir,
'--skip-llm',
'--skip-embeddings',
'--skip-databases',
'--skip-sources',
'--no-input',
];
}
export function buildLiveDatabaseStatusArgs(projectDir, runId) {
return ['exec', 'ktx', 'ingest', 'status', '--project-dir', projectDir, runId];
}
@ -308,11 +324,11 @@ async function main() {
await prepareCleanInstall(layout, cleanInstallDir);
await mkdir(projectDir, { recursive: true });
const init = await run('pnpm', ['exec', 'ktx', 'init', projectDir, '--name', 'artifact-live-database'], {
const setup = await run('pnpm', buildSetupNewProjectArgs(projectDir), {
cwd: cleanInstallDir,
timeout: 30_000,
});
requireSuccess('ktx init', init);
requireSuccess('ktx setup --new', setup);
await writeFile(join(projectDir, 'ktx.yaml'), buildKtxYaml(postgresUrl), 'utf8');
const databaseIntrospectionUrl = await startDaemon(cleanInstallDir);

View file

@ -9,6 +9,7 @@ import {
buildPostgresUrl,
buildPostgresReadyArgs,
buildSeedSql,
buildSetupNewProjectArgs,
smokeContainerName,
} from './installed-live-database-smoke.mjs';
@ -99,6 +100,20 @@ describe('installed live-database artifact smoke helpers', () => {
});
it('builds installed CLI live-database ingest and status commands', () => {
assert.deepEqual(buildSetupNewProjectArgs('/tmp/project'), [
'exec',
'ktx',
'setup',
'--new',
'--project-dir',
'/tmp/project',
'--skip-llm',
'--skip-embeddings',
'--skip-databases',
'--skip-sources',
'--no-input',
]);
assert.deepEqual(buildLiveDatabaseIngestArgs('/tmp/project', 'http://127.0.0.1:8765'), [
'exec',
'ktx',