• Sign up

New Relic One CLI common commands

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.


CommandDescription
nr1 helpShows all nr1 commands or details about each command.
nr1 updateUpdates to the latest version of the CLI.
nr1 createCreates a new component from a template (Nerdpack, Nerdlet, launcher, or catalog).
nr1 profilesManages the profiles you use to run CLI commands.
nr1 autocompleteDisplays autocomplete installation instructions.
nr1 nrqlFetches 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_NAMEThe 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

CHANNELThe 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, --forceIf present, overrides existing files without asking.
-n, --name=NAMENames the component.
-t, --type=TYPESpecifies the component type.
--path=PATHThe route to the component.
--profile=PROFILEThe authentication profile you want to use.
--verboseAdds 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:addAdds a new profile to your profiles keychain.
profiles:defaultChooses which profile should be default.
profiles:listLists the profiles on your keychain.
profiles:removeRemoves 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

SHELLThe shell type you want instructions for.

Options

-r, --refresh-cacheRefreshes 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=ACCOUNTThe user account ID. required
-q, --query=QUERYThe NRQL query to run. required
-u, --uglyDisplays the content without tabs or spaces.
--profile=PROFILEThe authentication profile you want to use.
--verboseAdds extra information to the output.