ghtkn-rust-sdk
Rust port of ghtkn-go-sdk — GitHub token management via OAuth device flow.
Development
Prerequisites
- Rust via rustup with clippy and rustfmt components:
- mise for task running and cargo tool provisioning
Setup
This provisions cargo-deny, cargo-machete, cargo-release, git-cliff, jq, and other helpers.
Common Commands
| Command | Description |
|---|---|
mise run ci |
Run all CI checks locally (single OS, not the matrix) |
mise run lint |
Quick lint (clippy + fmt) |
mise run t |
Run tests |
mise run v |
Run clippy with -D warnings (warnings are errors) |
mise run f |
Check formatting via cargo fmt --check |
mise run changelog |
Generate CHANGELOG.md via git-cliff |
Releasing
Releases are managed by cargo-release and published to crates.io via GitHub Actions.
One-time setup: Add a CARGO_REGISTRY_TOKEN secret to the GitHub repository (crates.io tokens → scope: publish-new for first publish, publish-update thereafter).
# Dry run (default, shows what would happen)
# Actually release (generates changelog, bumps version, tags, pushes)
Where <level> is patch, minor, or major. To release the current version as-is (e.g. for the first publish), omit the level:
The cargo release command will:
- Bump the version in
Cargo.toml(if a level is given) - Generate/update
CHANGELOG.mdvia git-cliff - Create a release commit
- Create a
v{version}git tag - Push the commit and tag to origin
CI then picks up the tag and runs tests across all platforms before publishing to crates.io.