Skip to content

feat: add tags CLI command (API parity)#82

Merged
callumreid merged 3 commits into
mainfrom
feat/cli-api-parity-tags
Jul 2, 2026
Merged

feat: add tags CLI command (API parity)#82
callumreid merged 3 commits into
mainfrom
feat/cli-api-parity-tags

Conversation

@callumreid

@callumreid callumreid commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the coval tags command to the CLI, bringing it to parity with the /v1/tags API endpoints.

What's New

  • coval tags list — list all tags
  • coval tags get <id> — get a tag by ID
  • coval tags create --tag-name <name> [--color <hex>] — create a tag
  • coval tags update <id> [--tag-name <name>] [--color <hex>] — update a tag
  • coval tags delete <id> — delete a tag

Files Changed

  • src/client/models/tag.rs — Tag model with Tabular impl, request/response structs
  • src/commands/tags.rs — TagCommands with full CRUD
  • src/client/mod.rs — TagsClient with list/get/create/update/delete
  • src/client/models/mod.rs — registered tag module
  • src/commands/mod.rs — registered tags module
  • src/cli.rs — wired Tags command

Verification

All operations tested against Coval API (cal-demo org):

$ coval tags create --tag-name cli-test --color "#FF0000"
# → {"id":"jMA83h8YNfLmYQoTMEk54T","tag_name":"cli-test","color":"#FF0000"}

$ coval tags get jMA83h8YNfLmYQoTMEk54T
# → Returns tag JSON

$ coval tags update jMA83h8YNfLmYQoTMEk54T --color "#00FF00"
# → {"color":"#00FF00"}

$ coval tags list
# → Table with 80+ tags shown

$ coval tags delete jMA83h8YNfLmYQoTMEk54T
# → "Tag deleted."
  • cargo build — passes
  • cargo clippy — clean
  • cargo test — 90/90 pass

Greptile Summary

This PR adds a coval tags command that brings the CLI to parity with the /v1/tags REST API, implementing full CRUD operations (list, get, create, update, delete) following the same structure used by every other resource command in the codebase.

  • New files: src/client/models/tag.rs defines the Tag model with a Tabular impl (all five fields rendered in the table), plus request/response structs. src/commands/tags.rs implements TagCommands with the input_json pattern shared across the project.
  • Wiring: src/client/mod.rs gains TagsClient, and src/cli.rs / src/commands/mod.rs / src/client/models/mod.rs are updated to register the new module — all consistent with how prior resource commands were added.
  • Validation: The update path correctly guards against a no-op empty PATCH with anyhow::ensure!(!input.is_empty(), …), and .worktrees/ has been added to .gitignore.

Confidence Score: 5/5

Safe to merge — the changes are additive and follow established patterns throughout the codebase.

The new tags command is a straightforward structural addition that mirrors how every other resource command is wired in this project. The client methods, model structs, and command dispatch all follow the existing conventions exactly. The update path has an explicit guard against empty PATCH bodies, .worktrees/ is now gitignored, and the Tag model's Tabular impl exposes all five fields. No logic was changed in existing paths.

No files require special attention.

Reviews (3): Last reviewed commit: "fix: address review comments" | Re-trigger Greptile

Adds the tags resource to the CLI with full CRUD support:
- tags list
- tags get <id>
- tags create --tag-name <name> [--color <hex>]
- tags update <id> [--tag-name <name>] [--color <hex>]
- tags delete <id>

Verified working against API with all operations.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@callumreid, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50828b8e-7e60-4b50-84e1-c9634f6880dd

📥 Commits

Reviewing files that changed from the base of the PR and between 61d1d1d and 17399f7.

📒 Files selected for processing (7)
  • .gitignore
  • src/cli.rs
  • src/client/mod.rs
  • src/client/models/mod.rs
  • src/client/models/tag.rs
  • src/commands/mod.rs
  • src/commands/tags.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/client/models/tag.rs
Comment thread src/commands/tags.rs
Comment thread src/commands/tags.rs Outdated
Comment thread src/client/models/tag.rs Outdated
Comment thread .worktrees/cli-parity Outdated
@callumreid

Copy link
Copy Markdown
Contributor Author

🟢

@borgesius borgesius left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks reasonable. The tags client/commands line up with the v1 API shape and the update guard prevents empty PATCHes.

@callumreid callumreid merged commit 40f3bb3 into main Jul 2, 2026
8 checks passed
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.

2 participants