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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call newrelic.newrelic_list_applications '{}' --json 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.
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 - Parameters
- none
kosmo integrations:call newrelic.newrelic_list_applications '{}' --json 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 - Parameters
- application_id
kosmo integrations:call newrelic.newrelic_get_application '{"application_id":1}' --json 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 - Parameters
- application_guid
kosmo integrations:call newrelic.newrelic_list_deployments '{"application_guid":"example_application_guid"}' --json 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 - Parameters
- application_guid, revision, description, user, changelog
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 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 - Parameters
- none
kosmo integrations:call newrelic.newrelic_list_alert_policies '{}' --json 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 - Parameters
- none
kosmo integrations:call newrelic.newrelic_list_dashboards '{}' --json 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 - Parameters
- none
kosmo integrations:call newrelic.newrelic_get_current_user '{}' --json 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
kosmo integrations:schema newrelic.newrelic_list_applications --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
newrelic.newrelic_get_application 1 parameters
kosmo integrations:schema newrelic.newrelic_get_application --json | Parameter | Type | Required | Description |
|---|---|---|---|
application_id | integer | yes | The New Relic application ID. |
newrelic.newrelic_list_deployments 1 parameters
kosmo integrations:schema newrelic.newrelic_list_deployments --json | Parameter | Type | Required | Description |
|---|---|---|---|
application_guid | string | yes | The entity GUID of the New Relic application. |
newrelic.newrelic_create_deployment 5 parameters
kosmo integrations:schema newrelic.newrelic_create_deployment --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema newrelic.newrelic_list_alert_policies --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
newrelic.newrelic_list_dashboards 0 parameters
kosmo integrations:schema newrelic.newrelic_list_dashboards --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
newrelic.newrelic_get_current_user 0 parameters
kosmo integrations:schema newrelic.newrelic_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.