paperclipai/paperclip · warning · Error

Deletion requires --yes.

Error message

Deletion requires --yes.

What it means

The `project delete` CLI command refuses to delete a project unless the `--yes` confirmation flag is present. The flag is declared as an optional Commander option (no default), so Commander itself does not enforce it; the action handler throws this error before any API call is made. The thrown error is caught by the surrounding try/catch and routed to handleCommandError, which prints it in red and exits the process with code 1.

Source

Thrown at cli/src/commands/client/project.ts:197

          const updated = await ctx.api.patch<Project>(`${apiPath`/api/projects/${projectRef}`}${query}`, payload);
          printOutput(updated, { json: ctx.json });
        } catch (err) {
          handleCommandError(err);
        }
      }),
    { includeCompany: false },
  );

  addCommonClientOptions(
    project
      .command("delete")
      .description("Delete a project")
      .argument("<project>", "Project ID or shortname")
      .option("-C, --company-id <id>", "Company ID for shortname lookup")
      .option("--yes", "Confirm deletion")
      .action(async (projectRef: string, opts: ProjectDeleteOptions) => {
        try {
          if (!opts.yes) throw new Error("Deletion requires --yes.");
          const ctx = resolveCommandContext(opts);
          const query = ctx.companyId ? `?${new URLSearchParams({ companyId: ctx.companyId }).toString()}` : "";
          const deleted = await ctx.api.delete<Project>(`${apiPath`/api/projects/${projectRef}`}${query}`);
          printOutput(deleted, { json: ctx.json });
        } catch (err) {
          handleCommandError(err);
        }
      }),
    { includeCompany: false },
  );
}

function parseCsv(value: string | undefined): string[] | undefined {
  if (value === undefined) return undefined;
  return value.split(",").map((part) => part.trim()).filter(Boolean);
}

function parseNullableString(value: string | undefined): string | null | undefined {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Append `--yes` to the invocation: `paperclipai project delete <projectRef> --yes`
  2. If resolving by shortname, also pass `-C <companyId>` together with `--yes`
  3. In automation scripts, set the flag explicitly in the command array rather than expecting a prompt

Example fix

# before
paperclipai project delete acme-website
# after
paperclipai project delete acme-website --yes
Defensive patterns

Strategy: validation

Validate before calling

// Before invoking the delete action programmatically
function assertDeleteConfirmed(opts: { yes?: boolean }): void {
  if (!opts.yes) {
    throw new Error("Refusing to delete without explicit --yes confirmation.");
  }
}
assertDeleteConfirmed(opts);

Type guard

function isDeleteConfirmed(opts: unknown): opts is { yes: true } {
  return typeof opts === "object" && opts !== null && (opts as any).yes === true;
}

Prevention

When it happens

Trigger: Running `paperclipai project delete <projectRef>` (or the namespaced subcommand path that registers this action) without appending `--yes`. Also produced by shell aliases, Makefile targets, or CI scripts that wrap the delete invocation but omit the flag.

Common situations: Automation/CI pipelines copied from a non-destructive command variant that dropped --yes; muscle memory from commands that prompt interactively (this one does not); aliases that strip unknown flags.

Related errors


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