agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/newrelic-cli/SKILL.md

newrelic-cli

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Perform New Relic operations using the newrelic CLI and NerdGraph API. Use for querying entities, applications, alerts, and NRQL data.

  • Installs packages

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 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.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the profile table and rules below when constructing all newrelic CLI commands.

    line 8
  2. Distinctive:

    Update the table below with your New Relic CLI profile names:

    line 12
  3. Distinctive:

    If the target environment is unclear, ask the user before running any command.

    line 19
  4. Distinctive:

    If not already authenticated, inform the user that setup is required and ask them to complete the following steps manually.

    line 23
  5. Very specific:

    Always pass --profile explicitly — never rely on the default profile:

    line 33
  6. Distinctive:

    NEVER target a profile not listed in the configuration table above.

    line 83
  7. Very specific:

    Always pass --profile explicitly on every command — never rely on the default profile, which may point to the wrong account.

    line 84
  8. Distinctive:

    NEVER run delete operations without explicit user instruction — these are irreversible.

    line 85
  9. Very specific:

    NEVER print, display, or store New Relic API/license/ingest keys.

    line 86
  10. Very specific:

    If an entity GUID, policy ID, or account ID is unfamiliar, look it up with entity search or alerts policy list first.

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

New Relic CLI Skill

Use the profile table and rules below when constructing all newrelic CLI commands.

Configuration

Update the table below with your New Relic CLI profile names:

EnvironmentProfileAccount ID
Production<your-prod-profile><your-prod-account-id>
Staging<your-staging-profile><your-staging-account-id>

If the target environment is unclear, ask the user before running any command.

Prerequisites (one-time setup by user)

If not already authenticated, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.

brew install newrelic-cli
newrelic profile configure --profile <your-profile-name>
newrelic profile list

Command Format

Always pass --profile explicitly — never rely on the default profile:

newrelic <command> --profile <profile> [options]

Examples

# Run a NRQL query
newrelic nrql query --profile <your-staging-profile> --accountId <your-staging-account-id> --query "SELECT count(*) FROM Transaction SINCE 1 hour ago"

# List entities
newrelic entity search --profile <your-staging-profile> --name "<service-name>"

Available Commands

Read-only (safe, no confirmation needed)

CommandDescription
newrelic nrql queryRun a NRQL query
newrelic entity searchSearch for entities (services, hosts)
newrelic entity getGet details of an entity
newrelic apm application list/getList or describe APM applications
newrelic alerts policy listList alert policies
newrelic alerts condition listList alert conditions
newrelic profile listList configured CLI profiles

Mutating operations (confirm with user before running)

CommandDescription
newrelic alerts policy createCreate an alert policy
newrelic alerts condition createCreate an alert condition
newrelic edge createCreate an edge tracing/ingest resource
newrelic workload createCreate a workload

Never run — requires explicit human approval

CommandReason
newrelic alerts policy deleteIrreversible policy deletion
newrelic alerts condition deleteIrreversible condition deletion
newrelic apm application deleteRemoves an application entity
newrelic entity deleteIrreversibly deletes an entity

Rules

  • NEVER target a profile not listed in the configuration table above. If a command references an unfamiliar profile, stop and ask the user to confirm.
  • Always pass --profile explicitly on every command — never rely on the default profile, which may point to the wrong account.
  • NEVER run delete operations without explicit user instruction — these are irreversible.
  • NEVER print, display, or store New Relic API/license/ingest keys.
  • For NRQL queries, always include a SINCE/UNTIL time bound and a reasonable LIMIT to avoid excessive result sets.
  • If an entity GUID, policy ID, or account ID is unfamiliar, look it up with entity search or alerts policy list first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.