Summary
We interact with GitHub through three different mechanisms today — the gh CLI, raw git, and the go-github API — with no clear rule for which to use. This umbrella tracks aligning on a single principle and migrating the mismatched call sites.
Guiding principle
Use git for git operations; use the go-github API for GitHub platform operations. The gh CLI is only a thin API wrapper in a subprocess — it adds a runtime binary + auth dependency and inconsistent error handling for no benefit over the API client we already vendor.
- Content operations (clone / add / commit / tag / push / ls-remote / ls-files) → git binary. The REST API is slower and lossier here; reimplementing git over HTTP is a step backwards. Keep as-is.
- Platform operations (create repo / release / upload asset / PR / issue) → go-github. These are not git; they're API calls currently shelled through
gh.
Key fact: no new dependency
github.com/google/go-github/v89 is already a direct dependency (go.mod:22), used read-only today in cmd/agents/versions.go (newGitHubClient:488, ListReleases/ListTags). Token plumbing already exists in githubToken() (:500): GITHUB_TOKEN / GH_TOKEN, falling back to gh auth token (credential-only use of gh, which is fine).
Suggested first step: lift newGitHubClient + githubToken into a shared pkg/github helper so every migration reuses one client + token path.
Where each mechanism is used today
| Area | File(s) | Mechanism | Keep / migrate |
|---|
| librarystore content push | pkg/librarystore/github.go | raw git | keep (git op) |
| librarystore repo creation | (missing — errors at github.go:135) | none | migrate → API (#459) |
| Agent release + asset upload | cmd/publish/agent_release.go (:291,:319,:51) | gh CLI | migrate → API (#457) |
| GitOps PRs | pkg/gitops/publish.go (:1208–:1250), observe.go:726 | gh CLI | migrate → API (#458) |
| Chore "core behind" issue | cmd/status/release.go:266 | gh CLI | migrate → API (#458) |
| GitOps branch pushes | pkg/gitops/{publish,observe,remote}.go | raw git | keep (git op) |
| Release tags | cmd/publish/release.go | raw git | keep (git op) |
| Version listing | cmd/agents/versions.go | go-github ✅ | already correct |
Work items
Non-goals
Summary
We interact with GitHub through three different mechanisms today — the
ghCLI, rawgit, and thego-githubAPI — with no clear rule for which to use. This umbrella tracks aligning on a single principle and migrating the mismatched call sites.Guiding principle
Use
gitfor git operations; use the go-github API for GitHub platform operations. TheghCLI is only a thin API wrapper in a subprocess — it adds a runtime binary + auth dependency and inconsistent error handling for no benefit over the API client we already vendor.gh.Key fact: no new dependency
github.com/google/go-github/v89is already a direct dependency (go.mod:22), used read-only today incmd/agents/versions.go(newGitHubClient:488,ListReleases/ListTags). Token plumbing already exists ingithubToken()(:500):GITHUB_TOKEN/GH_TOKEN, falling back togh auth token(credential-only use ofgh, which is fine).Suggested first step: lift
newGitHubClient+githubTokeninto a sharedpkg/githubhelper so every migration reuses one client + token path.Where each mechanism is used today
pkg/librarystore/github.gogitgithub.go:135)cmd/publish/agent_release.go(:291,:319,:51)ghCLIpkg/gitops/publish.go(:1208–:1250),observe.go:726ghCLIcmd/status/release.go:266ghCLIpkg/gitops/{publish,observe,remote}.gogitcmd/publish/release.gogitcmd/agents/versions.goWork items
ghCLI to go-github API #457 — Migrate agent-release publishing fromghCLI to go-github (highest value — drops the hardghbinary requirement from releases)ghCLI to go-github API #458 — Migrate GitOps PR + chore-issue flows fromghCLI to go-githubpkg/githubclient/token helperNon-goals
gh auth tokencredential fallback — that's a convenience, not a hard dependency.