Skip to content

feat(gmail): add labels style command to change label colors#457

Open
iskw9973 wants to merge 1 commit intosteipete:mainfrom
iskw9973:feat/gmail-labels-style
Open

feat(gmail): add labels style command to change label colors#457
iskw9973 wants to merge 1 commit intosteipete:mainfrom
iskw9973:feat/gmail-labels-style

Conversation

@iskw9973
Copy link

@iskw9973 iskw9973 commented Mar 17, 2026

Summary

Adds a new gog gmail labels style command to change label background and text colors via Labels.Patch API.

Closes #456

Usage

gog gmail labels style <labelIdOrName> --background-color "#16a765" --text-color "#ffffff"
  • Both --background-color and --text-color are required (Gmail API requires both)
  • Colors must be from the predefined palette
  • System labels are blocked, consistent with rename/delete
  • Supports label resolution by name or ID (same pattern as rename/delete)
  • Dry-run (--dry-run) and JSON output (--json) supported

Changes

  • internal/cmd/gmail_labels.go — added GmailLabelsStyleCmd struct and Run method
  • internal/cmd/gmail_labels_style_cmd_test.go — 6 test cases (exact ID, name fallback, system label blocked, not found, missing both colors, missing one color)
  • README.md — added labels style to docs

Test plan

  • make test — all packages pass
  • Tested against live Gmail account with multiple color combinations

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.

Add labels style command to change Gmail label colors

1 participant