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.
Installation
Linux and macOS
-
To install or update the latest version of the nullplatform CLI:
curl https://cli.nullplatform.com/install.sh | sh💡 Check the latest version using
np --version. -
(Not recommended) To install a previous version, run:
curl https://cli.nullplatform.com/install.sh | VERSION=<n.n.n> shReplace
<n.n.n>with the desired version number, for example1.2.3.
Windows
Use one of the following options to install the CLI on Windows.
Option 1: PowerShell (recommended)
-
To install the nullplatform CLI:
Invoke-WebRequest -Uri https://cli.nullplatform.com/install.ps1 -OutFile install.ps1; .\install.ps1 -
Install a specific version:
Invoke-WebRequest -Uri https://cli.nullplatform.com/install.ps1 -OutFile install.ps1; .\install.ps1 -Version "n.n.n"
Option 2: Batch script (Command Prompt)
-
Download the installer:
curl -o install.bat https://cli.nullplatform.com/install.bat -
Run the installer:
install.bat
-
Install a specific version:
install.bat --version beta
After installation, restart your terminal so the PATH changes take effect.
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?
To retrieve your personal access token:
- Log in to nullplatform.
- Click your user menu (the circle with your initials/user avatar) in the top-right corner.
- From the dropdown menu, select Copy personal access token.
The legacy Chrome extension used to retrieve the token is deprecated and no longer maintained or supported.
How to use the CLI
Check out our API reference, where you'll find CLI examples for every supported endpoint. Simply search for the endpoint you need to see an example for.
Use np --help to get information on all available commands.
Below is a full example for reference:
# Using environment variable authentication
export NULLPLATFORM_API_KEY=your_api_key_here
np account create --body '{ "name": "mocked-name-1", "slug": "mocked-slug-1", "organization_id": 123, "repository_prefix": "mocked-prefix-1", repository_provider": "github", "status": "active"
}'
# Or using command-line flag
np account create --body '{ "name": "mocked-name-1", "slug": "mocked-slug-1", "organization_id": 123, "repository_prefix": "mocked-prefix-1", repository_provider": "github", "status": "active"
}' --format json --access-token your_access_token
# Example response:
{
"id": 515151,
"name": "mocked-name-1",
"nrn": "organization=123",
"organization_id": 123,
"repository_prefix": "mocked-prefix-1",
"repository_provider": "github",
"slug": "mocked-slug-1",
"status": "active"
}