Skip to main content

Mergify CLI

CI Latest release Documentation

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

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.

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.

mergify ci skips step 3: its endpoints take a CI credential, and refuse the per-user one mergify auth login mints by design. On GitHub Actions it goes on to step 4; on any other CI, MERGIFY_TOKEN holds a Mergify CI key. With an application key in MERGIFY_TOKEN, mergify auth status names the key, its permissions and when it expires: a refused request never says which permission it lacked.

mergify stack also calls the GitHub API directly, and resolves that token separately (--token, MERGIFY_TOKEN, GITHUB_TOKEN, gh auth token). It is unaffected by the change above: stack needs a GitHub credential and Mergify never issues one. A Mergify-issued token (mut_…) is skipped there rather than sent to GitHub, which would only answer 401 Bad credentials — in MERGIFY_TOKEN, in GITHUB_TOKEN, and in what gh auth token returns, since it echoes GITHUB_TOKEN when that is set. Only an explicit --token is sent as given.

The repository and API URL resolve as before:

What --flag then env then
Repository --repository / -r GITHUB_REPOSITORY git remote (origin)
API URL --api-url / -u MERGIFY_API_URL https://api.mergify.com

Credentials are stored per API URL, so one machine can hold a credential for the hosted service and one for an on-premise install.

A Mergify application key holds the permissions it was granted, resource by resource. A CI key holds CI Reporting, what a CI job does: trace upload, ci scopes-send, quarantine evaluation and the quarantine list. Trace upload and ci scopes-send need CI Reporting, and answer a key without it or a user credential with 403 Forbidden. The mergify tests commands that read test health, change the quarantine or set test retry answer a CI key with 403 Forbidden: they take a key with the permission their --help names, or a user credential, the one mergify auth login stores. GITHUB_TOKEN is not a Mergify credential and does not reach the Mergify API.

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
mergify queue add 123              # queue a pull request (number or URL)

# Test Engine — 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 auth — Sign in to Mergify and manage the stored credential (login, logout, status).
  • mergify stack — Create and maintain stacked pull requests. Docs
  • mergify queue — Inspect and control the merge queue. Docs
  • mergify events — Browse the events Mergify recorded for the repository or one pull request, as a timeline or JSON.
  • mergify ci — Send JUnit results and pull request scopes from any CI provider. Docs
  • mergify tests — Look up test health, manage the flaky-test quarantine, and turn test retry on or off. Docs
  • mergify oidc — Write the trust policies that let GitHub Actions jobs reach Mergify with their ID token instead of a stored key, and read why a job's exchange was refused. Takes the organization with --org, else the owner of the repository. Docs
  • mergify freeze — Schedule merge freezes for release windows and maintenance. Docs
  • mergify config — Validate your configuration and simulate actions before you merge. Docs
  • mergify 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 API token. Takes precedence over a stored mergify auth login credential. Unset in a GitHub Actions job granted id-token: write, a command exchanges the job's ID token instead.
GITHUB_TOKEN Not a Mergify API credential. Still the GitHub token mergify stack uses.
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. Must be set to a non-empty value; exported-but-empty counts as unset.
FORCE_COLOR, CLICOLOR_FORCE Force colored output when it would otherwise be off. Same non-empty rule, and NO_COLOR wins over both. All three apply to --color auto only.
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 or credentials missing, unparseable, or failing validation (including "not logged in").

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 install mergify@claude-plugins-official

Documentation

Full reference and guides live at docs.mergify.com/cli.

Contributing

Bug reports and feature requests are welcome: open an issue. The CLI is developed by Mergify; this repository publishes it: the releases, the installer, the agent skills and this README, all updated with each release. Suggestions to install.sh, skills/ or the documentation are welcome as issues too. See AGENTS.md for what lives where.

License

Proprietary — see LICENSE. Use is governed by the Mergify Terms of Service.

Metadata

Release files for mergify-cli 2026.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for mergify-cli 2026.12.2
File Actions
mergify_cli-2026.12.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for mergify_cli-2026.12.2-py3-none-win_amd64.whl
mergify_cli-2026.12.2-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for mergify_cli-2026.12.2-py3-none-musllinux_1_2_x86_64.whl
mergify_cli-2026.12.2-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for mergify_cli-2026.12.2-py3-none-musllinux_1_2_aarch64.whl
mergify_cli-2026.12.2-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for mergify_cli-2026.12.2-py3-none-manylinux_2_28_x86_64.whl
mergify_cli-2026.12.2-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for mergify_cli-2026.12.2-py3-none-manylinux_2_28_aarch64.whl
mergify_cli-2026.12.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for mergify_cli-2026.12.2-py3-none-macosx_11_0_arm64.whl
mergify_cli-2026.12.2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for mergify_cli-2026.12.2-py3-none-macosx_10_12_x86_64.whl

Total release size: 65.9 MB

Release files / mergify_cli-2026.12.2-py3-none-win_amd64.whl

Download URL mergify_cli-2026.12.2-py3-none-win_amd64.whl
Size 8.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
df350b30de92875e17d42764b464e0b22057879b14c15a812240406be5932345
BLAKE2b-256 checksum
How to use checksums
1a12d3f054465c9c03b8d498c0425a38bba7f2fa39e5e683c94b975ed797c443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mergify_cli-2026.12.2-py3-none-musllinux_1_2_x86_64.whl

Download URL mergify_cli-2026.12.2-py3-none-musllinux_1_2_x86_64.whl
Size 10.3 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
cbae82eff480b129f1ad171b64b45f6146e3c6162c02103d0cb16bfdb2c5f472
BLAKE2b-256 checksum
How to use checksums
22b6a88a9e33e5342d89ab846f0786a49147b8fe5d62e61cf07b7388a72bfb32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mergify_cli-2026.12.2-py3-none-musllinux_1_2_aarch64.whl

Download URL mergify_cli-2026.12.2-py3-none-musllinux_1_2_aarch64.whl
Size 9.6 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
303190662a90025f622cb621dad498b8cbeb657ee3d98ab86334544aa9f5af8f
BLAKE2b-256 checksum
How to use checksums
4da06f0a6fa1e223b0f473951883c2001dd49e2f4fc5b7afb6782a83f2e04150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mergify_cli-2026.12.2-py3-none-manylinux_2_28_x86_64.whl

Download URL mergify_cli-2026.12.2-py3-none-manylinux_2_28_x86_64.whl
Size 10.3 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
596371e3730c76cac1f8e123e052956c00aee11663b0d797dfb2ad8c4103df63
BLAKE2b-256 checksum
How to use checksums
722ba2aa1eff812fe5f8f5182d2d294338a1e51a5c99f6c344e7764060454990
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mergify_cli-2026.12.2-py3-none-manylinux_2_28_aarch64.whl

Download URL mergify_cli-2026.12.2-py3-none-manylinux_2_28_aarch64.whl
Size 9.6 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
8cdb42e0458e1815398eb27372c74feff7d2b57621c1c191c2cb0a84575a5ace
BLAKE2b-256 checksum
How to use checksums
8961360f0b84ee48074f38df8c96e66daeba916392d3a85611824dfaae929a2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mergify_cli-2026.12.2-py3-none-macosx_11_0_arm64.whl

Download URL mergify_cli-2026.12.2-py3-none-macosx_11_0_arm64.whl
Size 8.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1321099147fb994239af4cd9cf69914e775169eaf98952e825832846fd111244
BLAKE2b-256 checksum
How to use checksums
b13220b5d3cc14a4d5d1a2900330bc5bbd0d044c37aa98abfb43010d607fc434
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mergify_cli-2026.12.2-py3-none-macosx_10_12_x86_64.whl

Download URL mergify_cli-2026.12.2-py3-none-macosx_10_12_x86_64.whl
Size 9.0 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c179ec525f560e36e22d28db0c82b2b8589d877a2871cd266445acc680355d05
BLAKE2b-256 checksum
How to use checksums
0aa06c0223fadcc36bcf72a75d416c890d59f7ab3fd492368984a1ac27dc2673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for mergify-cli 2026.12.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for mergify_cli-2026.12.2-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page