{"record":{"id":"5515747c5d8c31b9","repo":"OtterMind/Chat2DB","slug":"usage-node-script-github-issue-claim-js-event-cl","errorCode":null,"errorMessage":"Usage: node script/github/issue-claim.js <event|cleanup|sweep>","messagePattern":"Usage: node script/github/issue-claim\\.js <event\\|cleanup\\|sweep>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"script/github/issue-claim.js","lineNumber":732,"sourceCode":"    if (!process.env.GITHUB_EVENT_PATH) throw new Error('GITHUB_EVENT_PATH is required.');\n    const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'));\n    const result = await processEvent({ client, policy, event });\n    console.log(`Claim command result: ${result}`);\n    return;\n  }\n  if (mode === 'sweep') {\n    const released = await sweepExpiredClaims({ client, policy });\n    console.log(`Released ${released} expired claim(s).`);\n    return;\n  }\n  if (mode === 'cleanup') {\n    if (!process.env.GITHUB_EVENT_PATH) throw new Error('GITHUB_EVENT_PATH is required.');\n    const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'));\n    const result = await cleanupClaim({ client, policy, event });\n    console.log(`Claim cleanup result: ${result}`);\n    return;\n  }\n  throw new Error('Usage: node script/github/issue-claim.js <event|cleanup|sweep>');\n}\n\nif (require.main === module) {\n  main().catch((error) => {\n    console.error(error.stack || error.message);\n    process.exitCode = 1;\n  });\n}\n\nmodule.exports = {\n  ACTIVE_STATUS,\n  GitHubClient,\n  addDays,\n  canManageClaims,\n  cleanupClaim,\n  emptyState,\n  isEligibleIssue,\n  isLeaseExpired,","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/script/github/issue-claim.js#L714-L750","documentation":"Error \"Usage: node script/github/issue-claim.js <event|cleanup|sweep>\" thrown in OtterMind/Chat2DB.","triggerScenarios":"The CLI was invoked with no arguments or an unrecognized mode, so process.argv did not match event, cleanup, or sweep.","commonSituations":"See trigger scenarios.","solutions":["Run the script with exactly one mode argument: node script/github/issue-claim.js <event|cleanup|sweep>","In GitHub Actions, set the mode from the workflow event instead of calling the script without arguments."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}