paperclipai/paperclip · error · Error

Deletion requires --confirm <value> where value matches the

Error message

Deletion requires --confirm <value> where value matches the company ID or issue prefix.

What it means

Thrown by assertDeleteConfirmation when --yes is set but --confirm is missing or whitespace-only. Deletion requires a typed acknowledgement whose value matches the target company id or issue prefix, proving the operator knows exactly which company will be destroyed.

Source

Thrown at cli/src/commands/client/company.ts:1320

    );
  }

  if (idMatch) return idMatch;
  if (prefixMatch) return prefixMatch;

  throw new Error(
    `No company found for selector '${selector}'. Use company ID or issue prefix (for example PAP).`,
  );
}

export function assertDeleteConfirmation(company: Company, opts: CompanyDeleteOptions): void {
  if (!opts.yes) {
    throw new Error("Deletion requires --yes.");
  }

  const confirm = opts.confirm?.trim();
  if (!confirm) {
    throw new Error(
      "Deletion requires --confirm <value> where value matches the company ID or issue prefix.",
    );
  }

  const confirmsById = confirm === company.id;
  const confirmsByPrefix = confirm.toUpperCase() === company.issuePrefix.toUpperCase();
  if (!confirmsById && !confirmsByPrefix) {
    throw new Error(
      `Confirmation '${confirm}' does not match target company. Expected ID '${company.id}' or prefix '${company.issuePrefix}'.`,
    );
  }
}

function assertDeleteFlags(opts: CompanyDeleteOptions): void {
  if (!opts.yes) {
    throw new Error("Deletion requires --yes.");
  }
  if (!opts.confirm?.trim()) {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Add --confirm <company-id-or-prefix> matching the target.
  2. Copy the value from 'paperclipai company list' to guarantee it matches.
  3. In code, populate opts.confirm with company.id or company.issuePrefix before calling assertDeleteConfirmation.
  4. Re-read the command help to confirm the expected --confirm semantics.

Example fix

# before
paperclipai company delete PAP --yes
# after
paperclipai company delete PAP --yes --confirm PAP
Defensive patterns

Strategy: validation

Validate before calling

function requireDeleteConfirm(opts: { confirm?: string }): void {
  if (!opts.confirm?.trim()) {
    throw new Error("Deletion requires --confirm <company-id-or-prefix>.");
  }
}

Type guard

function deleteConfirmPresent(opts: { confirm?: string }): boolean {
  return typeof opts.confirm === "string" && opts.confirm.trim().length > 0;
}

Prevention

When it happens

Trigger: Running 'paperclipai company delete <sel> --yes' without --confirm. Passing --confirm '' or only spaces. A script that sets yes:true but leaves confirm unset on CompanyDeleteOptions.

Common situations: Operator assumes --yes is enough. Script forwards --yes but not --confirm. Confusion about which value --confirm expects (it must be the id or prefix, not 'yes' or 'true').

Related errors


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