Bootstrap
Set project defaults with relay init, or just run a command and let the interactive wizard write .relay.json for you.
relay init --socket ./data/relay.sock --app demo
relay deployrelay.js already ships much more than a thin deploy command. It supports socket and HTTP transport, an interactive setup wizard, sync-based deploys, rollout inspection, rollback, app control, secrets, and buildpack plugin operations.
relay init --socket ./data/relay.sock --app demo
relay deploy --host-port 3005
relay status
relay projectsThis matches what relay.js actually exposes today: setup, deploy and inspect, slot control, and admin operations.
Set project defaults with relay init, or just run a command and let the interactive wizard write .relay.json for you.
relay init --socket ./data/relay.sock --app demo
relay deployDeploy with sync-first uploads, then inspect the latest slot with status, logs, list, and projects. Build logs stream by default; pass --no-stream to suppress.
relay deploy --host-port 3005
relay status
relay logs <deploy-id>
relay logs <deploy-id> --no-stream
relay list --app demo --limit 10
relay projectsRollback or directly start, stop, and restart the running container for one app, env, and branch.
relay rollback
relay stop
relay start
relay restartCheck relay, relayd, and station versions from one command, then update agent binaries in place when a new release lands.
relay version
relay agent status
relay agent updateManage app secrets and buildpack plugins from the CLI without opening the dashboard.
relay secrets list
relay secrets add --key DATABASE_URL --value postgres://...
relay plugin list
relay plugin install ./astro-static.jsonThe command set is the same either way. Only the transport and auth model change.
Use --socket or RELAY_SOCKET when the CLI runs on the same machine as relayd. No token is required because the socket is protected by filesystem permissions.
{
"socket": "./data/relay.sock",
"app": "demo",
"env": "preview",
"branch": "main"
}Use --url plus --token, or RELAY_URL and RELAY_TOKEN, when the CLI runs remotely. The client sends X-Relay-Token on each request.
{
"url": "http://127.0.0.1:8080",
"token": "YOUR_TOKEN",
"app": "demo",
"env": "preview",
"branch": "main"
}The client does not tar the whole repo by default. It computes local state, asks the agent what changed, uploads only the diff, then triggers the build and container swap.
relay deploy calls /api/sync/start, receives a session_id, and prepares a staging area on the agent.
The CLI walks the workspace, computes a manifest, asks /api/sync/plan what changed, uploads only needed files, and posts deletes for stale paths.
The final /api/sync/finish call triggers the build and rollout. With --stream, the CLI follows /api/logs/stream/<id> until a terminal status arrives.
relay deploy \
--dir . \
--mode port \
--host-port 3005 \
--service-port 3000 \
--public-host demo.preview.example.com \
--install-cmd "npm ci" \
--build-cmd "npm run build" \
--start-cmd "node server.js" \
--no-streamtraffic_mode exists on the server as edge or session, but it is stored through app config, not as a relay deploy flag.
preview_url comes back from the deploy record after rollout, and relay deploy prints it when streaming finishes.
status, list, and projects are read-only views over the same deploy and app state tables the dashboard uses.
GET /api/logs/stream/<deploy-id>
event: message
data: {"message":"selected buildpack: node-next"}
event: deploy-status
data: {"status":"running"}resolveDeployArgs and resolveTransport both follow the same layered model, which keeps debugging straightforward.
Explicit flags like --socket, --url, --token, --app, and --branch override everything else for one invocation.
Project-local defaults written by relay init or the interactive setup wizard.
RELAY_SOCKET, RELAY_URL, RELAY_TOKEN, RELAY_APP, RELAY_ENV, and RELAY_BRANCH.
url defaults to http://127.0.0.1:8080, env to preview, and branch to main.
relay.config.json is read for install_cmd, build_cmd, start_cmd, and service_port when deploying.
{
"socket": "./data/relay.sock",
"app": "demo",
"env": "preview",
"branch": "main",
"dir": "."
}Any command can bootstrap .relay.json when config is missing and stdin is a TTY.
The CLI can skip tokens entirely on the same machine by targeting relay.sock.
relay version reports CLI, installed binaries, latest release, and server version data from /api/version when reachable.
relay agent update compares installed and latest releases, then downloads the correct OS archive only when you are behind.
Read deploy history and project inventory without opening the dashboard. list accepts --limit to cap results.
Manage app secrets and buildpack plugins directly from the CLI.
relay deploy and relay logs stream build output without any flag. Pass --no-stream to suppress live output and print the log ID instead.