feat: CLI exclusions, write confirmations, and job alias removal - #13
Merged
Conversation
- Parse x-exclude-from-cli OpenAPI extension; skip excluded ops in auto-generated command tree (superuser and legacy endpoints stay accessible via API but are hidden from CLI) - Add --yes / -y persistent flag to bypass write confirmation prompt - Prompt for confirmation on POST/PUT/DELETE/PATCH unless --yes or --dry-run (CI-friendly: use --yes in scripts) - Add Excluded bool field to Operation struct - Remove job-runs running/failed/completed alias subcommands; use job-runs list --status RUNNING|FAILED|COMPLETED instead - Add CODEOWNERS assigning @wherobots/wbc-crew to all files
- TestParseExcludeFromCLIExtension: asserts parser sets Excluded=true on operations with x-exclude-from-cli: true extension - TestExcludedOperationsAbsentFromTree: asserts excluded operations are completely absent from --tree output
- Parse operation description field from OpenAPI spec - --tree: leaf verb nodes now show their summary aligned in a column (group nodes like 'catalogs' or 'storage' show name only) - --help: OpenAPI description (longer text) is prepended to the Long help body before the parameter listing - Tests: add TestTreeShowsSummaryOnLeafNodes, TestDescriptionAppearsInHelp; update TestRootTreeOutput for new padded leaf format
ClayMav
marked this pull request as ready for review
April 4, 2026 00:37
ClayMav
requested review from
a team and
kcheng486
and removed request for
a team
April 4, 2026 00:37
Cache files are now named spec-<fnv32hex>.json / spec-<fnv32hex>.meta.json where the hex suffix is an FNV-1a hash of the OpenAPI URL. Switching WHEROBOTS_API_URL no longer serves a stale spec from a different endpoint, and switching back to a previously-used URL hits its own warm cache.
operationIDVerb now extracts only the action prefix from the operation ID
("get", "list", "cancel", "destroy", etc.) rather than normalising the
entire thing. This prevents double-resource names in the tree:
Before: api flags get-flags (path "flags" + verb "get-flags")
After: api flags get (path "flags" + verb "get")
Path hierarchy from the URL already provides resource context; repeating
it in the verb name was noisy and confusing.
sfishel18
approved these changes
Apr 6, 2026
sfishel18
left a comment
There was a problem hiding this comment.
lgtm, though some tests for the confirmation / --yes flag behavior would be nice
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.
Summary
x-exclude-from-clisupport: The spec parser now reads thex-exclude-from-cli: trueOpenAPI extension and omits those operations from the auto-generatedapicommand tree. Superuser and legacy/internal endpoints set this flag in studio-backend and will no longer appear in the CLI.Proceed? [y/N]before executing. Use--yes/-yto skip (for CI or scripts).job-runs running,job-runs failed, andjob-runs completedare removed. Usejob-runs list --status RUNNING|FAILED|COMPLETEDinstead — the list command already supports all status filters..github/CODEOWNERSassigning@wherobots/wbc-crewto all files.Test plan
wbc api --treeno longer shows superuser/legacy endpoints--yesskips itwbc job-runs list --status RUNNINGworks;wbc job-runs runningis gonewbc --dry-runon a write command does not prompt