feat: add tab management commands#108
Conversation
…ands Adds tab management commands for content types: - `add-tab` creates a new tab, optionally with a slice zone - `edit-tab` renames a tab and/or adds/removes a slice zone - `remove-tab` deletes a tab (guards against removing the last one) Closes #94 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-zone flags Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ed9e012. Configure here.
| if ("name" in values) { | ||
| if (values.name! in type.json) { | ||
| throw new CommandError(`Tab "${values.name}" already exists in "${typeName}".`); | ||
| } |
There was a problem hiding this comment.
Tab rename to same name incorrectly throws error
Medium Severity
When --name is the same as currentName (the positional argument), the check values.name! in type.json evaluates to true because the current tab already exists under that key. This causes a spurious "Tab already exists" error instead of treating it as a no-op. It also prevents combining --name with --with-slice-zone or --without-slice-zone in that scenario — the slice-zone mutation happens first (in memory), then gets discarded when the rename check throws.
Reviewed by Cursor Bugbot for commit ed9e012. Configure here.


Resolves: #94
Description
Add
type add-tab,type edit-tab, andtype remove-tabcommands for managing tabs on content types.Checklist
Preview
How to QA 1
Note
Medium Risk
Adds new CLI commands that mutate content type JSON (including slice zone fields) and push updates to Prismic plus local adapter generation, so mistakes could directly affect schemas in a repo. Scope is contained to new commands with coverage via integration tests.
Overview
Adds three new
prismic typesubcommands:add-tab,edit-tab, andremove-tabto manage tabs within a content type’sjson, including optional slice zone creation/removal and tab renaming.Wires the new handlers into the
typecommand router, ensures remote updates viaupdateCustomTypewith friendlierUnknownRequestErrormessaging, and updates local files/types via the adapter. Includes new tests covering--help, tab add/remove, renaming, and slice-zone toggling.Reviewed by Cursor Bugbot for commit ed9e012. Bugbot is set up for automated code reviews on this repo. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩