Mergify CLI

Drive Mergify from your terminal and CI pipelines:
stacked pull requests, the merge queue, Test Engine, scheduled freezes, and
configuration — all from a single self-contained binary that reuses your
existing GitHub (gh) login.
mergify stack push # turn your local commits into stacked PRs
mergify queue status # inspect the merge queue
mergify ci junit-process report.xml # upload test results to Test Engine
- One static binary. No runtime, no dependencies — drop it on a developer
laptop or a CI runner and go.
- One command to sign in.
mergify auth login approves the CLI in your
browser and keeps the credential in your OS keychain; MERGIFY_TOKEN or
--token for scripting. In a GitHub Actions job granted id-token: write,
a command needs neither: it exchanges the job's ID token.
- Built for pipelines. Logs to stderr, structured
--json output on read
commands, and stable exit codes for scripts and runbooks.
- Cross-platform. Linux (x86_64 + aarch64, glibc 2.28 or newer), macOS
(aarch64; x86_64 as best effort, not tested before a release), and Windows.
Installation
Homebrew (recommended for macOS)
brew install mergifyio/tap/mergify-cli
The fully-qualified name taps and installs in one step. Upgrade with
brew upgrade mergify-cli — not mergify self-update, which overwrites the
Homebrew-managed binary. See the tap
for tap-trust and short-name details.
Install script (recommended for Linux; also macOS)
curl -fsSL https://raw.githubusercontent.com/Mergifyio/mergify-cli/main/install.sh | sh
Installs to ~/.local/bin/mergify. Override with MERGIFY_INSTALL_DIR=/usr/local/bin
or pin a version with MERGIFY_VERSION=<version>. Upgrade with mergify self-update.
Manual download (Windows, or to bypass the script)
Grab the matching archive from the
latest release:
- Windows — download
mergify-<version>-x86_64-pc-windows-msvc.zip,
extract it, and put mergify.exe anywhere on your PATH.
- Linux / macOS — download
mergify-<version>-<target>.tar.gz (e.g.
mergify-2026.10.1-aarch64-apple-darwin.tar.gz), extract with tar -xzf,
and put the resulting mergify binary anywhere on your PATH.
Verify against SHA256SUMS from the same release if you care.
Authentication
Sign in once:
mergify auth login
It opens the approval page in your browser, and prints the URL and the code
as well: pass --no-browser, or run it where there is no browser to open,
and the printed pair is all you need. Once you approve, the
credential lands in your OS keychain — or, on a machine with none (a
container, an unattended agent, a headless box with no D-Bus session), in a
restricted file under your configuration directory. mergify auth status says
which account you are signed in as, and mergify auth logout asks the Mergify
API to revoke the credential rather than only deleting the local copy.
The approval page labels the new token Mergify CLI on <hostname>. Pass
--device-name "work laptop" to name the machine yourself, or --device-name=
to keep the hostname from leaving the machine at all.
The commands that talk to the Mergify API resolve a credential in this
order:
| # | Credential | |
|---|
| 1 | --token / -t | |
| 2 | MERGIFY_TOKEN | |
| 3 | the credential stored by mergify auth login | keyed by API URL |
| 4 | the token the CI job's ID token is exchanged for | GitHub Actions with id-token: write |
In a GitHub Actions job granted id-token: write, step 4 exchanges the job's
ID token for a short-lived Mergify OIDC CI token, once a trust policy of the
organization allows the job (mergify oidc, below). It holds what the policies
allowing the job grant, on the job's repository only: mergify queue pause
needs a policy granting merge_queue_pause=write, and a command whose request
the token does not grant gets Mergify's 403. A token given in steps 1 to 3
still wins.
A GitHub token (GITHUB_TOKEN, gh auth token) is no longer a fallback: the
Mergify API is dropping GitHub tokens, and a command with none of the credentials
above fails and says how to get one. Run mergify auth login, or set
MERGIFY_TOKEN in CI.