jackwener/OpenCLI · error · ArgumentError
nothing to update
Error message
nothing to update
What it means
Thrown in clis/pinterest/pin-update.js:34 when a pin-update invocation supplies no updatable field: title is empty, description/link are undefined, and no --board is given. The command refuses to issue a no-op API call, and the remediation hint lists the accepted fields.
Source
Thrown at clis/pinterest/pin-update.js:34
// No default: an omitted flag stays undefined, so `--description ""` can clear the field.
{ name: 'description', type: 'string', help: 'New pin description (pass "" to clear)' },
// Pinterest refuses link edits on scraped pins ("你沒有變更此連結的權限"), so this only
// works on pins whose link you own.
{ name: 'link', type: 'string', help: 'New destination link (pass "" to clear)' },
{ name: 'board', type: 'string', default: '', help: 'Move the pin to this board: <username>/<slug>, board URL, or board id' },
{ name: 'section', type: 'string', default: '', help: 'Move the pin to this board section id or slug (requires --board)' },
],
columns: ['pinId', 'title', 'board', 'url'],
func: async (page, kwargs) => {
const id = parsePinId(kwargs.pin);
const title = String(kwargs.title ?? '').trim();
const description = kwargs.description === undefined ? undefined : String(kwargs.description).trim();
const link = kwargs.link === undefined ? undefined : String(kwargs.link).trim();
const boardRef = String(kwargs.board ?? '').trim();
const section = String(kwargs.section ?? '').trim();
if (!title && description === undefined && link === undefined && !boardRef) {
throw new ArgumentError(
'nothing to update',
'Pass at least one of --title, --description, --link, or --board',
);
}
if (section && !boardRef) {
throw new ArgumentError('--section requires --board', 'Sections belong to a board, so pass --board too');
}
const options = { id };
let sourceUrl = `/pin/${id}/`;
if (boardRef) {
const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, boardRef);
await page.goto(`${PINTEREST_BASE}${path}`);
const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);
options.board_id = boardId;
// PinResource/update is the only endpoint that honours a section, and only under this key.
if (section) options.board_section_id = (await resolveSection(page, boardId, section, path)).sectionId;View on GitHub (pinned to 49907e53dc)
Solutions
- Pass at least one of --title, --description, --link, or --board
- Check flag spelling — a mistyped flag (e.g. --tittle) is silently ignored and triggers this error
- Avoid whitespace-only values; pass real content or omit the flag entirely
- If you only meant to inspect the pin, use the `pin` get command instead of pin-update
Example fix
// before $ opencli pinterest pin-update 1234567890 // ArgumentError: nothing to update // after $ opencli pinterest pin-update 1234567890 --title "New title"
Defensive patterns
Strategy: validation
Validate before calling
const fields = { title, description, link, board };
if (Object.values(fields).every(v => v === undefined || String(v).trim() === '')) {
throw new Error('pin-update needs at least one of --title, --description, --link, --board');
} Try / catch
try {
await run(['pin-update', pinId, ...fieldArgs]);
} catch (e) {
if (/nothing to update/.test(e.message)) {
throw new Error('No updatable fields were provided — check flag names and values');
}
throw e;
} Prevention
- Build update commands programmatically from a fields object so at least one is always set
- Check flag spelling — mistyped flags are silently dropped, leaving nothing to update
- Trim values beforehand and omit flags whose content is empty
- Use pin (read) instead of pin-update when you only need to inspect
When it happens
Trigger: Calling `pin-update <id>` with none of --title, --description, --link, --board; or passing values that trim to empty strings (e.g. --title " ") so the guard `!title && description === undefined && link === undefined && !boardRef` is true.
Common situations: Script templates with all field placeholders left empty; whitespace-only argument values; a wrapper that strips undefined/empty kwargs before forwarding, leaving nothing to update; typos in flag names (e.g. --titel) so the intended field never reaches kwargs.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- image URL must be http(s): ${value}
- --section requires --board
- --section requires --board
- archive search sort must be one of ${SORT_OPTIONS.join(', ')
- archive search mediatype must be one of ${MEDIATYPES.join(',
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/584c7fdb2b7d1fac.
Report an issue: GitHub.