Premia
CLI

Install & authenticate

Get the premia CLI and log in.

The premia CLI does everything the dashboard does for runs, agents, pipelines, and secrets — plus a local dev loop for custom agents and CI integration.

Install

npm install -g @premia/cli    # global
npx @premia/cli <command>     # one-off

The binary is premia. Requires Node 18+.

Authenticate

premia login            # opens the browser, pick an org, authorize
premia whoami           # confirm who you are

Prefer a token? Create one in Settings → API Keys and:

premia login --token premia_xxx

CI / non-interactive

Set PREMIA_TOKEN (a token from Settings → API Keys) and skip login entirely:

PREMIA_TOKEN=premia_xxx premia runs list

The API base URL resolves from PREMIA_API_URL → your saved config → default. Pass --api-url on login to point at a specific deployment.

Project context

premia init --project <public-id> writes a .premia.json in the current directory so commands scope to the right project. You can always override with --project.

Output & exit codes

Every command supports --json (or PREMIA_JSON=1) for scripting. Exit codes:

CodeMeaning
0Success
1Failure / command error
2Auth (not logged in, invalid token)
3Not found
130Interrupted

Environment variables

VariableEffect
PREMIA_TOKENAuth token. Takes priority over saved credentials — the CI path.
PREMIA_API_URLAPI base URL. Overrides saved config and the localhost default.
PREMIA_JSON=1Force JSON output on every command (same as --json).
NO_COLORDisable ANSI color. Color is also auto-off when output isn't a TTY.

Where things live

  • Credentials: ~/.premia/config.json (created chmod 600) — written by premia login, removed by premia logout.
  • Project context: .premia.json in the working directory — written by premia init, read by commands that take --project.

Resolution order for the token is PREMIA_TOKEN → saved config; for the API URL it's PREMIA_API_URL → saved config → http://localhost:3000.

On this page