{
  "markdown": "# Mergify CLI\n\n[![CI](https://github.com/Mergifyio/mergify-cli/actions/workflows/ci.yaml/badge.svg)](https://github.com/Mergifyio/mergify-cli/actions/workflows/ci.yaml)\n[![Latest release](https://img.shields.io/github/v/release/Mergifyio/mergify-cli?logo=github&label=release)](https://github.com/Mergifyio/mergify-cli/releases/latest)\n[![Documentation](https://img.shields.io/badge/docs-mergify.com-7c3aed)](https://docs.mergify.com/cli/)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)\n\nDrive [Mergify](https://mergify.com) from your terminal and CI pipelines:\nstacked pull requests, the merge queue, CI Insights, scheduled freezes, and\nconfiguration — all from a single self-contained binary that reuses your\nexisting GitHub (`gh`) login.\n\n```shell\nmergify stack push          # turn your local commits into stacked PRs\nmergify queue status        # inspect the merge queue\nmergify ci junit-process report.xml   # upload test results to CI Insights\n```\n\n- **One static binary.** No runtime, no dependencies — drop it on a developer\n  laptop or a CI runner and go.\n- **Zero-config auth.** Picks up `gh auth token` automatically; override with\n  env vars or flags when scripting.\n- **Built for pipelines.** Logs to stderr, structured `--json` output on read\n  commands, and stable [exit codes](#exit-codes) for scripts and runbooks.\n- **Cross-platform.** Linux, macOS (x86_64 + aarch64), and Windows.\n\n## Installation\n\n### Homebrew (recommended for macOS)\n\n```shell\nbrew install mergifyio/tap/mergify-cli\n```\n\nThe fully-qualified name taps and installs in one step. Upgrade with\n`brew upgrade mergify-cli` — not `mergify self-update`, which overwrites the\nHomebrew-managed binary. See the [tap](https://github.com/Mergifyio/homebrew-tap)\nfor tap-trust and short-name details.\n\n### Install script (recommended for Linux; also macOS — x86_64 and aarch64)\n\n```shell\ncurl -fsSL https://raw.githubusercontent.com/Mergifyio/mergify-cli/main/install.sh | sh\n```\n\nInstalls to `~/.local/bin/mergify`. Override with `MERGIFY_INSTALL_DIR=/usr/local/bin`\nor pin a version with `MERGIFY_VERSION=<version>`. Upgrade with `mergify self-update`.\n\n### Manual download (Windows, or to bypass the script)\n\nGrab the matching archive from the\n[latest release](https://github.com/Mergifyio/mergify-cli/releases/latest):\n\n- **Windows** — download `mergify-<version>-x86_64-pc-windows-msvc.zip`,\n  extract it, and put `mergify.exe` anywhere on your `PATH`.\n- **Linux / macOS** — download `mergify-<version>-<target>.tar.gz` (e.g.\n  `mergify-2026.4.23.1-aarch64-apple-darwin.tar.gz`), extract with `tar -xzf`,\n  and put the resulting `mergify` binary anywhere on your `PATH`.\n\nVerify against `SHA256SUMS` from the same release if you care.\n\n## Authentication\n\nMost commands talk to the Mergify and GitHub APIs and need a token. The CLI\nresolves credentials and target repository in this order, so an authenticated\n`gh` is usually all you need:\n\n| What | `--flag` | then env | then |\n| --- | --- | --- | --- |\n| **Token** | `--token` / `-t` | `MERGIFY_TOKEN`, `GITHUB_TOKEN` | `gh auth token` |\n| **Repository** | `--repository` / `-r` | `GITHUB_REPOSITORY` | `git remote` (`origin`) |\n| **API URL** | `--api-url` / `-u` | `MERGIFY_API_URL` | `https://api.mergify.com` |\n\nSee the [authentication guide](https://docs.mergify.com/cli/usage) for details.\n\n## Quick start\n\n```shell\n# Stacked pull requests — one PR per commit, kept in sync\nmergify stack setup                # once per repo: install the git hooks the stack needs\nmergify stack push                 # push commits and create/update their PRs\nmergify stack list                 # show the stack and its PR status\nmergify stack sync                 # rebase the stack onto its trunk\n\n# Merge queue\nmergify queue status               # current queue state for the repo\nmergify queue status --json        # same, as machine-readable JSON\n\n# CI Insights — from inside your pipeline\nmergify ci junit-process report.xml --test-language python\n\n# Configuration\nmergify config validate            # check .mergify.yml against the schema\n```\n\nRun `mergify --help` for the full command list and `mergify <command> --help`\nfor any command's flags.\n\n## Commands\n\nEvery command group maps to a section of the\n[CLI reference](https://docs.mergify.com/cli/).\n\n- **`mergify stack`** — Create and maintain stacked pull requests.\n  [Docs](https://docs.mergify.com/stacks/)\n- **`mergify queue`** — Inspect and control the merge queue.\n  [Docs](https://docs.mergify.com/merge-queue/)\n- **`mergify events`** — Browse the events Mergify recorded for the\n  repository or one pull request, as a timeline or JSON.\n- **`mergify ci`** — Send JUnit results and pull request scopes from any CI\n  provider. [Docs](https://docs.mergify.com/ci-insights/)\n- **`mergify tests`** — Look up test health and manage the flaky-test\n  quarantine. [Docs](https://docs.mergify.com/ci-insights/)\n- **`mergify freeze`** — Schedule merge freezes for release windows and\n  maintenance. [Docs](https://docs.mergify.com/merge-protections/freeze/)\n- **`mergify config`** — Validate your configuration and simulate actions\n  before you merge. [Docs](https://docs.mergify.com/configuration/file-format/#validating-with-the-cli)\n- **`mergify self-update`** — Update the CLI to the latest release.\n- **`mergify completions <shell>`** — Print a shell completion script\n  ([see below](#shell-completions)).\n\nRun `mergify <command> --help` for a group's subcommands and flags.\n\n## Shell completions\n\nGenerate a completion script for your shell — `bash`, `zsh`, `fish`,\n`elvish`, or `powershell`:\n\n```shell\n# zsh — write to a directory on your $fpath\nmergify completions zsh > ~/.zfunc/_mergify\n\n# bash — load in your current session (add to ~/.bashrc to persist)\nsource <(mergify completions bash)\n\n# fish\nmergify completions fish > ~/.config/fish/completions/mergify.fish\n```\n\n## Global options\n\nThese are accepted on every command:\n\n| Flag | Description |\n| --- | --- |\n| `-v`, `--verbose` | Increase log verbosity: `-v` info, `-vv` debug, `-vvv` trace. Logs go to stderr so stdout stays pipeable. |\n| `--debug` | Shorthand for at least debug-level logging (like `-vv`). |\n| `--color <auto\\|always\\|never>` | When to colorize terminal output. |\n\n## Environment variables\n\n| Variable | Effect |\n| --- | --- |\n| `MERGIFY_TOKEN`, `GITHUB_TOKEN` | API token (falls back to `gh auth token`). |\n| `GITHUB_REPOSITORY` | Default `owner/repo` when `--repository` is omitted. |\n| `MERGIFY_API_URL` | API base URL (default `https://api.mergify.com`). |\n| `RUST_LOG` | Fine-grained log filtering; overrides `--verbose`. |\n| `NO_COLOR` | Disable colored output. |\n| `MERGIFY_INSTALL_DIR`, `MERGIFY_VERSION` | Install-script target directory / pinned version. |\n\n## Exit codes\n\nCommands return stable exit codes so scripts and runbooks can branch on them:\n\n| Code | Meaning |\n| --- | --- |\n| `0` | Success. |\n| `1` | Unclassified runtime failure (I/O error, bug, or captured panic). |\n| `2` | Argument parsing / usage error. |\n| `3` | Stack, branch, or commit not found. |\n| `4` | Rebase or merge conflict. |\n| `5` | GitHub API request failed. |\n| `6` | Mergify API request failed. |\n| `7` | CLI invariant violated (e.g. run outside a valid context). |\n| `8` | Configuration missing, unparseable, or failing validation. |\n\n## AI Agent Skills\n\nMergify CLI provides AI skills for managing stacked PRs and Git workflows,\ncompatible with [Claude Code](https://docs.anthropic.com/en/docs/claude-code),\n[Cursor](https://cursor.sh), and [many other AI agents](https://skills.sh).\n\nInstall via npx (all agents):\n\n```shell\nnpx skills add Mergifyio/mergify-cli\n```\n\nInstall as a Claude Code plugin:\n\n```shell\n/plugin install mergify@claude-plugins-official\n```\n\n## Documentation\n\nFull reference and guides live at\n**[docs.mergify.com/cli](https://docs.mergify.com/cli/)**.\n\n## Contributing\n\nContributions are welcome — open an\n[issue](https://github.com/Mergifyio/mergify-cli/issues) or a pull request.\nThe workspace is a Rust monorepo; see [AGENTS.md](AGENTS.md) for the crate\nlayout, build, and test workflow.\n\n## License\n\nApache License 2.0 — see [LICENSE](LICENSE).\n",
  "bytes": 8161,
  "sha": "a33316890a6fef0df100867ea6b44639a4a93a973a6ef51449716e3ed1174e56",
  "repo_slug": "mergifyio/mergify-cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_mergifyio_mergify_cli_mergify_dd77f172/readme"
}