A CLI tool to compare two commits in a GitHub repository and output the file changes in JSON format.
Download from GitHub Releases:
tar -xzf gitdiffs-x86_64-linux.tar.gz
sudo mv gitdiffs /usr/local/bin/git clone https://github.com/yourusername/gitdiffs.git
cd gitdiffs
cargo build --releaseThe binary will be available at ./target/release/gitdiffs.
gitdiffs <repo_url> <base_commit> <head_commit>| Argument | Description |
|---|---|
repo_url |
GitHub repository URL (e.g., https://github.com/owner/repo) |
base_commit |
The base commit SHA |
head_commit |
The head commit SHA to compare against |
gitdiffs https://github.com/openclaw/skills f4af0de88dbafb399d7316f0b0d287169785ceee 05166e30a79b6824db300d4d069bc1e79408eaea{
"repo": "openclaw/skills",
"base": "f4af0de88dbafb399d7316f0b0d287169785ceee",
"head": "05166e30a79b6824db300d4d069bc1e79408eaea",
"files": [
{
"status": "ADD",
"path": "skills/guohongbin-git/zhihu-hot-cn/README.md"
},
{
"status": "ADD",
"path": "skills/guohongbin-git/zhihu-hot-cn/SKILL.md"
}
]
}| GitHub API Status | Output Status |
|---|---|
added |
ADD |
modified |
ADD |
removed |
DEL |
renamed |
DEL + ADD (two entries) |
Set the GITHUB_TOKEN environment variable to authenticate with GitHub API:
export GITHUB_TOKEN=your_github_token
gitdiffs https://github.com/owner/repo base_sha head_sha- Without token: 60 requests/hour
- With token: 5,000 requests/hour
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scopes:
public_repofor public repos,repofor private repos - Generate and copy the token
MIT