{"record":{"id":"b79f4b444786fdfa","repo":"paperclipai/paperclip","slug":"deletion-requires-yes-b79f4b","errorCode":null,"errorMessage":"Deletion requires --yes.","messagePattern":"Deletion requires --yes\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"cli/src/commands/client/goal.ts","lineNumber":163,"sourceCode":"            ownerAgentId: parseNullableString(opts.ownerAgentId),\n          });\n          const updated = await ctx.api.patch<Goal>(apiPath`/api/goals/${goalId}`, payload);\n          printOutput(updated, { json: ctx.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n\n  addCommonClientOptions(\n    goal\n      .command(\"delete\")\n      .description(\"Delete a goal\")\n      .argument(\"<goalId>\", \"Goal ID\")\n      .option(\"--yes\", \"Confirm deletion\")\n      .action(async (goalId: string, opts: GoalDeleteOptions) => {\n        try {\n          if (!opts.yes) throw new Error(\"Deletion requires --yes.\");\n          const ctx = resolveCommandContext(opts);\n          const deleted = await ctx.api.delete<Goal>(apiPath`/api/goals/${goalId}`);\n          printOutput(deleted, { json: ctx.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n}\n\nfunction parseNullableString(value: string | undefined): string | null | undefined {\n  if (value === undefined) return undefined;\n  return value.trim().toLowerCase() === \"null\" ? null : value;\n}\n","sourceCodeStart":145,"sourceCodeEnd":178,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/goal.ts#L145-L178","documentation":"The goal delete subcommand refuses to proceed unless --yes is passed. This is a deliberate guard against accidental destructive action.","triggerScenarios":"Running `paperclipai goal delete <goalId>` without --yes.","commonSituations":"Forgot the confirmation flag; running the command for the first time.","solutions":["Append --yes: `paperclipai goal delete <goalId> --yes`.","If scripting, set --yes explicitly after confirming the id."],"exampleFix":"// before\npaperclipai goal delete goal_123\n// after\npaperclipai goal delete goal_123 --yes","handlingStrategy":"validation","validationCode":"if (!opts.yes) throw new Error('Deletion requires --yes.');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --yes when scripting goal deletion.","Confirm the goal id immediately before the destructive call."],"tags":["cli","goal","confirmation","destructive"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}