jackwener/OpenCLI · error · ArgumentError

nothing to update

Error message

nothing to update

What it means

The board-update command requires at least one of --name, --description, or --privacy to be provided. If all are absent (or empty after trimming), it raises ArgumentError('nothing to update') with the hint 'Pass at least one of --name, --description, or --privacy' before touching the page.

Source

Thrown at clis/pinterest/board-update.js:32

  strategy: Strategy.COOKIE,
  args: [
    { name: 'board', type: 'string', positional: true, required: true, help: '<username>/<slug>, a board URL, or a numeric board id, e.g. janedoe/my-board' },
    { name: 'name', type: 'string', default: '', help: 'New board name' },
    { name: 'description', type: 'string', help: 'New board description (pass "" to clear)' },
    { name: 'privacy', type: 'string', choices: PRIVACY, help: 'New privacy: public or secret' },
  ],
  columns: ['boardId', 'name', 'privacy', 'url'],
  func: async (page, kwargs) => {
    const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, kwargs.board);
    const name = String(kwargs.name ?? '').trim();
    const description = kwargs.description === undefined ? undefined : String(kwargs.description).trim();
    const privacy = String(kwargs.privacy ?? '').trim();

    if (privacy && !PRIVACY.includes(privacy)) {
      throw new ArgumentError(`Unknown privacy "${privacy}". Valid: ${PRIVACY.join(', ')}`);
    }
    if (!name && description === undefined && !privacy) {
      throw new ArgumentError(
        'nothing to update',
        'Pass at least one of --name, --description, or --privacy',
      );
    }

    await page.goto(`${PINTEREST_BASE}${path}`);
    const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);

    const options = { board_id: boardId };
    if (name) options.name = name;
    if (description !== undefined) options.description = description;
    if (privacy) options.privacy = privacy;

    const updated = await pinterestResourceUpdate(page, 'BoardResource', options, path);

    return [{
      boardId,
      name: (updated && updated.name) || name,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Pass at least one of --name, --description, or --privacy with a non-empty value.
  2. Check that shell variables feeding the flags are non-empty.
  3. Skip the command entirely when no changes are needed instead of calling it with no fields.
  4. Guard in your wrapper: build the kwargs object and only invoke when Object.keys(kwargs).length > 0.

Example fix

// before
await cli.boardUpdate('user/board', { name: '' });
// after
await cli.boardUpdate('user/board', { name: 'New board name' });
Defensive patterns

Strategy: validation

Validate before calling

const updates = {};
if (name) updates.name = name;
if (description) updates.description = description;
if (privacy) updates.privacy = privacy;
if (Object.keys(updates).length === 0) return; // nothing to do, skip the call

Type guard

function hasUpdate(u) {
  return Boolean(u && (u.name?.trim() || u.description?.trim() || u.privacy?.trim()));
}

Try / catch

try {
  await cli.boardUpdate(board, updates);
} catch (e) {
  if (/nothing to update/.test(e.message)) console.warn('skipped: no fields given');
  else throw e;
}

Prevention

When it happens

Trigger: Calling `pinterest board-update <board>` with no field flags, or where the supplied values are empty/whitespace strings that get trimmed to nothing (e.g. --name "").

Common situations: Templated scripts where variables expand to empty strings; copy-pasted commands missing flags; wrappers that forward kwargs but drop falsy values.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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