{"record":{"id":"d8ff34d422c416a0","repo":"openai/codex-plugin-cc","slug":"missing-version-n-n-usage","errorCode":null,"errorMessage":"Missing version.\\n\\n${usage()}","messagePattern":"Missing version\\.\\\\n\\\\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/bump-version.mjs","lineNumber":204,"sourceCode":"    if (JSON.stringify(json) !== before) {\n      writeJson(root, target.file, json);\n      changedFiles.push(target.file);\n    }\n  }\n\n  return changedFiles;\n}\n\nfunction main() {\n  const options = parseArgs(process.argv.slice(2));\n  if (options.help) {\n    console.log(usage());\n    return;\n  }\n\n  const version = options.version ?? (options.check ? readPackageVersion(options.root) : null);\n  if (!version) {\n    throw new Error(`Missing version.\\n\\n${usage()}`);\n  }\n  validateVersion(version);\n\n  if (options.check) {\n    const mismatches = checkVersions(options.root, version);\n    if (mismatches.length > 0) {\n      throw new Error(`Version metadata is out of sync:\\n${mismatches.join(\"\\n\")}`);\n    }\n    console.log(`All version metadata matches ${version}.`);\n    return;\n  }\n\n  const changedFiles = bumpVersion(options.root, version);\n  const touched = changedFiles.length > 0 ? changedFiles.join(\", \") : \"no files changed\";\n  console.log(`Set version metadata to ${version}: ${touched}.`);\n}\n\ntry {","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/scripts/bump-version.mjs#L186-L222","documentation":"Thrown by main() in bump-version.mjs when no version can be determined: the positional version arg was not supplied AND --check was not passed (so package.json was not consulted as a fallback). It appends the full usage text. This is the 'you did not tell me what to do' invocation error.","triggerScenarios":"Running `node scripts/bump-version.mjs` with no arguments at all, or only flags like `--root /x` without a version and without --check. The version resolves to null and the check-fallback branch is skipped.","commonSituations":"First-time invocation to discover usage; a wrapper that forwards an empty argv; forgetting --check when intending to verify; expecting the script to auto-derive the next version.","solutions":["Pass a version: `node scripts/bump-version.mjs 1.0.0`.","Or use --check to verify against package.json: `node scripts/bump-version.mjs --check`.","Run with --help to see full usage."],"exampleFix":"// before\n$ node scripts/bump-version.mjs\n\n// after\n$ node scripts/bump-version.mjs --check\n# or\n$ node scripts/bump-version.mjs 1.0.0","handlingStrategy":"validation","validationCode":"function ensureInvocation(argv) {\n  const hasCheck = argv.includes(\"--check\");\n  const hasVersion = argv.some((a) => !a.startsWith(\"-\") && !(argv[argv.indexOf(a) - 1] === \"--root\"));\n  if (!hasCheck && !hasVersion) {\n    throw new Error(\"Missing version. Pass <version> or --check.\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass either a version or --check; never invoke with neither.","Print --help in wrappers when argv is empty.","Document the two valid invocation shapes at the top of release scripts."],"tags":["cli","args","bump-version","usage","empty-state"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}