mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-16 08:25:14 +02:00
fix(cli): improve removed command guidance
This commit is contained in:
parent
49a746af28
commit
9b0c15152d
6 changed files with 232 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue