{"record":{"id":"7d92fa54291b54ee","repo":"Yeachan-Heo/oh-my-codex","slug":"agents-init-accepts-at-most-one-path-argument-n","errorCode":null,"errorMessage":"agents-init accepts at most one path argument.\\n${AGENTS_INIT_USAGE}","messagePattern":"agents-init accepts at most one path argument\\.\\\\n(.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/agents-init.ts","lineNumber":415,"sourceCode":"export 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  });\n}\n","sourceCodeStart":397,"sourceCodeEnd":427,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/agents-init.ts#L397-L427","documentation":"agents-init accepts at most one positional argument (the target path). Passing two or more non-flag arguments is ambiguous and rejected with the usage string.","triggerScenarios":"Running `omx agents-init . extra` or passing multiple target paths expecting batch scaffolding.","commonSituations":"Assuming multi-target support, unquoted shell expansion producing multiple words, or leftover arguments in a script.","solutions":["Run the command once per target","Quote arguments that may expand to multiple words","Remove stray positionals"],"exampleFix":"# before\nomx agents-init packages/a packages/b\n\n# after\nomx agents-init packages/a && omx agents-init packages/b","handlingStrategy":"validation","validationCode":"const positionals = args.filter(a => !a.startsWith('-'));\nif (positionals.length > 1) {\n  console.error('agents-init takes at most one path');\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invoke once per target directory","Quote arguments that might word-split in shells"],"tags":["cli","argument-parsing","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"}