gh-rs is a 12.4 MB GitHub CLI: device-flow auth into the OS keychain, repo · pr · issue with JSON for agents and plain text for humans.
13 tests green · 0 tokens in files · 15 source files · backtraces kept
gh does everything. gh-rs does four things and shows its work: real numbers, real output, real file tree.
Strip plus LTO lands 12.4 MB. --help answers in ~50ms because there is no runtime to warm. Built and tested on the 8GB Windows box it ships from.
gh 40.7 MB · 102ms --help gh-rs 12.4 MB · 49ms --help
Every list and view takes --json. Pipe straight to jq.
pr list --json | jq '.[].n' 12 14 19
Device flow stores in Credential Manager / Keychain. Status prints validity, never the secret.
Each command is one cli/ module plus one github/ module. System git for clone fidelity.
Windows 11, release build, 3 runs each, network included. ~700ms per command is TLS plus API round trip on both sides.
--json on list/view only. Mutating commands speak plain text. --limit 1–100, default 30, one per_page request.
$ gh-rs auth login # browser code → OS keychain $ gh-rs auth status → ok $ gh-rs auth logout # credential deleted
$ gh-rs repo list --limit 3 [--json] # newest push first $ gh-rs repo view [owner/repo] # bare = git origin $ gh-rs repo create demo # private unless --public $ gh-rs repo clone owner/repo [dir] # Bearer header auth
$ gh-rs pr create --title T --head feat --base main → #12 opened $ gh-rs pr list / view / diff 12 # diff = raw text $ gh-rs pr merge 12 --method squash # merge|squash|rebase
$ gh-rs issue create --title T --body B [--repo o/r] → #7 opened $ gh-rs issue list / view 7 [--json] $ gh-rs issue close 7
Re-run Sep 2026 after the strip/LTO profile. gh-rs wins where a CLI can win; the network washes the rest.
| command | gh 2.93.0 | gh-rs v0.1 |
|---|---|---|
| auth status | 699–768ms | 622–766ms · tie |
| repo view | 684–749ms | 783–798ms · noise |
| pr list | 706–812ms | 636–723ms · ~10% |
| issue list | 714–877ms | 741–752ms · tie |
| --help, no network | 102–105ms | 49–65ms · ~2x |
| binary | 40.7 MB | 12.4 MB |
Octocrab typed pulls, raw REST where models overflow the stack, system git for clone fidelity.
src/main.rs # tokio current_thread entry src/error.rs # AppError — every fallible path returns it src/cli/ # auth repo pr issue — args + dispatch src/github/ # client auth repo pr issue — API layer src/git.rs # subprocess, Bearer extraHeader src/render.rs # plain-text view renderers
cargo install, auth login, repo list. Thirty seconds.
cargo install gh-rs