Replace gh CLI with /api/v1/repositories for dispatch wizard#1023
Conversation
Swaps the cloud-dispatch repo picker from shelling out to `gh api user/repos` to calling the Entire API's new /api/v1/repositories endpoint via the existing authenticated api.Client. Removes the hard dependency on a locally-installed, logged-in gh. Repos with zero checkpoints are filtered out of the picker since dispatching them would produce nothing. Server order (recent-first) is preserved; buildDispatchRepoOptions no longer alphabetizes so the API's ordering surfaces in the picker — `/` filtering handles search. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 1d85b50ab77b
There was a problem hiding this comment.
Pull request overview
Updates the dispatch wizard’s cloud repo picker to use the Entire API (GET /api/v1/repositories) via the existing authenticated api.Client, removing the need to shell out to the local gh CLI and preserving server-side “recent-first” ordering for cloud repos.
Changes:
- Add
api.Client.ListRepositoriesto call/api/v1/repositorieswith optional sort. - Switch dispatch wizard authenticated repo discovery from
gh api user/reposto the Entire API and filter out repos with zero checkpoints. - Adjust repo option building/tests to preserve caller order (rather than alphabetizing).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/entire/cli/dispatch_wizard.go | Uses authenticated Entire API repo listing (recent-first) and preserves caller ordering for picker options. |
| cmd/entire/cli/dispatch_wizard_test.go | Updates ordering expectations and adds a test for filtering zero-checkpoint/blank repos while preserving order. |
| cmd/entire/cli/api/repositories.go | Introduces /api/v1/repositories client types and a ListRepositories helper method. |
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.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c683c71. Configure here.
Fix misleading doc-comment on buildDispatchRepoOptions that claimed the local-discovery fallback sorts before calling — it doesn't. Rewrite the comment to describe what actually happens: each source picks its own order (API is recent-first, local is current-repo-first). Add httptest-based unit tests for api.Client.ListRepositories covering the sort query param, empty-sort case, JSON decoding, and error-path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: db22f43fb922

https://entire.io/gh/entireio/cli/trails/23a58f348df1
https://github.com/entirehq/entire.io/pull/1642 <- API on the other side.
Swaps the cloud-dispatch repo picker from shelling out to
gh api user/reposto calling the Entire API's new /api/v1/repositories endpoint via the existing authenticated api.Client. Removes the hard dependency on a locally-installed, logged-in gh.Repos with zero checkpoints are filtered out of the picker since dispatching them would produce nothing. Server order (recent-first) is preserved; buildDispatchRepoOptions no longer alphabetizes so the API's ordering surfaces in the picker —
/filtering handles search.Note
Medium Risk
Changes the cloud dispatch repo discovery path to depend on a new authenticated
/api/v1/repositoriescall and different ordering/filtering behavior, which could impact who sees which repos and in what order. Risk is moderate because it alters a user-facing workflow but doesn’t touch auth/token handling beyond reusing the existing client.Overview
The dispatch wizard’s cloud repo picker now fetches repositories via the CLI’s authenticated Entire API client (
GET /api/v1/repositories, withsort=recent) instead of shelling out togh api, removing the hard dependency on a locally installed/logged-in GitHub CLI.Repo options no longer get alphabetized in
buildDispatchRepoOptions, so the server-provided recent-first ordering is preserved, and repos withcheckpoint_count <= 0(or blankfull_name) are filtered out of the picker. Tests were updated/added to validate ordering, deduping, and checkpoint filtering.Reviewed by Cursor Bugbot for commit c683c71. Configure here.