paperclipai/paperclip · error · Error

Invalid --kind value. Use: all, secret, plain

Error message

Invalid --kind value. Use: all, secret, plain

What it means

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.

Source

Thrown at cli/src/commands/client/secrets.ts:398

        } catch (err) {
          handleCommandError(err);
        }
      }),
  );

  addCommonClientOptions(
    secrets
      .command("declarations")
      .description("List portable env declarations emitted by company export")
      .requiredOption("-C, --company-id <id>", "Company ID")
      .option("--include <values>", "Comma-separated include set: company,agents,projects,issues,tasks,skills", "company,agents,projects")
      .option("--kind <kind>", "Filter declarations: all | secret | plain", "all")
      .action(async (opts: SecretDeclarationsOptions) => {
        try {
          const ctx = resolveCommandContext(opts, { requireCompany: true });
          const kind = opts.kind ?? "all";
          if (!["all", "secret", "plain"].includes(kind)) {
            throw new Error("Invalid --kind value. Use: all, secret, plain");
          }
          const preview = await ctx.api.post<CompanyPortabilityExportPreviewResult>(
            apiPath`/api/companies/${ctx.companyId}/exports/preview`,
            { include: parseSecretsInclude(opts.include) },
          );
          const declarations = (preview?.manifest.envInputs ?? [])
            .filter((entry) => kind === "all" || entry.kind === kind);
          printOutput(ctx.json ? declarations : declarations.map(renderDeclaration), { json: ctx.json });
        } catch (err) {
          handleCommandError(err);
        }
      }),
  );

  addCommonClientOptions(
    secrets
      .command("create")
      .description("Create a Paperclip-managed secret")

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Use one of: `all`, `secret`, or `plain`
  2. Omit `--kind` to accept the default (`all`)
  3. Run `paperclipai secrets declarations --help` to confirm the accepted values

Example fix

# before
paperclipai secrets declarations -C comp-1 --kind secrets
# after
paperclipai secrets declarations -C comp-1 --kind secret
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED_KIND = new Set(["all", "secret", "plain"]);
function validateKind(kind: string | undefined): "all" | "secret" | "plain" {
  const k = kind ?? "all";
  if (!ALLOWED_KIND.has(k)) throw new Error(`Invalid --kind '${k}'. Use: all, secret, plain`);
  return k as "all" | "secret" | "plain";
}

Type guard

const KINDS = ["all", "secret", "plain"] as const;
type DeclarationKind = typeof KINDS[number];
function isDeclarationKind(v: unknown): v is DeclarationKind {
  return typeof v === "string" && (KINDS as readonly string[]).includes(v);
}

Prevention

When it happens

Trigger: Passing `--kind foo`, `--kind secrets` (wrong plural), or any value outside all/secret/plain to `paperclipai secrets declarations`.

Common situations: Typo; guessing the allowed values instead of reading the help; using `secrets` (plural) or `plaintext` instead of `secret`/`plain`.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/2c3567fc64c83e93. Report an issue: GitHub.