Skip to content

feat(grid): Add settings, connections, and classifier commands - #173

Merged
ShivainVij merged 4 commits into
shivain/grid-renamefrom
shivain/additional-cli-commands
Oct 20, 2026
Merged

ShivainVij merged 4 commits into
shivain/grid-renamefrom
shivain/additional-cli-commands

Conversation

@ShivainVij

Copy link
Copy Markdown
Contributor

🚀 What

Extend the Grid command tree with the remaining API-backed management commands:

  • grid team-settings describe|update
  • grid user-settings list|describe|update
  • grid connection list|create|update|delete
  • grid classifier list

Also:

  • Support creating and updating classifier-backed routes.
  • Add team and router grouping, plus team filtering, to grid route usage.
  • Resolve an omitted --team server-side during setup.
  • Keep grid harness-defaults alongside the new team-settings commands.

connection describe and classifier describe are intentionally omitted because their individual-resource GET APIs do not exist.

💻 How

  • Pin baseten-go to 31f58c2 from Regenerate the management API client for the /v1/grid API and Grid schema renames baseten-go#70, matching the final Grid API.
  • Migrate SDK references to the generated Grid* types and union helpers.
  • Use generated SDK methods for classifier and user-settings listing; remove the custom HTTP adapter and duplicated classifier response types.
  • Update setup, sync, and harness-defaults to use /v1/grid/team_settings.
  • Let setup request routes without team_id when --team is omitted, then use the server-resolved team for subsequent requests and the saved sync configuration.
  • Preserve omitted-versus-null PATCH semantics and exact decimal spend limits.
  • Continue discovering usage teams through /v1/teams and fetching per-team user settings; no calls remain to the removed settings-across-teams endpoint.

Stacked on shivain/grid-rename (#169).

🔬 Testing

  • Full Go test suite passes, including installed Claude Code and Codex smoke tests.
  • Grid/harness race tests and go vet ./... pass.
  • Module verification, dependency tidiness, formatting, and whitespace checks pass.
  • Native macOS build and Linux/Windows cross-builds pass.
  • 140 live localhost checks and a separate direct-terminal smoke test passed against backend #34429 using the new SDK.
  • Coverage includes CRUD, permissions, invalid inputs, output formats, null/zero limits, team inference, usage grouping/pagination, and harness setup/sync/teardown.
  • Disposable test resources and credentials were cleaned up.

@ShivainVij
ShivainVij added this pull request to stack #174 October 20, 2026 04:20

@youngzheng-oss youngzheng-oss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving since it's just squashing a stack

@ShivainVij
ShivainVij removed this pull request from stack #174 October 20, 2026 09:18
@ShivainVij
ShivainVij merged commit 83efd56 into shivain/grid-rename Oct 20, 2026
3 checks passed
@ShivainVij
ShivainVij deleted the shivain/additional-cli-commands branch October 20, 2026 09:19
ShivainVij added a commit that referenced this pull request Oct 21, 2026
* fix(harness): Read usage settings per team instead of the user teams listing

The usage command listed your teams and your Code settings in each with
GET /v1/routes/settings/users/me/teams, which is being removed. Use
GET /v1/teams for your teams and GET /v1/routes/settings/teams/{team}/users/me
for your settings in each, which say the same things. Org admins are
members of every team, so they still see every team.

Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm

* grid rename

* Update command.harness_usage_test.go

* Call the /v1/grid API and let the server pick the team for grid usage

Pins baseten-go to the client regenerated for the renamed Grid API, so
every call site moves to the GetGrid*/PostGrid*/PatchGrid*/DeleteGrid*
methods. grid usage now reads your settings from
GET /v1/grid/team_settings/users/me and passes --team straight through
as team_id: the server uses your only team, or asks for --team when you
belong to several. The client-side team listing and name matching are
gone, along with the "No usage this month" branch they fed.

Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm

* refactor(grid): align command files and symbols with Grid hierarchy

* Update go.sum

* feat(grid): Add settings, connections, and classifier commands (#173)

* adding functionality to cli

* Update go.sum

* adding functionality to cli

* responding to comments (1)

* responding to comments (2)

* renaming

* Update command.grid.go

* Removing to match spec

* updating with new sdk

* grid settings flag rename to route id

* updated create/update outputs to be concise confirmations

* Update command.grid_test.go

* test renaming

* matching create (use hasGridRouteClassifier)

* Fold grid usage into grid route usage

`grid usage` listed your teams and fetched your settings in each to draw
your spend against your limit, the one place the CLI still stitched teams
together client-side. Per the review on this PR, usage is one command:
`grid route usage [--team] [--user-id]`, whose arguments behave as the API
does. Without --team, usage spans the teams you can see; without --user-id,
members see their own usage and admins see everyone's. Your spend against
your limit in a team is `grid user-settings describe`.

Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm

* Show the team in grid route list

The list spans every team you can see unless --team narrows it, so two
rows can share a name. A TEAM column, as the connection list already
has, tells them apart.

Claude-Session: https://claude.ai/code/session_01UkWMh7GwDgbmR88spBWMEm

* inline cleanup

* command. filename matching

* more file org cleanup

* formatting

* defaultToCaller never set

* Addressing more comments

* show ids as well in route describe

* updating SDK + use ID for setup command

---------

Co-authored-by: Young Zheng <young.zheng@baseten.co>
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