paperclipai/paperclip · warning · Error
Deletion requires --yes.
Error message
Deletion requires --yes.
What it means
The `secrets delete` command requires the `--yes` safety flag (default false) before it will call the delete API. The guard is identical in shape to the project delete guard: the flag is optional so Commander does not enforce it, and the action throws on a missing flag. This is the first of two confirmations for secret deletion.
Source
Thrown at cli/src/commands/client/secrets.ts:543
try {
const ctx = resolveCommandContext(opts);
printOutput(await ctx.api.get(apiPath`/api/secrets/${secretId}/access-events`), { json: ctx.json });
} catch (err) {
handleCommandError(err);
}
}),
);
addCommonClientOptions(
secrets
.command("delete")
.description("Delete a secret")
.argument("<secretId>", "Secret ID")
.option("--yes", "Required safety flag to confirm destructive action", false)
.option("--confirm <secretId>", "Repeat the secret ID to confirm deletion")
.action(async (secretId: string, opts: SecretDeleteOptions) => {
try {
if (!opts.yes) throw new Error("Deletion requires --yes.");
if (opts.confirm !== secretId) {
throw new Error("Deletion requires --confirm <secretId> matching the secret ID.");
}
const ctx = resolveCommandContext(opts);
printOutput(await ctx.api.delete(apiPath`/api/secrets/${secretId}`), { json: ctx.json });
} catch (err) {
handleCommandError(err);
}
}),
);
addCommonClientOptions(
secrets
.command("doctor")
.description("Run secret provider health checks through the Paperclip API")
.requiredOption("-C, --company-id <id>", "Company ID")
.action(async (opts: SecretDoctorOptions) => {
try {View on GitHub (pinned to 67001ec6eb)
Solutions
- Add `--yes` to the command: `paperclipai secrets delete <secretId> --yes`
- Also pass `--confirm <secretId>` (see error 97), which is the second required confirmation
- In scripts, set both flags explicitly rather than relying on a prompt
Example fix
# before paperclipai secrets delete sec_01H... # after paperclipai secrets delete sec_01H... --yes --confirm sec_01H...
Defensive patterns
Strategy: validation
Validate before calling
function assertSecretDeleteConfirmed(opts: { yes?: boolean; confirm?: string }, secretId: string): void {
if (!opts.yes) throw new Error("Deletion requires --yes.");
if (opts.confirm !== secretId) throw new Error("Deletion requires --confirm <secretId> matching the secret ID.");
}
assertSecretDeleteConfirmed(opts, secretId); Type guard
function isSecretDeleteReady(opts: unknown, secretId: string): opts is { yes: true; confirm: string } {
return typeof opts === "object" && opts !== null && (opts as any).yes === true && (opts as any).confirm === secretId;
} Prevention
- Always pass both --yes and --confirm <id> in delete scripts
- Use a single variable for the id, the argument, and --confirm
- Never expect an interactive confirmation prompt
When it happens
Trigger: Running `paperclipai secrets delete <secretId>` without `--yes`.
Common situations: Automation/aliases that drop the flag; expecting an interactive prompt (none exists); copy-paste from a docs example that omitted the flag.
Related errors
- Deletion requires --yes.
- Deletion requires --confirm <secretId> matching the secret I
- Environment variable ${envName} is empty or not set.
- Challenge secret is required. Pass --token or --token-env.
- Deletion requires --yes.
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/7f46f018ad0c12a6.
Report an issue: GitHub.