vcs-github
Automate GitHub from Rust through the gh CLI and process execution. Part of
the vcs-toolkit-rs workspace.
Typed, async commands over the GitHub CLI (gh) that deserialize
gh … --json output into structs, behind a mockable interface. Commands run
inside an OS job (via processkit) so no gh subprocess is ever orphaned,
return the structured Error, and honour an optional timeout.
📖 Full guide: on docs.rs — every command by theme, result types, config types, and worked examples.
Inside an async context (every method is async):
use Path;
use ;
let gh = new;
let prs = gh.pr_list.await?; // Vec<PullRequest>
let authed = gh.auth_status.await?; // bool — true when `gh auth status` exits 0
Inspect the repo and open a PR
use Path;
use ;
# async
auth_status and timeouts
auth_status reports the bool from gh auth status's exit code, but a spawn
failure or a timeout still surfaces as a processkit::Error rather than a
silent false:
# use ;
use Duration;
# async
Consumers depend on the GitHubApi trait and substitute a fake in tests — enable
the mock feature for a mockall-generated MockGitHubApi, or inject a fake
process runner with GitHub::with_runner(processkit::ScriptedRunner::new()…):
use ;
use Path;
use ;
# async
Requires the gh binary on PATH (authenticated via gh auth login).
License
MIT