{"record":{"id":"e2a67e552b4cd72f","repo":"stablyai/orca","slug":"invalid-argument-e2a67e","errorCode":"invalid_argument","errorMessage":"Missing required --${name}","messagePattern":"Missing required --(.+?)","errorType":"exception","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/handlers/environment.ts","lineNumber":60,"sourceCode":"      formatEnvironment(value)\n    )\n  },\n  'environment rm': async ({ flags, json }) => {\n    const selector = getRequiredStringFlag(flags, 'environment')\n    const removed = redactRuntimeEnvironment(removeEnvironment(getDefaultUserDataPath(), selector))\n    printResult(\n      localSuccess({ removed }),\n      json,\n      (result: EnvironmentRemoveResult) =>\n        `Removed environment ${result.removed.name} (${result.removed.id}).`\n    )\n  }\n}\n\nfunction getRequiredStringFlag(flags: Map<string, string | boolean>, name: string): string {\n  const value = flags.get(name)\n  if (typeof value !== 'string' || value.length === 0) {\n    throw new RuntimeClientError('invalid_argument', `Missing required --${name}`)\n  }\n  return value\n}\n\nfunction localSuccess<TResult>(result: TResult): RuntimeRpcSuccess<TResult> {\n  return {\n    id: 'local',\n    ok: true,\n    result,\n    _meta: {\n      runtimeId: 'local'\n    }\n  }\n}\n","sourceCodeStart":42,"sourceCodeEnd":75,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/handlers/environment.ts#L42-L75","documentation":"Thrown by getRequiredStringFlag (environment.ts) when a required string flag is missing or empty. The local copy mirrors the shared helper in flags.ts: it reads flags.get(name) and rejects anything that is not a non-empty string. environment.ts uses this for flags the runtime cannot proceed without (e.g. an environment id or name).","triggerScenarios":"Calling an environment subcommand (create/remove/use) without a required flag such as --id or --name, or passing the flag with an empty value (--id \"\"). The exact flag name appears in the message via --${name}.","commonSituations":"Forgetting the identifier flag when scripting environment operations; passing an env var that expanded to empty; typo in the flag name so the intended value lands under a different key.","solutions":["Check the command's usage to see which flags are required, then supply the missing --<name> with a non-empty value.","If using a shell variable, verify it is set and non-empty before passing it: --id \"$ENV_ID\" where ENV_ID is exported.","Ensure there is no leading/trailing whitespace or quote artifact making the value effectively empty."],"exampleFix":"// before\norca environment remove\n// after\norca environment remove --id env_abc123","handlingStrategy":"validation","validationCode":"function requireStringFlag(flags: Map<string, string | boolean>, name: string): string {\n  const v = flags.get(name);\n  if (typeof v === 'string' && v.length > 0) return v;\n  throw new Error(`Missing required --${name}`);\n}","typeGuard":"function hasNonEmptyStringFlag(flags: Map<string, string | boolean>, name: string): boolean {\n  const v = flags.get(name);\n  return typeof v === 'string' && v.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Check command usage for required flags before invoking.","In scripts, assert env vars are non-empty before passing them as flag values."],"tags":["cli","argument-validation","required-flag","environment"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}