Skip to content

Commit c198fa7

Browse files
Merge pull request #1878 from PostHog/posthog-code/cli-overhaul-workbench-compat
fix(ci): track wizard CLI overhaul command surface
2 parents 4fc402a + 8e439b6 commit c198fa7

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

apps/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"ciCapable": true
99
},
1010
{
11-
"id": "revenue",
11+
"id": "revenue-analytics",
1212
"dir": "revenue",
1313
"label": "Revenue Analytics",
1414
"description": "Wire Stripe + PostHog for revenue tracking",

services/wizard-benchmark/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,12 @@ function runBenchmark(
215215
});
216216
}
217217

218-
// Subcommand (e.g. 'revenue') must come before flags
218+
// Subcommand (e.g. 'revenue', or a family leaf like 'audit events') must come
219+
// before flags. Split on whitespace so multi-token subcommands become
220+
// separate argv entries.
219221
const subcommand = commandToSubcommand(command.id);
220222
const args: string[] = [wizardBin];
221-
if (subcommand) args.push(subcommand);
223+
if (subcommand) args.push(...subcommand.split(' '));
222224
args.push(
223225
"--local-mcp",
224226
"--benchmark",

services/wizard-ci/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,12 @@ export function runWizard(appPath: string, options: WizardOptions = {}): Promise
192192
});
193193
}
194194

195-
// Build wizard args — subcommand (e.g. 'revenue') must come before flags
195+
// Build wizard args — subcommand (e.g. 'revenue', or a family leaf like
196+
// 'audit events') must come before flags. Split on whitespace so multi-token
197+
// subcommands become separate argv entries.
196198
const args = [wizardBin];
197199
if (options.command) {
198-
args.push(options.command);
200+
args.push(...options.command.split(' '));
199201
}
200202
if (options.skillId) {
201203
args.push(`--skill=${options.skillId}`);

services/wizard-commands.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,25 @@ function loadManifest(): WizardCommand[] {
5151

5252
export const WIZARD_COMMANDS: WizardCommand[] = loadManifest();
5353

54+
/**
55+
* Family commands (e.g. `audit`) require a concrete leaf in non-interactive
56+
* runs — after the CLI overhaul, bare `wizard audit` opens an interactive
57+
* picker (or errors under `--ci`) instead of running an audit. Drive a
58+
* sensible default leaf so CI keeps exercising the command. `all` runs the
59+
* comprehensive audit so CI checks full integrations end-to-end.
60+
*/
61+
const FAMILY_DEFAULT_LEAF: Record<string, string> = { audit: 'all' };
62+
5463
/**
5564
* Convert a command id to the subcommand string the wizard binary expects.
5665
* 'default' → undefined (no subcommand), 'skill' → undefined (uses --skill flag),
57-
* any other id → the id itself.
66+
* a family id → "<family> <leaf>" (e.g. 'audit' → 'audit events'),
67+
* any other id → the id itself. May be multi-token — callers must split on
68+
* whitespace before pushing into an argv array.
5869
*/
5970
export function commandToSubcommand(id: string): string | undefined {
6071
if (id === 'default' || id === 'skill') return undefined;
72+
if (FAMILY_DEFAULT_LEAF[id]) return `${id} ${FAMILY_DEFAULT_LEAF[id]}`;
6173
return id;
6274
}
6375

0 commit comments

Comments
 (0)