v0.1.0 tagged · CI passing on master · MIT · Star on GitHub →
GitHub CLI · Rust · MIT

Four commands. No bloat.

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.

Read the source →

13 tests green · 0 tokens in files · 15 source files · backtraces kept

akash — zsh
$ cargo install gh-rs
$ gh-rs auth login # device flow → keychain
$ gh-rs repo list --limit 3
AkashPriyadarshii/repomap public · Go
AkashPriyadarshii/zcat public · Zig
$ gh-rs pr list --json | jq '.[].number'
49ms
--help startup
12.4MB
binary size
~10%
pr list faster
--json
every list + view
0
tokens in files
Why gh-rs

Small tool, presented properly.

gh does everything. gh-rs does four things and shows its work: real numbers, real output, real file tree.

01 / STARTUP + SIZE

A binary that respects your machine.

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
02 / AGENTS

JSON where it counts.

Every list and view takes --json. Pipe straight to jq.

pr list --json | jq '.[].n'
12  14  19
03 / AUTH

Token out of dotfiles.

Device flow stores in Credential Manager / Keychain. Status prints validity, never the secret.

04 / CODE

Fifteen files. One error enum.

Each command is one cli/ module plus one github/ module. System git for clone fidelity.

Honest comparison

gh vs gh-rs, no cherry-picking.

Windows 11, release build, 3 runs each, network included. ~700ms per command is TLS plus API round trip on both sides.

gh 2.93.0 · 40.7 MB
does everything
  • actions · releases · gists · search
  • extensions · codespaces · projects
  • 40.7 MB · 102ms --help
  • token in plaintext helpers
gh-rs v0.1.0 · 12.4 MB
does four things
  • auth · device flow → keychain
  • repo · pr · issue · --json
  • 12.4 MB · 49ms --help
  • 15 files · one error enum
Commands

Four groups. --help tells the truth.

--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
Benchmarks

Startup and size win. Latency ties.

Re-run Sep 2026 after the strip/LTO profile. gh-rs wins where a CLI can win; the network washes the rest.

commandgh 2.93.0gh-rs v0.1
auth status699–768ms622–766ms · tie
repo view684–749ms783–798ms · noise
pr list706–812ms636–723ms · ~10%
issue list714–877ms741–752ms · tie
--help, no network102–105ms49–65ms · ~2x
binary40.7 MB12.4 MB
Under the hood

Fifteen files. No magic.

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

v0.1 refuses

  • actions, releases, gists, search — full parity ≈ 65 solo-weeks, cut
  • TUI or pager — plain text, no exceptions
  • pagination past --limit 100 — single per_page request
  • --jq engine, JSON on mutating commands
  • panic=abort — backtraces beat ~1MB

Run your first command.

cargo install, auth login, repo list. Thirty seconds.

cargo install gh-rs