{"record":{"id":"3dff2b680fec31ec","repo":"actualbudget/actual","slug":"no-update-fields-provided-use-name-or-offbudg","errorCode":null,"errorMessage":"No update fields provided. Use --name or --offbudget.","messagePattern":"No update fields provided\\. Use --name or --offbudget\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/accounts.ts","lineNumber":88,"sourceCode":"    .command('update <id>')\n    .description('Update an account')\n    .option('--name <name>', 'New account name')\n    .option('--offbudget <bool>', 'Set off-budget status')\n    .action(async (id: string, cmdOpts) => {\n      const opts = program.opts();\n      const fields: Record<string, unknown> = {};\n      if (cmdOpts.name !== undefined) {\n        const trimmed = cmdOpts.name.trim();\n        if (trimmed === '') {\n          throw new Error('Invalid --name: must be a non-empty string.');\n        }\n        fields.name = trimmed;\n      }\n      if (cmdOpts.offbudget !== undefined) {\n        fields.offbudget = parseBoolFlag(cmdOpts.offbudget, '--offbudget');\n      }\n      if (Object.keys(fields).length === 0) {\n        throw new Error(\n          'No update fields provided. Use --name or --offbudget.',\n        );\n      }\n      await withConnection(\n        opts,\n        async () => {\n          await api.updateAccount(id, fields);\n          printOutput({ success: true, id }, opts.format);\n        },\n        { mutates: true },\n      );\n    });\n\n  accounts\n    .command('close <id>')\n    .description('Close an account')\n    .option(\n      '--transfer-account <id>',","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/cli/src/commands/accounts.ts#L70-L106","documentation":"The accounts CLI `update` command requires at least one field to change. If neither --name nor --offbudget is supplied, the fields object is empty and the command throws instead of issuing a pointless API call.","triggerScenarios":"Running `actual-cli accounts update <id>` with no flags, or with flags whose values were undefined due to shell expansion mistakes (e.g. --name \"$EMPTY_VAR\" not passed because the var was unset and quoted args dropped).","commonSituations":"Automated scripts that conditionally build flag arrays but end up passing none; typos like --naem or --off-budget that commander treats as unknown (or are silently dropped in loose setups); calling update when the actual intent was `accounts get`.","solutions":["Provide at least one update flag: `accounts update <id> --name \"Savings\"` or `--offbudget true`.","Verify flag spelling matches the command's --name / --offbudget options.","If no change is needed, don't call update — or use `accounts list`/`get` to inspect."],"exampleFix":"// before\nactual accounts update acct_123\n// after\nactual accounts update acct_123 --name \"Emergency Fund\" --offbudget false","handlingStrategy":"validation","validationCode":"const flags: string[] = [];\nif (name) flags.push('--name', name);\nif (typeof offbudget === 'boolean') flags.push('--offbudget', String(offbudget));\nif (flags.length === 0) throw new Error('Nothing to update: pass --name and/or --offbudget');","typeGuard":"null","tryCatchPattern":"try {\n  await runCli(['accounts', 'update', id, ...flags]);\n} catch (e) {\n  if (String(e.message).includes('No update fields provided')) {\n    console.error('Skipped: no fields to update for account', id);\n  } else throw e;\n}","preventionTips":["Build flag arrays conditionally and assert non-empty before invoking.","Double-check option spelling with the command's --help output.","Use accounts list/get when the intent is inspection, not update.","Log the exact argv in scripts to catch dropped/empty flags."],"tags":["cli","validation","arguments","accounts"],"backgroundTag":"invalid-command-argument","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}