View as Markdown

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.

Install the CLI using uv:

Terminal window
uv tool install mergify-cli

Or using pipx:

Terminal window
pipx install mergify-cli

On macOS, you can install these tools via Homebrew:

Terminal window
brew install uv
uv tool install mergify-cli

The 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:

Terminal window
export GITHUB_TOKEN=your_token_here

Or pass it directly to any command:

Terminal window
mergify --token your_token_here <command>
OptionDescription
--token, -tGitHub or Mergify authentication token
--repository, -rRepository full name (owner/repo)
--api-url, -uMergify API URL (default: https://api.mergify.com)
CommandDescriptionDocumentation
mergify stackCreate and manage stacked pull requestsStacks
mergify freezeSchedule and manage merge freezesScheduling Freezes
mergify queueMonitor merge queue statusMonitoring
mergify ciUpload and analyze CI resultsCI Insights

Was this page helpful?