Overview — NuPaaS Docs
CLI reference

Overview

The NuPaaS CLI manages projects, deployments, databases, domains and nodes from your terminal. It talks to the same public REST API documented under API reference, so anything the CLI can do you can also automate directly over HTTP.

Install

The CLI is published to npm as @type-driven/platform-cli. Installing it globally puts a platform executable on yourPATH. The npm package is a thin launcher that selects the prebuilt binary matching your operating system and CPU architecture.

Install the CLI
npm install -g @type-driven/platform-cli

Confirm the install and check which version you are running:

Verify the install
platform --version
platform --help

Every command and subcommand accepts --help. If this page and the CLI ever disagree, platform <command> --help is authoritative — it is generated from the command definitions themselves.

Configure

platform init is an interactive wizard that records the API endpoint, your credentials and a default organization. It writes ~/.platform/config.json with file mode 0600.

Interactive setup
platform init

Pass every value up front to configure a machine without prompts — this is the form to use in CI images and provisioning scripts:

Non-interactive setup
platform init --api-url https://platform.nupaas.com --api-key plat_REPLACE_ME --org my-org
ParameterTypeDescription
--api-urlstringBase URL of the platform. The CLI appends /api/v1 itself, so pass the host root.
--api-keystringA long-lived API key. Create one with platform keys create.
--orgstringDefault organization, used whenever a command's --org flag is omitted.

The recorded default organization is what makes --org optional on later commands. Without it, commands that need an organization fail with a message telling you to pass --org or run platform init.

Authenticate

There are two ways to authenticate, and they suit different situations.

Interactive login

platform login runs a browser-based OIDC authorization code flow. It starts a temporary local callback server, opens your browser, exchanges the resulting code for tokens, and saves the access token into ~/.platform/config.json. If no terminal is attached it prints the URL for you to open manually instead.

Browser login
platform login
platform login --org my-org

API keys for automation

Non-interactive environments should use an API key instead. Set PLATFORM_API_KEY in the environment and the CLI will use it without reading the config file at all.

Authenticate from CI
export PLATFORM_API_URL=https://platform.nupaas.com
export PLATFORM_API_KEY=plat_REPLACE_ME
platform projects list

Credentials are resolved in a fixed order: PLATFORM_API_KEY first, then the session token saved by platform login, then a long-lived key stored in the config file. The environment variable always wins, which is what lets a CI job override whatever a developer image happened to be logged in as. The API base URL resolves the same way: PLATFORM_API_URL first, then apiUrl from the config file. There is no built-in default — an unconfigured CLI fails with a clear message rather than guessing a host.

Command groups

Commands are grouped by the resource they act on. Each group is documented with its subcommands and flags on its own page or via --help.

ParameterTypeDescription
platform deploygroupList, create, wait on and roll back deployments. See the deploy page.
platform logscommandPrint or follow the build logs for one deployment.
platform projectsgroupList, inspect, create and delete projects.
platform envgroupRead and write project environment variables and CI secrets.
platform dbgroupProvision and inspect managed databases. See the database page.
platform nodegroupAdd, drain and remove fleet servers. See the servers page.
platform node-groupsgroupGroup servers and roll a component out across a group.
platform domainsgroupAttach, verify and remove custom hostnames on a project.
platform keysgroupCreate, list and revoke API keys.
platform orgsgroupInspect organizations, list members and send invitations.
platform storagegroupManage object storage buckets and inspect their usage.
platform stacksgroupLaunch and inspect stacks created from a template.
platform billinggroupRead subscription status, invoices and usage.
platform auditgroupList and export the organization audit log.
platform localgroupRun and seed a local platform stack for development.

Conventions

A handful of conventions hold across the whole CLI, so you only have to learn them once.

  • --json switches a command from a human-readable table to raw JSON on stdout. Script against the JSON, never against the table.
  • --org is optional wherever it appears; it falls back to the default organization recorded by platform init.
  • Tables print shortened identifiers for readability. Where a command takes an ID as a positional argument it will also accept one of those short prefixes and resolve it for you — platform logs and platform deploy wait both do this.
  • Destructive commands prompt for confirmation before acting. platform node remove accepts --force to skip the prompt in automation.
  • Commands exit non-zero on failure and print a single formatted error line, so set -e in a shell script behaves as expected.

Operator-only commands

platform --help lists more groups than the ones above. Commands such as platform ops, platform bootstrap, platform grant-operator and platform golden-image operate on the platform fleet itself rather than on your organization's resources. They require a platform-operator grant, which is not something an organization role can confer on itself.

Running one of them without that grant returns a permission error. If you are a NuPaaS customer rather than a platform operator, the groups listed in the table above are the complete surface available to you.