A GitHub CLI extension to interact with pull requests opened by Dependabot on GitHub.
- GitHub CLI (
gh) version 2.0 or higher - Go version 1.26 or higher (only required for building from source)
gh extension install knplabs/gh-dependabotOnce installed, the extension is available as a gh subcommand:
gh dependabotUse the --help flag to see available commands and options:
gh dependabot --helpYou can approve Dependabot's PR:
gh dependabot approve [PR's number...]You can merge Dependabot's PR:
gh dependabot merge [PR's number...]You can interactively review Dependabot's PRs one by one, with the diff displayed and a y/n prompt for each:
gh dependabot interactiveWants more feature? Open an issue, I'll take a look as soon as I can!
-
Clone the repository:
git clone https://github.com/knplabs/gh-dependabot.git cd gh-dependabot -
Build the binary:
go build -o gh-dependabot
-
Install it locally as a GitHub CLI extension:
gh extension install .
While iterating on the extension, the fastest loop is to build the binary and
run it directly against a real repository — no gh extension install step
between rebuilds. The binary shells out to gh (which must be authenticated)
and infers the current repository from your working directory.
-
Build the binary from the project root:
go build -o gh-dependabot . -
Move into a repository that has open Dependabot pull requests:
cd /path/to/some-repo-with-dependabot-prs -
Run the binary directly using its absolute path, for example:
/path/to/gh-dependabot/gh-dependabot interactive
Replace
interactivewithapprove,merge, or omit it to launch the default list view. Rebuild and re-run after each change.
