{"record":{"id":"fb33bbb243c1ed85","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-agents-subcommand-subcommand","errorCode":null,"errorMessage":"unknown agents subcommand: ${subcommand}","messagePattern":"unknown agents subcommand: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/agents.ts","lineNumber":304,"sourceCode":"      console.log(`Created native agent: ${path}`);\n      return;\n    }\n    case 'edit': {\n      const name = args[1];\n      assert.ok(name, 'Usage: omx agents edit <name>');\n      const path = await editNativeAgent(name, { cwd: process.cwd(), scope });\n      console.log(`Edited native agent: ${path}`);\n      return;\n    }\n    case 'remove': {\n      const name = args[1];\n      assert.ok(name, 'Usage: omx agents remove <name>');\n      const path = await removeNativeAgent(name, { cwd: process.cwd(), scope, force });\n      console.log(`Removed native agent: ${path}`);\n      return;\n    }\n    default:\n      throw new Error(`unknown agents subcommand: ${subcommand}`);\n  }\n}\n","sourceCodeStart":286,"sourceCodeEnd":307,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/agents.ts#L286-L307","documentation":"The `omx agents` command dispatches on a subcommand string and throws when it does not match any known case (list/add/remove). This is a CLI argument parsing error indicating the user typed an unrecognized or misspelled subcommand.","triggerScenarios":"Running `omx agents <something>` where <something> is not one of the supported subcommands (e.g. `omx agents delete`, `omx agents rm`, or a typo like `omx agents lst`).","commonSituations":"Users guessing CLI verbs (delete vs remove), older/newer versions where subcommand sets differ, or shell aliases/scripts passing stale subcommand names.","solutions":["Run `omx agents --help` (or read the CLI docs) to list supported subcommands","Use the exact verb shown in help, e.g. `omx agents remove <name>` instead of `delete`","Update to the latest omx version in case the subcommand was renamed","Check shell scripts/aliases for hardcoded subcommand strings that no longer exist"],"exampleFix":"# before\nomx agents delete my-agent\n# after\nomx agents remove my-agent","handlingStrategy":"validation","validationCode":"const VALID = new Set(['list','add','remove']);\nif (!VALID.has(sub)) {\n  console.error(`unknown agents subcommand: ${sub}`);\n  process.exit(1);\n}","typeGuard":"const isAgentsSubcommand = (s: string): s is 'list' | 'add' | 'remove' =>\n  ['list','add','remove'].includes(s);","tryCatchPattern":"catch (e) { if (e instanceof Error && e.message.startsWith('unknown agents subcommand')) { printAgentsHelp(); } else throw e; }","preventionTips":["Parse and validate subcommands before invoking the CLI programmatically","Pin the omx version in scripts so subcommand sets don't drift","Wrap omx calls and map usage-style errors to help output"],"tags":["cli","argument-parsing","agents"],"backgroundTag":"unknown-cli-subcommand","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}