KosmoKrator

analytics

New Relic CLI for AI Agents

Use the New Relic CLI from KosmoKrator to call New Relic tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

New Relic CLI Setup

New Relic can be configured headlessly with `kosmokrator integrations:configure newrelic`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure newrelic --set api_key="$NEWRELIC_API_KEY" --set account_id="$NEWRELIC_ACCOUNT_ID" --enable --read allow --write ask --json
kosmokrator integrations:doctor newrelic --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_key NEWRELIC_API_KEY Secret secret yes API Key
account_id NEWRELIC_ACCOUNT_ID Text string yes Account ID
url NEWRELIC_URL URL url no NerdGraph Endpoint

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call newrelic.newrelic_list_applications '{}' --json
Provider shortcut
kosmo integrations:newrelic newrelic_list_applications '{}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs newrelic --json
kosmo integrations:docs newrelic.newrelic_list_applications --json
kosmo integrations:schema newrelic.newrelic_list_applications --json
kosmo integrations:search "New Relic" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

newrelic.newrelic_list_applications

List APM applications in the configured New Relic account. Returns application names, GUIDs, IDs, language, reporting status, and health status.

Read read
Parameters
none
Generic call
kosmo integrations:call newrelic.newrelic_list_applications '{}' --json
Shortcut
kosmo integrations:newrelic newrelic_list_applications '{}' --json

newrelic.newrelic_get_application

Get details of a specific New Relic APM application by its application ID, including language, health status, and Apdex thresholds.

Read read
Parameters
application_id
Generic call
kosmo integrations:call newrelic.newrelic_get_application '{"application_id":1}' --json
Shortcut
kosmo integrations:newrelic newrelic_get_application '{"application_id":1}' --json

newrelic.newrelic_list_deployments

List deployment markers for a New Relic APM application. Requires the application entity GUID.

Read read
Parameters
application_guid
Generic call
kosmo integrations:call newrelic.newrelic_list_deployments '{"application_guid":"example_application_guid"}' --json
Shortcut
kosmo integrations:newrelic newrelic_list_deployments '{"application_guid":"example_application_guid"}' --json

newrelic.newrelic_create_deployment

Record a new deployment marker in New Relic for a given application. This helps correlate deploys with performance changes.

Write write
Parameters
application_guid, revision, description, user, changelog
Generic call
kosmo integrations:call newrelic.newrelic_create_deployment '{"application_guid":"example_application_guid","revision":"example_revision","description":"example_description","user":"example_user","changelog":"example_changelog"}' --json
Shortcut
kosmo integrations:newrelic newrelic_create_deployment '{"application_guid":"example_application_guid","revision":"example_revision","description":"example_description","user":"example_user","changelog":"example_changelog"}' --json

newrelic.newrelic_list_alert_policies

List alert policies in the configured New Relic account. Returns policy names, IDs, and incident preferences.

Read read
Parameters
none
Generic call
kosmo integrations:call newrelic.newrelic_list_alert_policies '{}' --json
Shortcut
kosmo integrations:newrelic newrelic_list_alert_policies '{}' --json

newrelic.newrelic_list_dashboards

List dashboards in the configured New Relic account. Returns dashboard titles, GUIDs, timestamps, and owner information.

Read read
Parameters
none
Generic call
kosmo integrations:call newrelic.newrelic_list_dashboards '{}' --json
Shortcut
kosmo integrations:newrelic newrelic_list_dashboards '{}' --json

newrelic.newrelic_get_current_user

Get the profile of the currently authenticated New Relic user. Useful for verifying API credentials and retrieving account information.

Read read
Parameters
none
Generic call
kosmo integrations:call newrelic.newrelic_get_current_user '{}' --json
Shortcut
kosmo integrations:newrelic newrelic_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

newrelic.newrelic_list_applications 0 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_list_applications --json
ParameterTypeRequiredDescription
No parameters.
newrelic.newrelic_get_application 1 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_get_application --json
ParameterTypeRequiredDescription
application_id integer yes The New Relic application ID.
newrelic.newrelic_list_deployments 1 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_list_deployments --json
ParameterTypeRequiredDescription
application_guid string yes The entity GUID of the New Relic application.
newrelic.newrelic_create_deployment 5 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_create_deployment --json
ParameterTypeRequiredDescription
application_guid string yes The entity GUID of the New Relic application.
revision string yes The deployment revision (e.g. commit SHA, version number).
description string no A description of the deployment.
user string no The user who triggered the deployment.
changelog string no Changelog or commit message for the deployment.
newrelic.newrelic_list_alert_policies 0 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_list_alert_policies --json
ParameterTypeRequiredDescription
No parameters.
newrelic.newrelic_list_dashboards 0 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_list_dashboards --json
ParameterTypeRequiredDescription
No parameters.
newrelic.newrelic_get_current_user 0 parameters
Schema command
kosmo integrations:schema newrelic.newrelic_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.