Intro to the New Relic One CLI

To build a New Relic One application, we provide you with a variety of tools, including a CLI (our command line interface application). This page will explain:

  • How to use CLI commands to:

    • Generate Nerdpack/Nerdlet templates

    • Locally serve Nerdpacks (when developing)

    • Publish and deploy

    • Subscribe to Nerdpacks

Install

Commands

This table gives descriptions and context for some of the most important CLI commands. For details on user permissions, see Authentication and permissions.

Topic Command Description
Help nr1 help See all nr1 commands. For more details about a command, run nr1 help COMMAND_NAME.
Update nr1 update Update to newest version of the CLI.
Profiles nr1 profiles Controls the profile you’ll be running CLI commands as. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts. For more on this, see Authentication and the workshop.
Create nr1 create Create a new component template (Nerdpack, Nerdlet, or launcher). The CLI will walk you through this process. For an explanation of the file structure, see Nerdpack file structure.
Clone nr1 nerdpack:clone Clone an open source Nerdpack from our GitHub repository.
Serve locally nr1 nerdpack:serve Serves your Nerdpack locally, which makes it visible at one.newrelic.com/?nerdpacks=local. For details, see Local development.
Change associated accounts nr1 nerdpack:uuid Commands related to the Nerdpack’s UUID (universal unique ID). This ID dictates the data a Nerdpack has access to, and who can subscribe to it. To deploy a Nerdpack you didn’t make, you’ll have to assign it a new UUID. For details, see Access to data and the workshop.
Publish nr1 nerdpack:publish Publishes your Nerdpack to New Relic. For more on publishing, see Deploy to New Relic One. After publishing, you can use nr1 nerdpack: deploy to deploy it to a channel and make it available to users.
Deploy nr1 nerdpack:deploy Deploys a Nerdpack version to a specific channel (for example, BETA, or STABLE). A channel can only have one Nerdpack version deployed to it at one time. If a channel has an existing Nerdpack associated with it, deploying a new Nerdpack version to that channel will undeploy the previous one. For more on deploying, see Deploy to New Relic One.
Subscribe nr1 nerdpack:subscribe Subscribe an account (the one associated with the API key used to run this command) to a channel (default: STABLE). Can be run with a Nerdpack UUID or run in a specific Nerdpack's directory (the UUID in package.json file is used). An account can only be subscribed to one Nerdpack channel at a time. For more details, see Deploy to New Relic One.
Unsubscribe nr1 nerdpack:unsubscribe Unsubscribe an account from a Nerdpack whose UUID you provide. The account unsubscribed is the one associated with the API key used to run the command.
NRQL query nr1 nrql Fetches data from New Relic using NRQL (New Relic query language).

Publish and deploy