Skip to content

Commit f2044f8

Browse files
la14-1louisgvclaude
authored
fix: add --yes/-y to KNOWN_FLAGS so spawn delete --name <name> --yes works (#3024)
PR #3015 added --yes and -y flags to the delete command but didn't add them to KNOWN_FLAGS in flags.ts. This caused `spawn delete --name foo --yes` to fail with "Unknown flag: --yes" because checkUnknownFlags runs before dispatchDeleteCommand strips these flags. Also adds delete-specific flags to --help documentation. Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0f48e4d commit f2044f8

5 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/spawn",
3-
"version": "0.26.12",
3+
"version": "0.26.13",
44
"type": "module",
55
"bin": {
66
"spawn": "cli.js"

packages/cli/src/__tests__/unknown-flags.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ describe("Unknown Flag Detection", () => {
8989
"--reauth",
9090
"--prune",
9191
"--json",
92+
"--yes",
93+
"-y",
9294
];
9395
for (const flag of knownFlagsToTest) {
9496
expect(
@@ -228,6 +230,8 @@ describe("KNOWN_FLAGS completeness", () => {
228230
"--fast",
229231
"--user",
230232
"-u",
233+
"--yes",
234+
"-y",
231235
];
232236
// Every flag in the expected list must exist in KNOWN_FLAGS.
233237
for (const flag of expected) {

packages/cli/src/commands/help.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function getHelpUsageSection(): string {
3131
spawn delete Delete a previously spawned server (aliases: rm, destroy, kill)
3232
spawn delete -a <agent> Filter servers by agent
3333
spawn delete -c <cloud> Filter servers by cloud
34+
spawn delete --name <name> --yes Headless delete by name (no prompts)
3435
spawn status Show live state of cloud servers (aliases: ps)
3536
spawn status -a <agent> Filter status by agent (or --agent)
3637
spawn status -c <cloud> Filter status by cloud (or --cloud)

packages/cli/src/flags.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export const KNOWN_FLAGS = new Set([
3838
"--fast",
3939
"--user",
4040
"-u",
41+
"--yes",
42+
"-y",
4143
]);
4244

4345
/** Return the first unknown flag in args, or null if all are known/positional */

packages/cli/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ function checkUnknownFlags(args: string[]): void {
149149
console.error(` ${pc.cyan("-c, --cloud")} Filter history by cloud`);
150150
console.error(` ${pc.cyan("--clear")} Clear all spawn history`);
151151
console.error();
152+
console.error(` For ${pc.cyan("spawn delete")}:`);
153+
console.error(` ${pc.cyan("--name <name>")} Filter by server name or ID`);
154+
console.error(` ${pc.cyan("--yes, -y")} Skip confirmation (required for non-interactive)`);
155+
console.error();
152156
console.error(` Run ${pc.cyan("spawn help")} for full usage information.`);
153157
process.exit(1);
154158
}

0 commit comments

Comments
 (0)