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-offThe binary is premia. Requires Node 18+.
Authenticate
premia login # opens the browser, pick an org, authorize
premia whoami # confirm who you arePrefer a token? Create one in Settings → API Keys and:
premia login --token premia_xxxCI / non-interactive
Set PREMIA_TOKEN (a token from Settings → API Keys) and skip login entirely:
PREMIA_TOKEN=premia_xxx premia runs listThe 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:
| Code | Meaning |
|---|---|
0 | Success |
1 | Failure / command error |
2 | Auth (not logged in, invalid token) |
3 | Not found |
130 | Interrupted |
Environment variables
| Variable | Effect |
|---|---|
PREMIA_TOKEN | Auth token. Takes priority over saved credentials — the CI path. |
PREMIA_API_URL | API base URL. Overrides saved config and the localhost default. |
PREMIA_JSON=1 | Force JSON output on every command (same as --json). |
NO_COLOR | Disable ANSI color. Color is also auto-off when output isn't a TTY. |
Where things live
- Credentials:
~/.premia/config.json(createdchmod 600) — written bypremia login, removed bypremia logout. - Project context:
.premia.jsonin the working directory — written bypremia 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.