CLI
The nullplatform CLI allows you to manage your nullplatform resources directly from the command line as well as letting you manage your CI/CDs and pipelines.
Authentication
Before using the CLI, you need to authenticate using one of these methods:
- Environment Variable:
export NULLPLATFORM_API_KEY=your_api_key_here
- Command Line Flag:
np [command] --access-token your_access_token
The access token can be retrieved from the nullplatform web interface by installing our Chrome extension: nullplatform Chrome extension. After installation, you can copy your access token directly using the plugin.
Installation
Using the install script
You can install the nullplatform CLI using the following command:
curl https://cli.nullplatform.com/install.sh | sh
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
{
"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"
}
]
}