Skip to main content

CLI

The nullplatform CLI allows you to:

  • Manage your nullplatform resources directly from the command line.
  • Interact with the nullplatform API.
  • Work with your CI/CD pipelines and automate workflows.

To use the CLI, simply and authenticate and install it.

Authentication

Before using the CLI, you need to authenticate using either an API key or an access token.

API keys

You can generate a personal or machine API key to use with the CLI. This is a persistent authentication method that can be used to generate access tokens.

  • Use an API key as a flag:

    np [command] --api-key your_api_key
  • Or export it as an environment variable:

    export NULLPLATFORM_API_KEY=your_api_key_here

For more info on API keys, see Manage API keys.

Access token

You can also authenticate using a personal access token.

  • As with API keys, you can use an access token as a flag:

    np [command] --access-token your_access_token
  • Or export it as an environment variable:

    export NP_TOKEN=your_access_token

How do I get an access token?

You can retrieve a personal access token using our Chrome extension:

  1. Download the extension from our GitHub repository and install it.
  2. Copy the access token directly from the nullplatform UI using the plugin.

Installation

Install the nullplatform CLI using the following command:

curl https://cli.nullplatform.com/install.sh | sh
tip

Use np --help to get information on all available commands.

Example usage

List accounts

Retrieve a list of accounts within an organization:

# Using environment variable authentication
export NULLPLATFORM_API_KEY=your_api_key_here
np account list --organization_id 123 --format json

# Or using command line flag
np account list --organization_id 123 --format json --access-token your_access_token

# Example Response:

{
"paging": {
"limit": 30,
"offset": 0
},
"results": [
{
"id": 515151,
"name": "mocked-name-1",
"nrn": "organization=123:account=515151",
"organization_id": 123,
"repository_prefix": "mocked-prefix-1",
"repository_provider": "github",
"slug": "mocked-slug-1",
"status": "active"
},
{
"id": 414141,
"name": "mocked-name-2",
"nrn": "organization=123:account=414141",
"organization_id": 123,
"repository_prefix": "mocked-prefix-2",
"repository_provider": "gitlab",
"slug": "mocked-slug-2",
"status": "active"
}
]
}