TestRelic CLI overview
The TestRelic Ask AI agent in your terminal — a Claude Code-style interactive CLI with a full MCP host, written in Rust.
The TestRelic CLI runs the same Ask AI agent the web app uses — in a Claude Code-style inline terminal UI, written in Rust. It streams markdown, shows live tool activity, renders artifacts (dashboards, reports, test plans) directly in your scrollback, and acts as a full MCP host for your local tools.
One binary, three names:
testrelic # interactive UI
testrelic -p "why did the nightly regress?" # print mode (pipes welcome)
tr # same binary, shorter name
ask-ai # same binary, mnemonic aliasInstall in one line
Linux / macOS: curl -fsSL https://testrelic.ai/install.sh | sh
Windows (PowerShell): irm https://testrelic.ai/install.ps1 | iex
See Installation for targets, versions, and environment variables.
What it does
- Interactive agent chat against the TestRelic cloud — streamed markdown, live tool
activity (
⏺ tool(args)/⎿ result), artifacts, and token usage, in an inline terminal UI that scrolls into native scrollback (no alt-screen). - Every artifact renders in the terminal — New Relic-grade dashboards (KPI billboards, sparklines, braille charts, heat-colored tables), reports, test plans, navigation paths, data tables, code, and session cards. Live generation shows a streaming progress line.
- Tool confirmations — destructive tools (repo memory writes, alert CRUD) pause the stream for an Approve / Reject panel.
@context and!shell mode — attach repos, runs, branches, tests, environments, suites, or tags; run a local command whose output attaches to your next message.- Full MCP host — run local MCP servers (stdio or HTTP) whose tools the cloud agent can call. See MCP host.
- Headless print mode —
-pwith--output-format text|json|stream-jsonfor scripts and CI. See Artifacts & headless output.
Commands at a glance
Beyond the interactive agent, the CLI exposes commands for onboarding, IDE integration, and local config:
| Command | What it does |
|---|---|
setup | Deterministic, keys-only onboarding — --api-key tr_live_*, --mcp-token tr_mcp_*, --no-install. Wires up local config so the SDKs can upload. |
init | Agentic onboarding that inspects your project — --yes, --framework, --no-upload. |
login / logout | Authenticate or sign out. See Authentication. |
upload | Import existing Allure/JUnit reports into TestRelic Cloud. See Upload reports. |
map | Save a Project Map to your cloud repo memory. |
mcp add|list|remove | Manage local MCP servers the agent can call. See MCP host. |
studio | Launch the local studio — --path, --stop. |
results / run / complete | IDE Test Explorer integration. |
usage | Ask AI token usage against your org budget. |
artifacts | List, show, and export artifacts. See Artifacts. |
config get|set|list|path | Read and write local configuration. See Configuration. |
doctor | Auth, MCP, and terminal diagnostics. |
See Modes & engines for the --mode and --engine axes that apply
across the interactive agent.
Where to go next
Install
One-line install for Linux, macOS, and Windows, with version pinning and environment variables.
Quickstart
Log in, ask your first question, and learn the interactive basics in a couple of minutes.
Authentication
Session login for full parity, or a personal access token for headless and CI use.
MCP host
Add local MCP servers so the cloud agent can call your tools during a turn.
How it relates to the rest of TestRelic
The CLI is a client of the same cloud Ask AI agent surfaced in the web app and over
MCP. The SDK reporters send your test runs to the cloud; the CLI lets you
query and act on that data from the terminal. Authentication mirrors @testrelic/mcp —
the same tr_mcp_* token convention works for both.
Distribution
The CLI ships as prebuilt binaries for Linux, macOS, and Windows — there's nothing to compile. Install with the one-liner above; see Installation for supported targets and version pinning.
Next steps
MCP tools reference
Curated list of TestRelic MCP tools by capability—core, coverage, creation, healing, impact, triage, signals, devtools, ai, marketplace, apps, artifacts, sessions, and memory—with links to the full upstream catalog.
Install the TestRelic CLI
Install the testrelic CLI on Linux, macOS, or Windows with a one-line script, and pin a release with environment variables.