Here's a list of common commands to get you started with the New Relic One CLI. You can click any command to see its usage options and additional details about the command.
Command | Description |
---|---|
nr1 help | Shows all nr1 commands or details about each command. |
nr1 update | Updates to the latest version of the CLI. |
nr1 create | Creates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog). |
nr1 profiles | Manages the profiles you use to run CLI commands. |
nr1 autocomplete | Displays autocomplete installation instructions. |
nr1 nrql | Fetches data using NRQL (New Relic query language). |
See our other New Relic One CLI docs for commands specific to Nerdpack set-up, Nerdpack subscriptions, CLI configuration, plugins, or catalogs.
Command details
nr1 help
See commands and get details
Shows all nr1 commands by default. To get details about a specific command, run nr1 help COMMAND_NAME
.
Usage
$ nr1 help
Arguments
COMMAND_NAME | The name of a particular command. |
Examples
$ nr1 help
$ nr1 help nerdpack
$ nr1 help nerdpack:deploy
nr1 update
Update your CLI
Updates to latest version of the CLI. You can specify which channel to update if you'd like.
Usage
$ nr1 update
Arguments
CHANNEL | The name of a particular channel. |
Examples
$ nr1 update
$ nr1 update somechannel
nr1 create
Create a new component
Creates a new component from our template (either a Nerdpack, Nerdlet, launcher, or catalog). The CLI will walk you through this process.
To learn more about Nerdpacks and their file structure, see Nerdpack file structure. For more on how to set up your Nerdpacks, see our Nerdpack CLI commands.
Usage
$ nr1 create
Options
-f, --force | If present, overrides existing files without asking. |
-n, --name=NAME | Names the component. |
-t, --type=TYPE | Specifies the component type. |
--path=PATH | The route to the component. |
--profile=PROFILE | The authentication profile you want to use. |
--verbose | Adds extra information to the output. |
nr1 profiles
Manage your profiles keychain
Displays a list of commands you can use to manage your profiles. Run nr1 help profiles:COMMAND
for more on their specific usages. You can have more than one profile, which is helpful for executing commands on multiple New Relic accounts.
To learn more about setting up profiles, see our Github workshop.
Usage
$ nr1 profiles:COMMAND
Commands
profiles:add | Adds a new profile to your profiles keychain. |
profiles:default | Chooses which profile should be default. |
profiles:list | Lists the profiles on your keychain. |
profiles:remove | Removes a profile from your keychain. |
nr1 autocomplete
See autocomplete installation instructions
Displays the autocomplete installation instructions.
By default, the command displays the autocomplete instructions for zsh. If you want instructions for bash, run nr1 autocomplete bash
.
Usage
$ nr1 autocomplete
Arguments
SHELL | The shell type you want instructions for. |
Options
-r, --refresh-cache | Refreshes cache (ignores displaying instructions). |
Examples
$ nr1 autocomplete
$ nr1 autocomplete zsh
$ nr1 autocomplete bash
$ nr1 autocomplete --refresh-cache
nr1 nrql
Query using NRQL
Fetches data from databases using a NRQL query.
To learn more about NRQL and how to use it, see our NRQL docs.
Usage
$ nr1 nrql OPTION ...
Options
-a, --account=ACCOUNT | The user account ID. required |
-q, --query=QUERY | The NRQL query to run. required |
-u, --ugly | Displays the content without tabs or spaces. |
--profile=PROFILE | The authentication profile you want to use. |
--verbose | Adds extra information to the output. |