Skip to content

Conversation

@jcorrego
Copy link

This PR adds the ability to update category details using the YNAB API.

Changes

  • Add updateCategory method to API client
  • Add categories update command with options for:
    • --name: Update category name
    • --note: Update category note
    • --category-group-id: Move category to different group
    • --goal-target: Update goal target amount (in dollars)
  • Update README with new command documentation

Usage Examples

# Update category name
ynab categories update <category-id> --name "New Name"

# Update category note
ynab categories update <category-id> --note "Updated note"

# Move to different category group
ynab categories update <category-id> --category-group-id <group-id>

# Update goal target
ynab categories update <category-id> --goal-target 1000

# Update multiple fields at once
ynab categories update <category-id> --name "Groceries" --note "Monthly budget" --goal-target 500

All code passes TypeScript type checking and linting.

- Add updateCategory method to API client
- Add 'categories update' command with options for name, note, category group, and goal target
- Update README with new command documentation
- Support updating category name, note, moving to different group, and modifying goal target
- Amounts are specified in dollars and converted to milliunits automatically
Copilot AI review requested due to automatic review settings January 28, 2026 18:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for updating category details (name, note, group, goal target) via the YNAB API, exposed through a new ynab categories update CLI command.

Changes:

  • Added updateCategory to the YnabClient API wrapper.
  • Added categories update command with flags for name/note/group/goal target updates and input validation.
  • Documented the new command in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/lib/api-client.ts Adds an API client wrapper method for PATCHing category updates via YNAB.
src/commands/categories.ts Introduces the categories update CLI command and constructs the PATCH payload from provided flags.
README.md Adds the categories update command to the command list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Fix validation to use !== undefined checks instead of falsy checks
- Reject empty/whitespace category names instead of converting to null
- Update README to show optional flags with brackets
@jcorrego
Copy link
Author

@stephendolan Comments have been addressed. Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant