{"record":{"id":"048ef7e0ee3abd03","repo":"Yeachan-Heo/oh-my-codex","slug":"usage-omx-auth-use-slot","errorCode":null,"errorMessage":"Usage: omx auth use <slot>","messagePattern":"Usage: omx auth use <slot>","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/auth.ts","lineNumber":149,"sourceCode":"    if (wantsJson(args)) {\n      console.log(JSON.stringify({ slots, config: { rotation: config.rotation, priority: config.priority } }, null, 2));\n      return;\n    }\n    if (slots.length === 0) {\n      console.log(\"No auth slots configured. Run `omx auth add <slot>` first.\");\n      return;\n    }\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":131,"sourceCodeEnd":162,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/auth.ts#L131-L162","documentation":"`omx auth use` activates a stored credential slot and requires the slot name as its positional argument. Omitting it aborts with this usage error before any auth state is touched.","triggerScenarios":"Running `omx auth use` with no arguments.","commonSituations":"Users assuming the command lists or interactively picks slots; empty shell variables in scripts; forgetting the slot name they created earlier.","solutions":["Pass the slot name you created with `omx auth add`, e.g. `omx auth use work`","List your slots first (e.g. `omx auth list`/help) to recall exact names","Quote script variables: `omx auth use \"$SLOT\"`"],"exampleFix":"# before\nomx auth use\n# after\nomx auth use work","handlingStrategy":"validation","validationCode":"const slot = process.argv[3];\nif (!slot) { console.error('Usage: omx auth use <slot>'); process.exit(1); }","typeGuard":"const isNonEmptySlot = (s?: string): s is string => typeof s === 'string' && s.length > 0;","tryCatchPattern":"catch (e) { if (/^Usage: omx auth use/.test(String(e))) { listSlotsThenExit(); } else throw e; }","preventionTips":["Persist slot names in your tooling config","Validate args before invoking omx programmatically","Quote script variables"],"tags":["auth","cli","usage","missing-argument"],"backgroundTag":"missing-cli-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}