{"record":{"id":"c9bc302af073a48f","repo":"paperclipai/paperclip","slug":"use-only-one-of-value-or-value-env","errorCode":null,"errorMessage":"Use only one of --value or --value-env.","messagePattern":"Use only one of --value or --value-env\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/secrets.ts","lineNumber":196,"sourceCode":"  const next: AgentEnvConfig = { ...(env as Record<string, EnvBinding>) };\n  for (const [envKey, secretId] of secretIdByEnvKey) {\n    next[envKey] = {\n      type: \"secret_ref\",\n      secretId,\n      version: \"latest\",\n    };\n  }\n  return next;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n  if (typeof value !== \"object\" || value === null || Array.isArray(value)) return null;\n  return value as Record<string, unknown>;\n}\n\nfunction readValueFromOptions(opts: { value?: string; valueEnv?: string }): string {\n  if (opts.value !== undefined && opts.valueEnv !== undefined) {\n    throw new Error(\"Use only one of --value or --value-env.\");\n  }\n  if (opts.valueEnv !== undefined) {\n    const value = process.env[opts.valueEnv];\n    if (!value) throw new Error(`Environment variable ${opts.valueEnv} is empty or unset.`);\n    return value;\n  }\n  if (opts.value !== undefined) return opts.value;\n  throw new Error(\"Secret value is required. Pass --value or --value-env.\");\n}\n\nfunction renderDeclaration(input: CompanyPortabilityEnvInput): Record<string, unknown> {\n  const scope = input.agentSlug\n    ? `agent:${input.agentSlug}`\n    : input.projectSlug\n      ? `project:${input.projectSlug}`\n      : \"company\";\n  return {\n    key: input.key,","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/secrets.ts#L178-L214","documentation":"readValueFromOptions got both --value and --value-env for a secret create/rotate; the mutual-exclusion guard fires because the secret value source is ambiguous.","triggerScenarios":"Thrown at cli/src/commands/client/secrets.ts:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only one of --value or --value-env."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}