actualbudget/actual · error · Error

No update fields provided. Use --name or --hidden.

Error message

No update fields provided. Use --name or --hidden.

What it means

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.

Source

Thrown at packages/cli/src/commands/categories.ts:66

          printOutput({ id }, opts.format);
        },
        { mutates: true },
      );
    });

  categories
    .command('update <id>')
    .description('Update a category')
    .option('--name <name>', 'New category name')
    .option('--hidden <bool>', 'Set hidden status')
    .action(async (id: string, cmdOpts) => {
      const fields: Record<string, unknown> = {};
      if (cmdOpts.name !== undefined) fields.name = cmdOpts.name;
      if (cmdOpts.hidden !== undefined) {
        fields.hidden = parseBoolFlag(cmdOpts.hidden, '--hidden');
      }
      if (Object.keys(fields).length === 0) {
        throw new Error('No update fields provided. Use --name or --hidden.');
      }
      const opts = program.opts();
      await withConnection(
        opts,
        async () => {
          await api.updateCategory(id, fields);
          printOutput({ success: true, id }, opts.format);
        },
        { mutates: true },
      );
    });

  categories
    .command('delete <id>')
    .description('Delete a category')
    .option('--transfer-to <id>', 'Transfer transactions to this category')
    .action(async (id: string, cmdOpts) => {
      const opts = program.opts();

View on GitHub (pinned to d4334cb6e6)

Solutions

  1. Supply at least one flag: `categories update <id> --name "Groceries"` or `--hidden true`.
  2. Check flag spelling against the command help (`categories update --help`).
  3. Confirm you are using the intended subcommand (categories vs category-groups).

Example fix

// before
actual categories update cat_123
// after
actual categories update cat_123 --hidden true
Defensive patterns

Strategy: validation

Validate before calling

const flags: string[] = [];
if (name) flags.push('--name', name);
if (typeof hidden === 'boolean') flags.push('--hidden', String(hidden));
if (flags.length === 0) throw new Error('Nothing to update: pass --name and/or --hidden');

Type guard

null

Try / catch

try {
  await runCli(['categories', 'update', id, ...flags]);
} catch (e) {
  if (String(e.message).includes('No update fields provided')) {
    console.warn('No category fields to update; skipping', id);
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of actualbudget/actual@d4334cb6e6 (2026-08-29). Data as JSON: /api/errors/35e5e8a94e720aef. Report an issue: GitHub.