CLI

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/cli
pnpm add -g @bytstack/cli
yarn global add @bytstack/cli

Authenticate

bytstack login
# or non-interactive:
bytstack login --token <token> --api-url https://api.example.com
FlagPurpose
--token <token>API token (skip browser OAuth)
--no-browserPrompt for a token instead of opening a browser
--api-url <url>API base URL

API URL resolution (highest wins): .bytstack/config.json apiUrlBYTSTACK_API_URLhttp://localhost:3000.

Token resolution: BYTSTACK_TOKEN~/.bytstack/credentials.json.

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

CommandPurpose
bytstack loginBrowser OAuth or token auth
bytstack link <serviceId>Link cwd to a service
bytstack deploy [-b branch]Queue a deployment
bytstack logsBuild or runtime logs
bytstack env set KEY=valueSet a service env var
bytstack db connection <id>Print external DB URL
bytstack db psql <id>Open psql on the external URL
bytstack openOpen 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 error

Useful 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=20

Use 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

  1. Create an API token in the dashboard.
  2. Set BYTSTACK_TOKEN and BYTSTACK_API_URL in the pipeline.
  3. Commit or generate .bytstack/config.json with the target serviceId.
  4. Run bytstack deploy and fail the job unless the deployment reaches live.