{"record":{"id":"849647857e95f4d7","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-auth-command-command-n-auth-help-trim","errorCode":null,"errorMessage":"Unknown auth command: ${command}\\n${AUTH_HELP.trim()}","messagePattern":"Unknown auth command: (.+?)\\\\n(.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/auth.ts","lineNumber":156,"sourceCode":"    }\n    for (const slot of slots) {\n      const quota = slot.exhaustedAt ? ` exhausted=${slot.exhaustedAt}` : slot.lastQuotaAt ? ` last-quota=${slot.lastQuotaAt}` : \"\";\n      const used = slot.lastUsedAt ? ` last-used=${slot.lastUsedAt}` : \"\";\n      console.log(`${slot.slot}${used}${quota}`);\n    }\n    return;\n  }\n\n  if (command === \"use\") {\n    const slot = args[1];\n    if (!slot) throw new Error(\"Usage: omx auth use <slot>\");\n    const liveAuthPath = resolveLiveAuthPath(cwd, env, home);\n    const record = await useSlot(slot, liveAuthPath, home);\n    console.log(`Using auth slot ${record.slot}`);\n    return;\n  }\n\n  throw new Error(`Unknown auth command: ${command}\\n${AUTH_HELP.trim()}`);\n}\n\nexport function formatAuthError(err: unknown): string {\n  return redactAuthSecrets(err);\n}\n","sourceCodeStart":138,"sourceCodeEnd":162,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/auth.ts#L138-L162","documentation":"The `omx auth` dispatcher only handles a fixed set of subcommands (help/list/add/use etc.); anything else falls through to this error, which echoes the unknown command and appends the full auth help text for reference.","triggerScenarios":"Running `omx auth login`, `omx auth switch`, `omx auth delete`, or any subcommand outside the implemented set.","commonSituations":"Naming drift from other CLIs (login vs add, switch vs use); typos; older omx docs referencing removed subcommands.","solutions":["Read the AUTH_HELP text included in the error — it lists valid subcommands","Use the correct verb: add to create a slot, use to activate one","Check `omx auth --help` for the current subcommand set in your version"],"exampleFix":"# before\nomx auth switch work\n# after\nomx auth use work","handlingStrategy":"validation","validationCode":"const VALID = new Set(['list','add','use','help']);\nif (!VALID.has(command)) { console.error(AUTH_HELP); process.exit(1); }","typeGuard":"const isAuthCommand = (c: string): c is 'list'|'add'|'use'|'help' => ['list','add','use','help'].includes(c);","tryCatchPattern":"catch (e) { if (/^Unknown auth command:/.test(String(e))) { printAuthHelp(); } else throw e; }","preventionTips":["Use the subcommand names from AUTH_HELP","Pin omx version in automation","Map invalid-command errors to help text in wrappers"],"tags":["auth","cli","unknown-command","usage"],"backgroundTag":"unknown-cli-subcommand","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}