jackwener/OpenCLI · error · ArgumentError

Refusing to delete pin ${row.pinId}${row.title ? ` "${row.ti

Error message

Refusing to delete pin ${row.pinId}${row.title ? ` "${row.title}"` : ''}${row.board ? ` from board "${row.board}"` : ''} without --confirm

What it means

This ArgumentError is thrown in clis/pinterest/pin-delete.js:42 when a delete is attempted without kwargs.confirm === true. Deleting a pin is irreversible, so the command deliberately requires an explicit --confirm flag before calling pinterestResourceDelete, and the message includes the pin id/title/board so you know exactly what would be deleted.

Source

Thrown at clis/pinterest/pin-delete.js:42

    const { data: pin } = await pinterestResourceFetch(
      page,
      'PinResource',
      { id, field_set_key: 'detailed' },
      sourceUrl,
    );
    if (!pin || !pin.id) {
      throw new CommandExecutionError(`Could not resolve pin "${id}" (does it exist and do you own it?)`);
    }

    const row = {
      pinId: String(pin.id),
      title: (pin.title || pin.grid_title || '').trim(),
      board: (pin.board && pin.board.name) || '',
      deleted: false,
    };

    if (kwargs.confirm !== true) {
      throw new ArgumentError(
        `Refusing to delete pin ${row.pinId}${row.title ? ` "${row.title}"` : ''}${row.board ? ` from board "${row.board}"` : ''} without --confirm`,
        'Re-run with --confirm once you are sure; deleting a pin cannot be undone',
      );
    }

    await pinterestResourceDelete(page, 'PinResource', { id: row.pinId }, sourceUrl);
    return [{ ...row, deleted: true }];
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-run the command adding the --confirm flag once you are sure: `pin-delete <pinId> --confirm`
  2. If scripting, pass confirm: true in kwargs programmatically
  3. If a wrapper drops the flag, fix the wrapper to forward --confirm
  4. Double-check the pin id/title shown in the message is the pin you intend to delete — the operation cannot be undone

Example fix

// before
$ opencli pinterest pin-delete 1234567890
// ArgumentError: Refusing to delete pin ... without --confirm
// after
$ opencli pinterest pin-delete 1234567890 --confirm
Defensive patterns

Strategy: validation

Validate before calling

const args = ['pin-delete', pinId];
if (confirm !== true) throw new Error('pin-delete requires explicit confirm: true');
args.push('--confirm');

Try / catch

try {
  await run(['pin-delete', pinId, '--confirm']);
} catch (e) {
  if (/without --confirm/.test(e.message)) {
    console.warn(`Confirm flag missing; delete of ${pinId} skipped`);
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `pin-delete <pinId>` (or an automation/script invoking the command) without the `--confirm` flag, or with a value that isn't strictly boolean true (e.g. --confirm=false).

Common situations: First-time interactive use where the user forgot the flag; scheduled scripts written before the confirm requirement was added; wrappers that forward kwargs but drop boolean flags; piping commands where the confirmation arg got lost.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/01b291e932fd16f0. Report an issue: GitHub.