Skip to content

Configuration

The CLI fetches configuration from the API server at http://localhost:3000 by default.

Override with environment variables:

Terminal window
PLATFORM_API_URL=http://localhost:4000 viite read source gmail

Other CLI-relevant env vars: API_URL / API_PORT (fallbacks for PLATFORM_API_URL), VIITE_API_KEY (used by agent watch), COOLIFY_ENV_FILE (used by tasks), and DASHBOARD_URL (used by record — the dashboard’s origin, not the API’s).

The CLI manages authentication automatically:

  1. Checks for an existing session in ~/.platform-cli/session.json
  2. If no session, prompts for email/password
  3. Authenticates with the API server
  4. Stores the session for future use

An existing session is probed against the API on each login rather than trusted blindly: only an explicit 401/403 is treated as an invalid session (and cleared); a network error, 5xx, or other transient failure leaves the stored session alone rather than logging you out over a blip.

Sessions are stored in ~/.platform-cli/session.json:

{
"sessionToken": "token-here",
"sessionCookie": "the-verbatim-set-cookie-value",
"userId": "user-id",
"email": "user@example.com"
}

sessionCookie — not just the token — is what authenticates requests against HTTPS deployments; reconstructing a cookie from the token alone produces the wrong cookie name and 401s.

To clear a session (logout):

Terminal window
rm ~/.platform-cli/session.json

To renew an expired session:

Terminal window
# From root directory
bun run api:renew-session your@email.com yourpassword
# Or with environment variables
export PLATFORM_EMAIL="your@email.com"
export PLATFORM_PASSWORD="yourpassword"
bun run api:renew-session

For unattended/scripted use (e.g. agent watch or tasks --json), prefer a VIITE_API_KEY org-scoped API key over the interactive session flow.