stx login
Authenticate the CLI with your Syntext account via browser or API token.
Authenticate with Syntext. Credentials are stored locally and used by commands that talk to the Syntext API (stx deploy, stx build, stx projects, stx connect).
Usage
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--token <token> | string | CLI session token to store instead of browser login (project API keys are passed to deploy/build/dev with --token) | |
--api-url <url> | string | https://api.syntext.dev | API URL to sign in against. Only stx check --explain and stx migrate reuse it; other commands read SYNTEXT_API_URL (see Environment Variables) |
Interactive Login (Recommended)
Starts a device flow: your browser opens to a verification page, you approve the request, and the CLI picks up the session automatically.
The verification page shows the code from your terminal and the account you are signed in to. Check that the code matches, then choose Authorize device — or Deny if you did not start this login, which grants nothing (then sign out of every device from Profile).
If you are not signed in, the page sends you to log in first and returns you to
the same code afterwards. A code is good for a short window and can only be used
once: if the page says the code no longer works, run stx login again for a new
one.
Since stx 0.7.0, stx login reacts to the browser at once instead of waiting for the code to time out:
stx login with exit code 1: Sign-in was denied in the browser. Run stx login to try again.1.Releases before 0.7.0 kept polling until the code's own timeout in both cases.
The session is listed as stx CLI in the dashboard's sessions list, where you can revoke it. Since stx 0.7.0 every request carries a User-Agent of stx/<version> (<platform>; <arch>), which the dashboard uses to name the session (for example "stx CLI · macOS").
If browser login is unavailable, the CLI prints how to deploy with a project API key instead. Since stx 0.7.0 that message links straight to your project's Settings › API keys page (https://app.syntext.dev/projects/<project-id>/settings/api-keys) when you run it inside a connected project, and to https://app.syntext.dev/projects otherwise.
Unverified accounts
Accounts must verify their email before creating or changing anything — this is being rolled out. Once it applies, an account whose email isn't verified can't approve an stx login request: choosing Authorize device takes you to the dashboard's verification step instead. Verify there — open the link Syntext emailed you, or resend it — then approve.
If a request approved by an unverified account is still waiting to be picked up — say it was approved just before the requirement applied — stx login stops with exit code 1 and this message:
Releases before stx 0.7.0 don't show it; they keep polling until the code times out. See Email verification.
Token-Based Login (CI / Headless)
For CI pipelines and machines without a browser, use a project API key instead of stx login:
https://app.syntext.dev/projects/<project-id>/settings/api-keys)build scope — the full key is shown once, so copy it thenAn API key belongs to one project, not to a user — see Authentication and the CI/CD guide.
stx login --token <token> saves a token without the browser flow, but it checks the token against your account profile first, so it only accepts a user session token — an API key is refused there.
Revoked sessions
A CLI session can be signed out from elsewhere — revoked in the dashboard's sessions list, by a password change, or by signing out everywhere. The API then answers 401 session_revoked (see Sessions).
Since stx 0.7.0, every command handles this the same way:
1 and tells you to run stx login again.stx login saved, the saved credentials are deleted. A token you passed with --token leaves the saved login alone.--json, the error includes the code: { "success": false, "error": "…", "code": "session_revoked" }.stx dev stops watching instead of retrying.Releases before 0.7.0 reported the 401 as a failed request.
Logging Out
Remove stored credentials at any time:
stx logout deletes the credentials stored on this machine. It does not sign the session out on the server: the CLI session stays listed under your account until you revoke it — from the dashboard's sessions list, or with Revoke Session.