Mergify CLI

2026.4.14.1 · active · verified Fri Apr 17

Mergify CLI is a command-line interface tool designed to automate the creation and management of stacked pull requests on GitHub. It also handles CI results upload and integrates with various GitHub workflows. The library maintains a rapid release cadence, often daily or weekly, with frequent updates and new features, currently at version 2026.4.14.1.

Common errors

Warnings

Install

Quickstart

The Mergify CLI is primarily used as a command-line tool. The quickstart guides you through installation, initial setup (including GitHub token configuration), and common `stack` commands like `push` and `status`. Run `mergify setup` interactively for the easiest initial configuration.

# 1. Install mergify-cli
pip install mergify-cli

# 2. Set up your GitHub token (replaces MERGIFY_TOKEN with your actual token)
#    or run `mergify setup` for interactive configuration.
export MERGIFY_TOKEN="ghp_YOUR_GITHUB_TOKEN"

# 3. Initialize Mergify CLI in your Git repository
#    This will guide you through connecting to GitHub.
mergify setup

# 4. Create and push a stacked pull request
#    (Assuming you have local commits on a feature branch)
mergify stack push

# 5. Check the status of your current stack
mergify stack status

# 6. Checkout a specific stack by name
# mergify stack checkout my-feature-stack

view raw JSON →