Mergify CLI is a tool that automates the creation and management of stacked pull requests on GitHub and handles CI results upload
Project description
Mergify CLI
Drive Mergify from your terminal and CI pipelines:
stacked pull requests, the merge queue, CI Insights, 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 CI Insights
- One static binary. No runtime, no dependencies — drop it on a developer laptop or a CI runner and go.
- Zero-config auth. Picks up
gh auth tokenautomatically; override with env vars or flags when scripting. - Built for pipelines. Logs to stderr, structured
--jsonoutput on read commands, and stable exit codes for scripts and runbooks. - Cross-platform. Linux, macOS (x86_64 + aarch64), 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 — x86_64 and aarch64)
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 putmergify.exeanywhere on yourPATH. - Linux / macOS — download
mergify-<version>-<target>.tar.gz(e.g.mergify-2026.4.23.1-aarch64-apple-darwin.tar.gz), extract withtar -xzf, and put the resultingmergifybinary anywhere on yourPATH.
Verify against SHA256SUMS from the same release if you care.
Authentication
Most commands talk to the Mergify and GitHub APIs and need a token. The CLI
resolves credentials and target repository in this order, so an authenticated
gh is usually all you need:
| What | --flag |
then env | then |
|---|---|---|---|
| Token | --token / -t |
MERGIFY_TOKEN, GITHUB_TOKEN |
gh auth token |
| Repository | --repository / -r |
GITHUB_REPOSITORY |
git remote (origin) |
| API URL | --api-url / -u |
MERGIFY_API_URL |
https://api.mergify.com |
See the authentication guide for details.
Quick start
# Stacked pull requests — one PR per commit, kept in sync
mergify stack setup # once per repo: install the git hooks the stack needs
mergify stack push # push commits and create/update their PRs
mergify stack list # show the stack and its PR status
mergify stack sync # rebase the stack onto its trunk
# Merge queue
mergify queue status # current queue state for the repo
mergify queue status --json # same, as machine-readable JSON
# CI Insights — from inside your pipeline
mergify ci junit-process report.xml --test-language python
# Configuration
mergify config validate # check .mergify.yml against the schema
Run mergify --help for the full command list and mergify <command> --help
for any command's flags.
Commands
Every command group maps to a section of the CLI reference.
mergify stack— Create and maintain stacked pull requests. Docsmergify queue— Inspect and control the merge queue. Docsmergify ci— Send JUnit results and pull request scopes from any CI provider. Docsmergify tests— Look up test health and manage the flaky-test quarantine. Docsmergify freeze— Schedule merge freezes for release windows and maintenance. Docsmergify config— Validate your configuration and simulate actions before you merge. Docsmergify self-update— Update the CLI to the latest release.mergify completions <shell>— Print a shell completion script (see below).
Run mergify <command> --help for a group's subcommands and flags.
Shell completions
Generate a completion script for your shell — bash, zsh, fish,
elvish, or powershell:
# zsh — write to a directory on your $fpath
mergify completions zsh > ~/.zfunc/_mergify
# bash — load in your current session (add to ~/.bashrc to persist)
source <(mergify completions bash)
# fish
mergify completions fish > ~/.config/fish/completions/mergify.fish
Global options
These are accepted on every command:
| Flag | Description |
|---|---|
-v, --verbose |
Increase log verbosity: -v info, -vv debug, -vvv trace. Logs go to stderr so stdout stays pipeable. |
--debug |
Shorthand for at least debug-level logging (like -vv). |
--color <auto|always|never> |
When to colorize terminal output. |
Environment variables
| Variable | Effect |
|---|---|
MERGIFY_TOKEN, GITHUB_TOKEN |
API token (falls back to gh auth token). |
GITHUB_REPOSITORY |
Default owner/repo when --repository is omitted. |
MERGIFY_API_URL |
API base URL (default https://api.mergify.com). |
RUST_LOG |
Fine-grained log filtering; overrides --verbose. |
NO_COLOR |
Disable colored output. |
MERGIFY_INSTALL_DIR, MERGIFY_VERSION |
Install-script target directory / pinned version. |
Exit codes
Commands return stable exit codes so scripts and runbooks can branch on them:
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Unclassified runtime failure (I/O error, bug, or captured panic). |
2 |
Argument parsing / usage error. |
3 |
Stack, branch, or commit not found. |
4 |
Rebase or merge conflict. |
5 |
GitHub API request failed. |
6 |
Mergify API request failed. |
7 |
CLI invariant violated (e.g. run outside a valid context). |
8 |
Configuration missing, unparseable, or failing validation. |
AI Agent Skills
Mergify CLI provides AI skills for managing stacked PRs and Git workflows, compatible with Claude Code, Cursor, and many other AI agents.
Install via npx (all agents):
npx skills add Mergifyio/mergify-cli
Install as a Claude Code plugin:
/plugin marketplace add Mergifyio/mergify-cli
/plugin install mergify
Documentation
Full reference and guides live at docs.mergify.com/cli.
Contributing
Contributions are welcome — open an issue or a pull request. The workspace is a Rust monorepo; see AGENTS.md for the crate layout, build, and test workflow.
License
Apache License 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mergify_cli-2026.6.25.1.tar.gz.
File metadata
- Download URL: mergify_cli-2026.6.25.1.tar.gz
- Upload date:
- Size: 395.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e810a7b9182bf6a29c2fb978bcc69fcb02ec55fb70ee87dc7951867363d4033b
|
|
| MD5 |
e57be95cdc8f8e04940dd9fe9347ec5e
|
|
| BLAKE2b-256 |
740094ba02f91c191b0f56642a859da142182863043d7abcd9bd2d54432b88cf
|
Provenance
The following attestation bundles were made for mergify_cli-2026.6.25.1.tar.gz:
Publisher:
release.yml on Mergifyio/mergify-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mergify_cli-2026.6.25.1.tar.gz -
Subject digest:
e810a7b9182bf6a29c2fb978bcc69fcb02ec55fb70ee87dc7951867363d4033b - Sigstore transparency entry: 1950319181
- Sigstore integration time:
-
Permalink:
Mergifyio/mergify-cli@71dd92c19711c58375ac3a5879b69fcb89675879 -
Branch / Tag:
refs/tags/2026.6.25.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@71dd92c19711c58375ac3a5879b69fcb89675879 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mergify_cli-2026.6.25.1-py3-none-win_amd64.whl.
File metadata
- Download URL: mergify_cli-2026.6.25.1-py3-none-win_amd64.whl
- Upload date:
- Size: 5.2 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
952eff71dc72631fb05194519d63dcfd92da25b6af2e03f24f686b65b2e63e39
|
|
| MD5 |
737ad9be3a6b39fc17ddef75667ac23f
|
|
| BLAKE2b-256 |
58c210688665f9236b2770f91c2e7a340bfe02754896c3bb681d8291739f5d6b
|
Provenance
The following attestation bundles were made for mergify_cli-2026.6.25.1-py3-none-win_amd64.whl:
Publisher:
release.yml on Mergifyio/mergify-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mergify_cli-2026.6.25.1-py3-none-win_amd64.whl -
Subject digest:
952eff71dc72631fb05194519d63dcfd92da25b6af2e03f24f686b65b2e63e39 - Sigstore transparency entry: 1950320534
- Sigstore integration time:
-
Permalink:
Mergifyio/mergify-cli@71dd92c19711c58375ac3a5879b69fcb89675879 -
Branch / Tag:
refs/tags/2026.6.25.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@71dd92c19711c58375ac3a5879b69fcb89675879 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1283e03bf76e7f719651ef759958d4bb777d767ad5ae2fe4556ca11cb3f11a0c
|
|
| MD5 |
b6f1ded6101f23f9edf644b203efaad9
|
|
| BLAKE2b-256 |
3649f4d5f7bc22d730f69222bf82fbd900a4fd572a771d3cd40426a9700a11bb
|
Provenance
The following attestation bundles were made for mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on Mergifyio/mergify-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
1283e03bf76e7f719651ef759958d4bb777d767ad5ae2fe4556ca11cb3f11a0c - Sigstore transparency entry: 1950320320
- Sigstore integration time:
-
Permalink:
Mergifyio/mergify-cli@71dd92c19711c58375ac3a5879b69fcb89675879 -
Branch / Tag:
refs/tags/2026.6.25.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@71dd92c19711c58375ac3a5879b69fcb89675879 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 4.9 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f61d804bc568f32919bfdd0d190289bb71767e6caf3264f53083f4b55d4f5fc2
|
|
| MD5 |
0f64f50760db783cfd96e5f79d60ec7a
|
|
| BLAKE2b-256 |
143c0f7727563c04dc870c7cecb8960265322ab0d3a532d29018490ffbcf5775
|
Provenance
The following attestation bundles were made for mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on Mergifyio/mergify-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mergify_cli-2026.6.25.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
f61d804bc568f32919bfdd0d190289bb71767e6caf3264f53083f4b55d4f5fc2 - Sigstore transparency entry: 1950320771
- Sigstore integration time:
-
Permalink:
Mergifyio/mergify-cli@71dd92c19711c58375ac3a5879b69fcb89675879 -
Branch / Tag:
refs/tags/2026.6.25.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@71dd92c19711c58375ac3a5879b69fcb89675879 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mergify_cli-2026.6.25.1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: mergify_cli-2026.6.25.1-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.0 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2cd12e0d20a182be6aa32db2d1f5002c358b58fdc98936782039849187956b6
|
|
| MD5 |
7208458c252a8c70b2fed24a753eee63
|
|
| BLAKE2b-256 |
adc879b595468e605a4b7a27e370d25dc61f9747be60dce29970ab2bc009e32d
|
Provenance
The following attestation bundles were made for mergify_cli-2026.6.25.1-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on Mergifyio/mergify-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mergify_cli-2026.6.25.1-py3-none-macosx_11_0_arm64.whl -
Subject digest:
d2cd12e0d20a182be6aa32db2d1f5002c358b58fdc98936782039849187956b6 - Sigstore transparency entry: 1950319490
- Sigstore integration time:
-
Permalink:
Mergifyio/mergify-cli@71dd92c19711c58375ac3a5879b69fcb89675879 -
Branch / Tag:
refs/tags/2026.6.25.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@71dd92c19711c58375ac3a5879b69fcb89675879 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mergify_cli-2026.6.25.1-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: mergify_cli-2026.6.25.1-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d6a2b541325119e8d08869833bdd689bff8d78e855c942e2230ebe73c961c8a
|
|
| MD5 |
00567dc12e270fa6128e7e5c1eb3bf8a
|
|
| BLAKE2b-256 |
b633aa95a403a0ed663b720161f4a7fe98dc9cf8f2e322f3636bfd017d4978ec
|
Provenance
The following attestation bundles were made for mergify_cli-2026.6.25.1-py3-none-macosx_10_12_x86_64.whl:
Publisher:
release.yml on Mergifyio/mergify-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mergify_cli-2026.6.25.1-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
0d6a2b541325119e8d08869833bdd689bff8d78e855c942e2230ebe73c961c8a - Sigstore transparency entry: 1950321069
- Sigstore integration time:
-
Permalink:
Mergifyio/mergify-cli@71dd92c19711c58375ac3a5879b69fcb89675879 -
Branch / Tag:
refs/tags/2026.6.25.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@71dd92c19711c58375ac3a5879b69fcb89675879 -
Trigger Event:
release
-
Statement type: