Repository navigation
refactor(cli): make each feature's api.ts its whole REST client - #153
Merged
Merged
Conversation
Command handlers now only read and validate argv. The events update, delete and usage requests, the SQL preview job, warehouse config validation and the recordings targeting-key requests move from their handlers into features/<x>/api.ts, matching flags. The cli skill documents the rule so new commands follow it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resource types, body shapes and response projections move into api.ts for data, warehouse and recordings: the warehouse create commands, list and get (so no handler can forget the secret filter), the data table creates with the skipSqlPreview guard, the SQL status and schema reads, and the recordings field-type table and entity default. Drops the getFlagOperation pass-through and the one-off SQL_JOBS type, removes comments that restate the code, makes three tests able to fail, and corrects the cli skill text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
filipmyllari
marked this pull request as ready for review
December 3, 2026 14:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the review of #148 (CGT-86): each feature's
api.tsis now its whole REST client, so request building stays out of the command handlers. The cli skill documents the rule so agents keep following it.features/<x>/api.tsholds the feature's resource types, request and body shapes, response projections, and one function per request returning aRestOperation:skipSqlPreview: trueguard, which was copied in two handlers), the SQL preview job and wait, and the SQL status and schema reads.targeting-key showandadd, including the field-type table and theentities/<field>default.render. They may still call the sharedlistOperationandgetOperationdirectly.getFlagOperation, which only passed through, and the one-offSQL_JOBStype.events delete --force,data … --dry-runwithout login, and the tokenwarehouse setuppasses on..claude/skills/cli/SKILL.mdstates the rule and lists the commands still outside it.flags list|get|update|archiveuse the older client (CGT-88), and the recordings policy and rule commands still use the MCP (CGT-87).Behaviour: unchanged, apart from one message. When
data sql preview --waitfails, it now ends withCheck "confidence data sql status --name …"instead ofInspect it with "…".Tested: CLI lint, format and typecheck, and all 359 CLI tests.
🤖 Generated with Claude Code