diff --git a/src/cli/src/index.ts b/src/cli/src/index.ts index 9e1976f..852a3cf 100644 --- a/src/cli/src/index.ts +++ b/src/cli/src/index.ts @@ -25,7 +25,7 @@ export function createProgram(): Command { .name(APP_NAME) .description('Manage MCP servers like kubectl manages containers') .version(APP_VERSION, '-v, --version') - .option('-o, --output ', 'output format (table, json, yaml)', 'table') + .enablePositionalOptions() .option('--daemon-url ', 'mcplocal daemon URL') .option('--direct', 'bypass mcplocal and connect directly to mcpd'); diff --git a/src/cli/tests/cli.test.ts b/src/cli/tests/cli.test.ts index 2a82ff7..f9bbdcb 100644 --- a/src/cli/tests/cli.test.ts +++ b/src/cli/tests/cli.test.ts @@ -24,9 +24,10 @@ describe('createProgram', () => { expect(status).toBeDefined(); }); - it('has output option', () => { + it('subcommands have output option', () => { const program = createProgram(); - const opt = program.options.find((o) => o.long === '--output'); + const get = program.commands.find((c) => c.name() === 'get'); + const opt = get?.options.find((o) => o.long === '--output'); expect(opt).toBeDefined(); });