{"record":{"id":"35e5e8a94e720aef","repo":"actualbudget/actual","slug":"no-update-fields-provided-use-name-or-hidden","errorCode":null,"errorMessage":"No update fields provided. Use --name or --hidden.","messagePattern":"No update fields provided\\. Use --name or --hidden\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/categories.ts","lineNumber":66,"sourceCode":"          printOutput({ id }, opts.format);\n        },\n        { mutates: true },\n      );\n    });\n\n  categories\n    .command('update <id>')\n    .description('Update a category')\n    .option('--name <name>', 'New category name')\n    .option('--hidden <bool>', 'Set hidden status')\n    .action(async (id: string, cmdOpts) => {\n      const fields: Record<string, unknown> = {};\n      if (cmdOpts.name !== undefined) fields.name = cmdOpts.name;\n      if (cmdOpts.hidden !== undefined) {\n        fields.hidden = parseBoolFlag(cmdOpts.hidden, '--hidden');\n      }\n      if (Object.keys(fields).length === 0) {\n        throw new Error('No update fields provided. Use --name or --hidden.');\n      }\n      const opts = program.opts();\n      await withConnection(\n        opts,\n        async () => {\n          await api.updateCategory(id, fields);\n          printOutput({ success: true, id }, opts.format);\n        },\n        { mutates: true },\n      );\n    });\n\n  categories\n    .command('delete <id>')\n    .description('Delete a category')\n    .option('--transfer-to <id>', 'Transfer transactions to this category')\n    .action(async (id: string, cmdOpts) => {\n      const opts = program.opts();","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/cli/src/commands/categories.ts#L48-L84","documentation":"The categories CLI `update` command requires at least one field. If neither --name nor --hidden is given, the fields object is empty and the command throws before contacting the API, avoiding a no-op update of a category.","triggerScenarios":"Running `actual-cli categories update <id>` with no flags; typos such as --hide or --title that don't match the defined options; building flags dynamically in a script but producing an empty list.","commonSituations":"Batch scripts that skip flags when their variables are unset; users confusing categories with category-groups commands and using the wrong subcommand's flags; copy-pasted examples missing the flags.","solutions":["Supply at least one flag: `categories update <id> --name \"Groceries\"` or `--hidden true`.","Check flag spelling against the command help (`categories update --help`).","Confirm you are using the intended subcommand (categories vs category-groups)."],"exampleFix":"// before\nactual categories update cat_123\n// after\nactual categories update cat_123 --hidden true","handlingStrategy":"validation","validationCode":"const flags: string[] = [];\nif (name) flags.push('--name', name);\nif (typeof hidden === 'boolean') flags.push('--hidden', String(hidden));\nif (flags.length === 0) throw new Error('Nothing to update: pass --name and/or --hidden');","typeGuard":"null","tryCatchPattern":"try {\n  await runCli(['categories', 'update', id, ...flags]);\n} catch (e) {\n  if (String(e.message).includes('No update fields provided')) {\n    console.warn('No category fields to update; skipping', id);\n  } else throw e;\n}","preventionTips":["Only invoke update when at least one field value is present.","Verify subcommand and flags via --help (categories vs category-groups).","In batch scripts, skip entries with no changes instead of calling update.","Log argv to catch silently-dropped empty variables."],"tags":["cli","validation","arguments","categories"],"backgroundTag":"invalid-command-argument","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}