New Relic CLI
$ newrelic Official Med RiskOfficial command-line client for New Relic observability, executing NRQL queries, NerdGraph GraphQL operations, deployment markers, and entity searches. Returns JSON by default on query/search subcommands and authenticates cleanly via NEW_RELIC_API_KEY.
brew install newrelic-cli Prefer newrelic CLI for fast NRQL and NerdGraph JSON queries in coding/on-call workflows without extra MCP schema overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Outputs clean JSON by default on nrql query, nerdgraph query, and entity search, with straightforward env-var authentication.
newrelic nrql queryandnewrelic nerdgraph queryemit JSON- Headless auth via
NEW_RELIC_API_KEYandNEW_RELIC_ACCOUNT_ID
Clean profile separation and read-only NRQL/entity query commands, though NerdGraph mutations can alter alerts/synthetics.
- Named profiles in
~/.newrelic/and read-only NRQL queries
Single static Go binary available via Homebrew and official releases across macOS, Linux, and Windows.
- Zero-dependency Go executable
Covers NRQL telemetry, NerdGraph GraphQL escape hatch, entity search, and deployment markers.
- Direct
nerdgraph queryaccess covers the full platform API
Official New Relic CLI maintained under Apache-2.0.
- First-party
newrelic/newrelic-clirepository
Well-documented command guide in New Relic docs and subcommand --help.
- Official docs covering NRQL, NerdGraph, and profiles
Security, Auth & Guardrails
Stores profiles in ~/.newrelic/credentials.json and supports NEW_RELIC_API_KEY, NEW_RELIC_ACCOUNT_ID, and NEW_RELIC_REGION env vars.
Apache-2.0 open-source Go CLI; queries and ingest count toward your New Relic subscription.
# New Relic CLI (newrelic) Agent Rules - Set `NEW_RELIC_API_KEY` and `NEW_RELIC_ACCOUNT_ID` for non-interactive queries. - Prefer read-only `newrelic nrql query` and `newrelic entity search` when triaging incidents; confirm before mutating alerts or workloads.
Agent-Ready Command Recipes
Safe Read-Only Queries
newrelic nrql query --query "SELECT count(*) FROM Transaction SINCE 1 hour ago"
Executes a read-only NRQL query and prints structured JSON results.
newrelic entity search --name checkout-service
Searches APM services and infrastructure entities, returning JSON metadata and GUIDs.
Controlled Writes & Previews
newrelic entity deployment create --guid <entity-guid> --version 1.2.3
Attaches a version deployment marker to an entity GUID in New Relic.
Strengths for Agents
- + Default JSON output on
nrql query,nerdgraph query, andentity search. - + Single Go binary with clean
NEW_RELIC_API_KEY/NEW_RELIC_ACCOUNT_IDenv support. - +
newrelic nerdgraph queryprovides full GraphQL API coverage.
Caveats & Pitfalls
- ! Running
newrelic installlaunches interactive guided instrumentation installers—avoid in headless agents. - ! API key permissions determine whether NerdGraph mutations are allowed.