CLI overview
Authenticate, link a service, deploy, stream logs, set env, and open databases from the terminal.
The Bytstack CLI (@bytstack/cli) mirrors common dashboard actions for local workflows and CI.
Install
npm i -g @bytstack/clipnpm add -g @bytstack/cliyarn global add @bytstack/cliAuthenticate
bytstack login
# or non-interactive:
bytstack login --token <token> --api-url https://api.example.com| Flag | Purpose |
|---|---|
--token <token> | API token (skip browser OAuth) |
--no-browser | Prompt for a token instead of opening a browser |
--api-url <url> | API base URL |
API URL resolution (highest wins): .bytstack/config.json apiUrl → BYTSTACK_API_URL → http://localhost:3000.
Token resolution: BYTSTACK_TOKEN → ~/.bytstack/credentials.json.
Link a project directory
bytstack link <serviceId> [--project-id <id>] [--api-url <url>]Writes .bytstack/config.json with serviceId (and optional projectId / apiUrl). Most commands require a linked directory.
Commands
| Command | Purpose |
|---|---|
bytstack login | Browser OAuth or token auth |
bytstack link <serviceId> | Link cwd to a service |
bytstack deploy [-b branch] | Queue a deployment |
bytstack logs | Build or runtime logs |
bytstack env set KEY=value | Set a service env var |
bytstack db connection <id> | Print external DB URL |
bytstack db psql <id> | Open psql on the external URL |
bytstack open | Open the service platform URL |
Logs
bytstack logs # runtime (default)
bytstack logs --build # latest deployment build logs
bytstack logs --follow # keep tailing
bytstack logs --since 1h --query errorUseful flags: --build, --tail, --since, --query / --search, --deployment, --historical, --download, --no-wake, -f / --follow.
Environment
Only set is available today:
bytstack env set DATABASE_POOL_SIZE=20Use the dashboard Environment pages to list or delete vars.
Databases
bytstack db connection <databaseId>
bytstack db psql <databaseId>External URLs are TLS-terminated and subject to allowlists configured in the dashboard.
CI
- Create an API token in the dashboard.
- Set
BYTSTACK_TOKENandBYTSTACK_API_URLin the pipeline. - Commit or generate
.bytstack/config.jsonwith the targetserviceId. - Run
bytstack deployand fail the job unless the deployment reacheslive.