newrelic-cli
Skill1 starsChanged 3 months agoMITView on GitHub
Query and manage New Relic observability data using the newrelic CLI across all your organization's accounts. Trigger on: newrelic, nrql, apm, deployment marker, alert policy, observability query, error rate, throughput, latency, SLO/SLI.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- abdullahkhawer/devops-skillstheir own version, first seen May 7, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- abdullahkhawer/devops-skills★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- alloy-structural-analysisSkill
- analyzing-architectureSkill
- color-accessibilitySkill
- daily-briefingSkill
- design-docSkill
- diagramSkill
- eng-career-goals-writerSkill
- gh-repo-managementSkill
- git-commit-helperSkill
- jiraSkill
- jqSkill
- morphirSkill
- oli-storage-managerSkill
- project-instructorSkill
- qmd-searchSkill
- rigorous-reviewSkill
- save-zkSkill
- scalaSkill
- smart-initSkill
- sourcegraph-searchSkill
- structured-memorySkill
- visualizeSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
If the user names an environment (e.g.
- Very specific: line 30
If they name a slot (e.g. "services", "envoy", "cardinal"), match against the slot field within the target environment.
- Distinctive: line 32
If they give a numeric account ID, use it directly.
- Very specific: line 33
If they name an alias (e.g.
- Distinctive: line 35
Defaults: when no account is specified:
- Very specific: line 41
Always confirm which account you resolved to before running the query, e.g.: "Querying Services Production ($ACCOUNT_ID)..."
- Very specific: line 134
Resolve account: Read accounts.json, match environment/slot/alias.
- Distinctive: line 137
Execute: Run via Bash and return results.
- Distinctive: line 173
When a question spans multiple accounts (e.g.
- Very specific: line 179
If newrelic is not installed, suggest: brew install newrelic-cli
- Very specific: line 180
If authentication fails, check newrelic profile list and suggest newrelic profile add
- Distinctive: line 182
If an account ID is ambiguous (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
What this skill does
Translates natural-language observability questions into newrelic CLI commands,
resolving account names to numeric IDs automatically. It knows every
New Relic account, which environment and service slot each belongs to, and
which region (US/EU) to use.
Account resolution
A bundled accounts.json (sibling to this file) maps every New Relic
account. Read it at the start of any task to resolve accounts.
Resolution rules
- If the user names an environment (e.g. "production", "test", "uk-prod"),
match against the
environmentfield. - If they name a slot (e.g. "services", "envoy", "cardinal"), match against
the
slotfield within the target environment. - If they give a numeric account ID, use it directly.
- If they name an alias (e.g. "Acme_Corp_1", "My_Org"), match
against the
aliasfield. - Defaults when no account is specified:
- Service-specific queries (transactions, throughput, errors) ->
$DEFAULT_SERVICES_ACCOUNT - General queries (infrastructure, custom events) ->
$DEFAULT_MAIN_ACCOUNT
- Service-specific queries (transactions, throughput, errors) ->
Always confirm which account you resolved to before running the query, e.g.: "Querying Services Production ($ACCOUNT_ID)..."
CLI command reference
NRQL queries
The most common operation. Always include --accountId and default to
--format JSON for structured output.
newrelic nrql query --accountId <ID> --query '<NRQL>' --format JSONExample patterns:
# Transaction throughput
newrelic nrql query --accountId $ACCOUNT_ID \
--query "SELECT rate(count(*), 1 minute) FROM Transaction WHERE appName = 'my-service' TIMESERIES SINCE 1 hour ago" \
--format JSON
# Error rate
newrelic nrql query --accountId $ACCOUNT_ID \
--query "SELECT percentage(count(*), WHERE error IS true) FROM Transaction WHERE appName = 'my-service' SINCE 1 hour ago" \
--format JSON
# P99 latency
newrelic nrql query --accountId $ACCOUNT_ID \
--query "SELECT percentile(duration, 99) FROM Transaction WHERE appName = 'my-service' TIMESERIES SINCE 1 hour ago" \
--format JSONEntity search
Find applications, hosts, containers, and other entities.
newrelic entity search --name <NAME>
newrelic entity search --name <NAME> --domain APM --type APPLICATION
newrelic entity search --tag "environment:production"Useful filters: --domain (APM, INFRA, BROWSER, SYNTH, etc.),
--type (APPLICATION, HOST, CONTAINER, etc.), --tag, --alert-severity,
--reporting.
APM operations
# Search for an application
newrelic apm application search --accountId <ID> --name <APP_NAME>
# Record a deployment
newrelic apm deployment create --applicationId <APP_ID> --revision <SHA>Profile management
Profiles store API keys and default account IDs for repeated use.
newrelic profile list
newrelic profile add --name <PROFILE> --apiKey <KEY> --region <US|EU> --accountId <ID>
newrelic profile default --name <PROFILE>NerdGraph (GraphQL)
For advanced queries not covered by built-in commands.
newrelic nerdgraph query '{ actor { user { email } } }'Custom events
newrelic events post --accountId <ID> --event '{"eventType":"Deployment","revision":"abc123"}'Environment variables
| Variable | Purpose |
NEW_RELIC_API_KEY | Personal API key (NRAK-...) |
NEW_RELIC_ACCOUNT_ID | Default account ID |
NEW_RELIC_REGION | US (default) or EU |
NEW_RELIC_LICENSE_KEY | License key (for posting events) |
Workflow
- Parse intent: What does the user want to know or do?
- Resolve account: Read
accounts.json, match environment/slot/alias. - Build command: Construct the
newrelicCLI invocation. - Show the user: Display the resolved account and command before running.
- Execute: Run via Bash and return results.
- Interpret: Summarize the data in plain language -- highlight anomalies, trends, or notable values.
Common NRQL patterns
These patterns cover the most frequent observability questions:
-- Service health overview
SELECT count(*), average(duration), percentage(count(*), WHERE error IS true)
FROM Transaction WHERE appName = '{service}'
SINCE 1 hour ago
-- Top slow transactions
SELECT average(duration), count(*)
FROM Transaction WHERE appName = '{service}'
FACET name SINCE 1 hour ago LIMIT 10
-- Error breakdown
SELECT count(*) FROM TransactionError
WHERE appName = '{service}' FACET error.class SINCE 1 hour ago
-- Infrastructure (CPU/memory) -- use main account
SELECT average(cpuPercent), average(memoryUsedPercent)
FROM SystemSample WHERE hostname LIKE '%{service}%'
SINCE 1 hour ago TIMESERIES
-- Kafka consumer lag -- use services account
SELECT average(consumer.totalLag)
FROM KafkaOffsetSample WHERE consumerGroup LIKE '%{service}%'
FACET topic SINCE 1 hour agoMulti-account queries
When a question spans multiple accounts (e.g. "compare prod vs test error rates"), run separate queries against each account and present the results side by side. Label each result clearly with the account name and environment.
Error handling
- If
newrelicis not installed, suggest:brew install newrelic-cli - If authentication fails, check
newrelic profile listand suggestnewrelic profile add - If an account ID is ambiguous (e.g. "services" without an environment), ask the user to clarify which environment
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

