Command Line Interface (CLI)
Install and configure the Mergify CLI to manage your merge queue, freezes, and stacked PRs from the terminal.
The Mergify CLI lets you interact with Mergify features directly from your terminal.
Installation
Section titled InstallationInstall the CLI using uv:
uv tool install mergify-cliOr using pipx:
pipx install mergify-cliOn macOS, you can install these tools via Homebrew:
brew install uvuv tool install mergify-cliAuthentication
Section titled AuthenticationThe CLI needs an authentication token to interact with your repositories. Depending on the command, this can be a GitHub token or a Mergify API token.
If you have the GitHub CLI (gh) installed and
authenticated, the Mergify CLI automatically uses its token for commands that
require GitHub access. No extra configuration needed.
Otherwise, create a personal access token and either set it as an environment variable:
export GITHUB_TOKEN=your_token_hereOr pass it directly to any command:
mergify --token your_token_here <command>Global Options
Section titled Global Options| Option | Description |
|---|---|
--token, -t | GitHub or Mergify authentication token |
--repository, -r | Repository full name (owner/repo) |
--api-url, -u | Mergify API URL (default: https://api.mergify.com) |
Available Commands
Section titled Available Commands| Command | Description | Documentation |
|---|---|---|
mergify stack | Create and manage stacked pull requests | Stacks |
mergify freeze | Schedule and manage merge freezes | Scheduling Freezes |
mergify queue | Monitor merge queue status | Monitoring |
mergify ci | Upload and analyze CI results | CI Insights |
Was this page helpful?
Thanks for your feedback!