- Prerequisites
- Option 1: Homebrew
- Option 2: Go install
- Option 3: Prebuilt binary
- Option 4: From source
- Upgrading
- Verify the installation
- Shell completion
- Go 1.26.1 or higher — required for
go installand for building from source. Not needed if you download a prebuilt binary. - A GitHub Personal Access Token — fine-grained (recommended) or classic. See Authentication.
The shortest path on macOS or Linux, no Go required:
brew install pradyb/tap/sghThis taps pradyb/homebrew-tap and installs the prebuilt binary. Each release also publishes .tar.gz (.zip on Windows) archives that Homebrew uses.
If you already have Go:
go install github.com/pradyb/sgh-cli/cmd/sgh@latestThis installs the binary as sgh into $(go env GOPATH)/bin. Make sure that directory is on your PATH.
Every tagged release attaches prebuilt binaries built with CGO_ENABLED=0, so they have no runtime dependencies. Download the one for your platform from the releases page:
| Platform | Asset |
|---|---|
| Linux (x86-64) | sgh-linux-amd64 |
| Linux (ARM64) | sgh-linux-arm64 |
| macOS (Intel) | sgh-darwin-amd64 |
| macOS (Apple Silicon) | sgh-darwin-arm64 |
| Windows (x86-64) | sgh-windows-amd64.exe |
Each release also publishes checksums.txt. Verify before running:
# Linux/macOS
curl -LO https://github.com/pradyb/sgh-cli/releases/latest/download/sgh-linux-amd64
curl -LO https://github.com/pradyb/sgh-cli/releases/latest/download/checksums.txt
sha256sum --check --ignore-missing checksums.txt
sudo install -m 0755 sgh-linux-amd64 /usr/local/bin/sghOn Windows, rename sgh-windows-amd64.exe to sgh.exe and place it in a directory on your PATH.
Useful if you want to build a specific branch or make local changes:
git clone https://github.com/pradyb/sgh-cli.git
cd sgh-cli
go build -o sgh ./cmd/sgh
# Linux/macOS — put it on your PATH
sudo mv sgh /usr/local/bin/
# Windows — move sgh.exe to a directory on your PATHThere's no self-update command — upgrade the same way you installed, and check sgh version before/after to confirm it took effect. sgh also checks for a newer release once a day and prints a stderr notice when one exists, with the upgrade command matching how you installed it — Homebrew, go install, or just the releases link for a downloaded binary (disable with --no-update-check or SGH_NO_UPDATE_CHECK=1), so you don't have to check the releases page manually.
Homebrew:
brew update && brew upgrade sghGo install:
go install github.com/pradyb/sgh-cli/cmd/sgh@latestRe-running this rebuilds at the newest tag and overwrites the existing binary in place.
Prebuilt binary: re-download from the releases page (or .../releases/latest/download/sgh-<platform>) and overwrite the file at the same path — same steps as Option 3, including re-verifying against the new checksums.txt.
From source:
git pull
go build -o sgh ./cmd/sghsgh --help
sgh versionsgh version prints the version string, commit SHA, and build date. Binaries built from source without release ldflags report the placeholder defaults 1.0.0 (version) and Beta (commit SHA, build date) — that is expected.
To confirm your token and network path work end to end:
sgh healthCompletion scripts are generated by the binary itself and cover Bash, Zsh, Fish, and PowerShell:
# Bash
sgh completion bash > /etc/bash_completion.d/sgh
# Zsh
sgh completion zsh > "${fpath[1]}/_sgh"
# Fish
sgh completion fish > ~/.config/fish/completions/sgh.fish
# PowerShell
sgh completion powershell | Out-String | Invoke-ExpressionOnce installed, two flags complete from your own configuration:
--org/-o— tab-completes organization names from your config file--repository/-r— tab-completes repository names for the selected org
Next: Authentication · Configuration