A lightweight GitHub CLI tool written in C to interact with pull requests of your current Git branch.
Checks for an open pull request on your current Git branch and returns:
- Branch name
- Pull request number
- PR title
- Number of ✅ approvals
Example output:
Branch: feature/improve-api | PR: #42 | Title: Refactor endpoint | Approvals: 3 ✅
Make sure you have libcurl and cJSON installed (via Homebrew on macOS):
brew install curl cjsonThen build:
makeThis will create a binary called ghcli.
To use ghcli globally from any Git repo, move or symlink the binary to a folder in your $PATH.
sudo mv ghcli /usr/local/bin/mkdir -p ~/bin
ln -s "$(pwd)/ghcli" ~/bin/ghcliThen add ~/bin to your shell config if it isn’t already:
# ~/.zshrc or ~/.bashrc
export PATH="$HOME/bin:$PATH"Reload your shell:
source ~/.zshrc # or ~/.bashrcNow you can use ghcli pr approvals in any GitHub repo.
You need a GitHub personal access token with repo access.
Export it as an environment variable:
export GITHUB_TOKEN=your_token_hereghcli pr checks: List status of all GitHub Actions / Jenkins / SonarCloud checksghcli pr mergeable: Show mergeability statusghcli issues list: Show assigned GitHub issues
src/
├── main.c
├── pr/
│ ├── pr.c
│ └── pr.h
├── utils/
│ ├── utils.c
│ └── utils.h
Contributions welcome. Fork the repo, make a feature branch, and submit a PR.
MIT