{"record":{"id":"ccb17e302bc77957","repo":"earendil-works/pi","slug":"unknown-auth-command-args-1-use-pi-a","errorCode":null,"errorMessage":"Unknown auth command \"${args[1] ?? \"\"}\". Use \"pi auth print-api-key\", \"pi auth print-bearer-token\", or \"pi auth check\".","messagePattern":"Unknown auth command \"(.+?)\"\\. Use \"pi auth print-api-key\", \"pi auth print-bearer-token\", or \"pi auth check\"\\.","errorType":"validation","errorClass":"AuthCommandError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/auth-command.ts","lineNumber":60,"sourceCode":"  pi auth print-bearer-token [--provider <provider>] [--model <model>] [--min-expiry <duration>]\n  pi auth check [--provider <provider>] [--model <model>] [--json] [--credentials] [--no-refresh]\n\nAuth commands require at least one of --provider or --model. Checks refresh expired OAuth credentials by default; --no-refresh prevents this. --credentials emits the credential, or includes it in JSON output.`);\n}\n\nexport function parseAuthCommand(args: string[]): AuthCommand | undefined {\n\tif (args[0] !== \"auth\") return undefined;\n\n\tconst kind =\n\t\targs[1] === \"check\"\n\t\t\t? \"check\"\n\t\t\t: args[1] === \"print-api-key\"\n\t\t\t\t? \"api_key\"\n\t\t\t\t: args[1] === \"print-bearer-token\"\n\t\t\t\t\t? \"bearer_token\"\n\t\t\t\t\t: undefined;\n\tif (!kind) {\n\t\tthrow new AuthCommandError(\n\t\t\t`Unknown auth command \"${args[1] ?? \"\"}\". Use \"${APP_NAME} auth print-api-key\", \"${APP_NAME} auth print-bearer-token\", or \"${APP_NAME} auth check\".`,\n\t\t);\n\t}\n\n\tconst commandArgs: string[] = [];\n\tlet json = false;\n\tlet credentials = false;\n\tlet noRefresh = false;\n\tlet minExpiryMs: number | undefined;\n\tfor (let index = 2; index < args.length; index++) {\n\t\tconst arg = args[index];\n\t\tif (arg === \"--min-expiry\") {\n\t\t\tif (kind !== \"bearer_token\")\n\t\t\t\tthrow new AuthCommandError(\"--min-expiry is only supported by print-bearer-token\");\n\t\t\tconst value = args[++index];\n\t\t\tconst match = value ? /^(\\d+)(ms|s|m|h)$/iu.exec(value) : undefined;\n\t\t\tif (!match) throw new AuthCommandError(\"--min-expiry must use a duration such as 30m or 1h\");\n\t\t\tconst amount = Number(match[1]);","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/cli/auth-command.ts#L42-L78","documentation":"Error \"Unknown auth command \"${args[1] ?? \"\"}\". Use \"pi auth print-api-key\", \"pi auth print-bearer-token\", or \"pi auth check\".\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/cli/auth-command.ts:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}