Configuration
The CLI fetches configuration from the API server at http://localhost:3000 by default.
Override with environment variables:
PLATFORM_API_URL=http://localhost:4000 viite read source gmailOther 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).
Authentication
Section titled “Authentication”The CLI manages authentication automatically:
- Checks for an existing session in
~/.platform-cli/session.json - If no session, prompts for email/password
- Authenticates with the API server
- 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.
Session Management
Section titled “Session Management”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):
rm ~/.platform-cli/session.jsonTo renew an expired session:
# From root directorybun run api:renew-session your@email.com yourpassword
# Or with environment variablesexport PLATFORM_EMAIL="your@email.com"export PLATFORM_PASSWORD="yourpassword"bun run api:renew-sessionFor unattended/scripted use (e.g. agent watch or tasks --json), prefer a VIITE_API_KEY
org-scoped API key over the interactive session flow.
