fix: add --prune and --json to KNOWN_FLAGS for spawn status (#2263)

The status command (PR #2254) added --prune and --json flags but did not
register them in KNOWN_FLAGS. This caused the CLI to reject them with
"Unknown flag" errors before the command could even dispatch.

Bump CLI version 0.15.4 -> 0.15.5.

Agent: ux-engineer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-06 16:31:07 -08:00 committed by GitHub
parent 035e4bf830
commit 9e26d74ddb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.15.4",
"version": "0.15.5",
"type": "module",
"bin": {
"spawn": "cli.js"

View file

@ -10,13 +10,13 @@ import { expandEqualsFlags, findUnknownFlag, KNOWN_FLAGS } from "../flags";
describe("Unknown Flag Detection", () => {
describe("detects unknown flags", () => {
it("should detect --json as unknown", () => {
it("should detect --foo as unknown", () => {
expect(
findUnknownFlag([
"list",
"--json",
"--foo",
]),
).toBe("--json");
).toBe("--foo");
});
it("should detect --verbose as unknown (middle position)", () => {
@ -50,20 +50,20 @@ describe("Unknown Flag Detection", () => {
it("should detect unknown flag at the beginning", () => {
expect(
findUnknownFlag([
"--json",
"--foo",
"list",
]),
).toBe("--json");
).toBe("--foo");
});
it("should return first unknown when multiple unknown flags", () => {
expect(
findUnknownFlag([
"--json",
"--foo",
"--verbose",
"list",
]),
).toBe("--json");
).toBe("--foo");
});
});
@ -87,6 +87,8 @@ describe("Unknown Flag Detection", () => {
"--debug",
"--name",
"--reauth",
"--prune",
"--json",
];
for (const flag of knownFlagsToTest) {
expect(
@ -211,6 +213,8 @@ describe("KNOWN_FLAGS completeness", () => {
"--clear",
"--custom",
"--reauth",
"--prune",
"--json",
];
for (const flag of expected) {
expect(KNOWN_FLAGS.has(flag)).toBe(true);

View file

@ -28,6 +28,8 @@ export const KNOWN_FLAGS = new Set([
"--region",
"--machine-type",
"--size",
"--prune",
"--json",
]);
/** Return the first unknown flag in args, or null if all are known/positional */