Skip to main content

Mergify CLI

CI Latest release Documentation

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.
  • 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.
  • Built for pipelines. Logs to stderr, structured --json output on read commands, and stable exit codes for scripts and runbooks.
  • Cross-platform. Linux, macOS (x86_64 + aarch64), 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 GITHUB_TOKEN deprecated
5 gh auth token deprecated

A GitHub token still authenticates against the Mergify API and prints a deprecation warning once per run. It will stop working in a future release; run mergify auth login instead. In CI, set MERGIFY_TOKEN — nothing about that changes.

mergify ci skips step 3. Those endpoints require an organization application key, which is what MERGIFY_TOKEN holds in a CI job; the per-user credential mergify auth login mints is refused there by design.

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 deprecation 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.

Mergify application keys come in two classes, each reaching its own set of endpoints rather than one being a subset of the other. A ci key is scoped to what a CI job does — trace upload, ci scopes-send, quarantine evaluation and the quarantine list. Trace upload and ci scopes-send take a ci key only, and answer an admin key or a user credential with 403 Forbidden. Reading test health (mergify tests show) and changing the quarantine (mergify tests quarantines add / remove) need an admin key or a user credential — the one mergify auth login stores, or a GitHub PAT — and answer a ci key with 403 Forbidden. Note that GITHUB_TOKEN inside GitHub Actions is the ephemeral installation token, not a PAT, 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

# 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 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 and manage the flaky-test quarantine. 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.
GITHUB_TOKEN Deprecated as a Mergify API credential (falls back to gh auth token); 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.10.5

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.10.5
File
mergify_cli-2026.10.5-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
mergify_cli-2026.10.5-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
mergify_cli-2026.10.5-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
mergify_cli-2026.10.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
mergify_cli-2026.10.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
mergify_cli-2026.10.5-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
mergify_cli-2026.10.5-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 48.3 MB

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

Download URL mergify_cli-2026.10.5-py3-none-win_amd64.whl
Size 6.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
39e0fc2752fa4a91a7e94890d1707988ebab62e053fdae5563f8efeb8bbd8520
BLAKE2b-256 checksum
How to use checksums
26d705203d62e9e6cc1e116cb3150fcacea2e8dae26cc8b7a6848cd5da0ada99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

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

Download URL mergify_cli-2026.10.5-py3-none-musllinux_1_2_x86_64.whl
Size 7.7 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
7d13abea6a90f2d416d10e166e54bfe86e905aab9c91de373d7438090e7cf7f4
BLAKE2b-256 checksum
How to use checksums
f9551e886a74fd0f8b09d49d078e32141965942efe37204ec673ebfd7f783dfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

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

Download URL mergify_cli-2026.10.5-py3-none-musllinux_1_2_aarch64.whl
Size 7.1 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
d4bd58653236f8c0e33f0302bf81ca65595ede9f6d247933580cfa2236cdcb2b
BLAKE2b-256 checksum
How to use checksums
e2d16ae1c70b22d2f7b4df9b496bb6154f1e6ede955a1ceeffe846ee48e2ce63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

Release files / mergify_cli-2026.10.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mergify_cli-2026.10.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.6 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
238e4302cf6bfa6eda18dc6dd748b847716a135e603f1a3f3e21f1e5990496e8
BLAKE2b-256 checksum
How to use checksums
797617748cf7f1d9961c28283e6d90277b758c77b195757fd03662042377f013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

Release files / mergify_cli-2026.10.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mergify_cli-2026.10.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 7.1 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
6e6ed6c2c41e2994de297b5bbcebf43c29475bdef1a1369f6d8ff1ca3411be44
BLAKE2b-256 checksum
How to use checksums
90f7e31a27f849b33d8c58c1c0f3e5eea951a1775670380acaef582dd0bc5a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

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

Download URL mergify_cli-2026.10.5-py3-none-macosx_11_0_arm64.whl
Size 6.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3b7b33476c824e9221b5216411f87affc72f97e816316caaf597f5f2dec2622c
BLAKE2b-256 checksum
How to use checksums
40d38d4b2b443c2b052e956a5d246809fda4468d3e607600438ca8a4af02ec81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

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

Download URL mergify_cli-2026.10.5-py3-none-macosx_10_12_x86_64.whl
Size 6.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
07e8a5a4a6fe07f8607803c1225fab2c3df8c2957e1769098c5358c1c1eed0bf
BLAKE2b-256 checksum
How to use checksums
6fd1d3ffc82179692935f1bea9a9c61523ed32ad32284358b0ee7a9cf9807674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.10.5 This release

7 release files

0.1.1

2 release files

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