{"record":{"id":"16c8023f8ef85cad","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-agents-init-option-arg-n-agents-init","errorCode":null,"errorMessage":"Unknown agents-init option: ${arg}\\n${AGENTS_INIT_USAGE}","messagePattern":"Unknown agents-init option: (.+?)\\\\n(.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/agents-init.ts","lineNumber":407,"sourceCode":"  );\n\n  console.log(\"Summary:\");\n  console.log(\n    `  updated=${summary.updated}, unchanged=${summary.unchanged}, backed_up=${summary.backedUp}, skipped=${summary.skipped}`,\n  );\n}\n\nexport async function agentsInitCommand(args: string[]): Promise<void> {\n  if (args.includes(\"--help\") || args.includes(\"-h\")) {\n    console.log(AGENTS_INIT_USAGE);\n    return;\n  }\n\n  const allowedFlags = new Set([\"--dry-run\", \"--force\", \"--verbose\"]);\n  for (const arg of args) {\n    if (!arg.startsWith(\"-\")) continue;\n    if (!allowedFlags.has(arg)) {\n      throw new Error(\n        `Unknown agents-init option: ${arg}\\n${AGENTS_INIT_USAGE}`,\n      );\n    }\n  }\n\n  const positionals = args.filter((arg) => !arg.startsWith(\"-\"));\n  if (positionals.length > 1) {\n    throw new Error(\n      `agents-init accepts at most one path argument.\\n${AGENTS_INIT_USAGE}`,\n    );\n  }\n\n  await agentsInit({\n    targetPath: positionals[0],\n    dryRun: args.includes(\"--dry-run\"),\n    force: args.includes(\"--force\"),\n    verbose: args.includes(\"--verbose\"),\n  });","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/agents-init.ts#L389-L425","documentation":"agents-init only accepts the flags --dry-run, --force and --verbose; any other dash-prefixed argument triggers this error with the full usage text appended. Positional path arguments are handled separately.","triggerScenarios":"Running `omx agents-init --quiet`, `--yes`, or a typo like `--dryrun`.","commonSituations":"Habits carried from other CLIs, assuming a global flag applies here, or typo'd flag names (missing hyphen in --dry-run).","solutions":["Use only --dry-run, --force, --verbose","Check for typos such as --dryrun vs --dry-run","Read the usage text embedded in the error message"],"exampleFix":"# before\nomx agents-init --dryrun\n\n# after\nomx agents-init --dry-run","handlingStrategy":"validation","validationCode":"const allowed = new Set(['--dry-run', '--force', '--verbose']);\nconst bad = args.filter(a => a.startsWith('-') && !allowed.has(a));\nif (bad.length) { console.error(`unknown options: ${bad.join(', ')}`); process.exit(2); }","typeGuard":"const isAllowedFlag = (a: string): boolean => !a.startsWith('-') || ['--dry-run','--force','--verbose'].includes(a);","tryCatchPattern":null,"preventionTips":["Only use the three documented flags","Spell --dry-run with the hyphen","Read the usage text appended to the error"],"tags":["cli","unknown-flag","usage","agents-init"],"backgroundTag":"invalid-command-line-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}