View as Markdown

CLI

Interact with Test Insights data from the terminal — search for tests, branch on health via exit codes, and chain into AI coding agents like Claude Code and Cursor.


The Mergify CLI lets you interact with Test Insights data from the terminal. It’s handy when you want to triage a failing test quickly, or when an AI coding agent needs to decide whether to retry, fix, or ignore a failure.

Every command also accepts --json for machine-readable output and --help for the full list of flags.

mergify tests show #

Search the Test Insights catalog by test name and print each match’s health, failure ratios, and most recent failure context. Names accept glob patterns (*, ?), and several can be passed in one call. See the API reference for the underlying endpoints and response schemas.

mergify tests quarantines add #

Add a test to quarantine so its failures stop blocking merges and no longer mark the pipeline as failed. The test keeps running, and its results keep flowing into Test Insights. Pass the fully qualified test name and a --reason; the quarantine covers every branch unless you scope it with --branch. The command prints a quarantine ID you can pass to remove or get.

mergify tests quarantines remove #

Remove a test from quarantine, addressed either by its fully qualified name or by the quarantine ID that add printed. A UUID-shaped argument is treated as the ID and removed directly; anything else is looked up by name.

mergify tests quarantines get #

Print a single quarantine, addressed by the test’s fully qualified name or its quarantine ID (a UUID-shaped argument is matched against the ID). The output mirrors one record of list.

mergify tests quarantines list #

List every test currently in quarantine for a repository. It’s handy for reviewing what’s being ignored, or for looking up a quarantine ID to pass to remove or get. Each record carries its quarantine ID, the branch it’s scoped to (* for all branches), the source (manual or auto), whether it has recovered, and the reason.

mergify tests show reports a test’s health through its exit code, so an agent can branch on a failure without parsing output: 0 healthy or unknown, 1 flaky, 6 broken. Wire it into Claude Code as a skill or Cursor as a project rule to rerun flaky tests, surface broken ones, and treat healthy ones as real regressions.

Was this page helpful?