{"record":{"id":"2c3567fc64c83e93","repo":"paperclipai/paperclip","slug":"invalid-kind-value-use-all-secret-plain","errorCode":null,"errorMessage":"Invalid --kind value. Use: all, secret, plain","messagePattern":"Invalid --kind value\\. Use: all, secret, plain","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/secrets.ts","lineNumber":398,"sourceCode":"        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n\n  addCommonClientOptions(\n    secrets\n      .command(\"declarations\")\n      .description(\"List portable env declarations emitted by company export\")\n      .requiredOption(\"-C, --company-id <id>\", \"Company ID\")\n      .option(\"--include <values>\", \"Comma-separated include set: company,agents,projects,issues,tasks,skills\", \"company,agents,projects\")\n      .option(\"--kind <kind>\", \"Filter declarations: all | secret | plain\", \"all\")\n      .action(async (opts: SecretDeclarationsOptions) => {\n        try {\n          const ctx = resolveCommandContext(opts, { requireCompany: true });\n          const kind = opts.kind ?? \"all\";\n          if (![\"all\", \"secret\", \"plain\"].includes(kind)) {\n            throw new Error(\"Invalid --kind value. Use: all, secret, plain\");\n          }\n          const preview = await ctx.api.post<CompanyPortabilityExportPreviewResult>(\n            apiPath`/api/companies/${ctx.companyId}/exports/preview`,\n            { include: parseSecretsInclude(opts.include) },\n          );\n          const declarations = (preview?.manifest.envInputs ?? [])\n            .filter((entry) => kind === \"all\" || entry.kind === kind);\n          printOutput(ctx.json ? declarations : declarations.map(renderDeclaration), { json: ctx.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n  );\n\n  addCommonClientOptions(\n    secrets\n      .command(\"create\")\n      .description(\"Create a Paperclip-managed secret\")","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/secrets.ts#L380-L416","documentation":"The `secrets declarations` command reads `--kind` (default `all`) and validates membership in the fixed set {all, secret, plain} before calling the export-preview API. An unrecognized value throws immediately. This narrows the declaration filter before any network call.","triggerScenarios":"Passing `--kind foo`, `--kind secrets` (wrong plural), or any value outside all/secret/plain to `paperclipai secrets declarations`.","commonSituations":"Typo; guessing the allowed values instead of reading the help; using `secrets` (plural) or `plaintext` instead of `secret`/`plain`.","solutions":["Use one of: `all`, `secret`, or `plain`","Omit `--kind` to accept the default (`all`)","Run `paperclipai secrets declarations --help` to confirm the accepted values"],"exampleFix":"# before\npaperclipai secrets declarations -C comp-1 --kind secrets\n# after\npaperclipai secrets declarations -C comp-1 --kind secret","handlingStrategy":"validation","validationCode":"const ALLOWED_KIND = new Set([\"all\", \"secret\", \"plain\"]);\nfunction validateKind(kind: string | undefined): \"all\" | \"secret\" | \"plain\" {\n  const k = kind ?? \"all\";\n  if (!ALLOWED_KIND.has(k)) throw new Error(`Invalid --kind '${k}'. Use: all, secret, plain`);\n  return k as \"all\" | \"secret\" | \"plain\";\n}","typeGuard":"const KINDS = [\"all\", \"secret\", \"plain\"] as const;\ntype DeclarationKind = typeof KINDS[number];\nfunction isDeclarationKind(v: unknown): v is DeclarationKind {\n  return typeof v === \"string\" && (KINDS as readonly string[]).includes(v);\n}","tryCatchPattern":null,"preventionTips":["Use only all/secret/plain","Omit --kind to take the default (all)","Check `--help` for the accepted enum values"],"tags":["cli","secrets","validation","enum","input"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}