analytics
New Relic CLI for Shell Scripts
Use the New Relic CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write API key auth
New Relic CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The New Relic CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# New Relic CLI for Shell Scripts
kosmokrator integrations:configure newrelic --set api_key="$NEWRELIC_API_KEY" --set account_id="$NEWRELIC_ACCOUNT_ID" --enable --read allow --write ask --json
kosmo integrations:call newrelic.newrelic_list_applications '{}' --json Discovery Before Execution
Agents and scripts can inspect New Relic docs and schemas 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 Useful New Relic CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
newrelic.newrelic_list_applications | Read | none | List APM applications in the configured New Relic account. Returns application names, GUIDs, IDs, language, reporting status, and health status. |
newrelic.newrelic_get_application | Read | application_id | Get details of a specific New Relic APM application by its application ID, including language, health status, and Apdex thresholds. |
newrelic.newrelic_list_deployments | Read | application_guid | List deployment markers for a New Relic APM application. Requires the application entity GUID. |
newrelic.newrelic_create_deployment | Write | application_guid, revision, description, user, changelog | Record a new deployment marker in New Relic for a given application. This helps correlate deploys with performance changes. |
newrelic.newrelic_list_alert_policies | Read | none | List alert policies in the configured New Relic account. Returns policy names, IDs, and incident preferences. |
newrelic.newrelic_list_dashboards | Read | none | List dashboards in the configured New Relic account. Returns dashboard titles, GUIDs, timestamps, and owner information. |
newrelic.newrelic_get_current_user | Read | none | Get the profile of the currently authenticated New Relic user. Useful for verifying API credentials and retrieving account information. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.