Concepts
dst is a thin client. It carries your identity and your active workspace, then talks to Destesi’s services over HTTPS. Understanding four things — authentication, workspace context, config resolution, and output contracts — is enough to use every command and to script the CLI reliably in CI.
One binary for the whole suite
Section titled “One binary for the whole suite”dst is a single command tree with a subcommand per product. The same login and the same active workspace flow into every one:
dst snap— git-style branching for Postgres and S3 (see Snap)dst preview— ephemeral per-PR preview environments (see Preview)dst review— read recent AI code reviews (see Code Review)dst mcp— connect Destesi to your AI coding agent (see MCP)dst workspace— create, list, switch, and manage members of workspacesdst third-party-apps— connect a GitHub account so previews can pull private reposdst api-key,dst login,dst logout,dst whoami— identity and credentialsdst init— scan a repo and write a.destesi.ymldst upgrade,dst version— keep the binary current
This mirrors the suite itself: one account, one workspace, many products. See What is Destesi for the bigger picture.
Authentication: sessions vs. bearer tokens
Section titled “Authentication: sessions vs. bearer tokens”dst authenticates with a bearer token sent as Authorization: Bearer <token>. There are two ways to get one, suited to two different environments.
Browser session login (interactive)
Section titled “Browser session login (interactive)”dst loginOpens your browser, you approve the session, and the resulting token is written to ~/.dst/config.yaml. This is the path for your laptop. Verify and end a session with:
dst whoami # who am I, against the current APIdst logout # revoke the token server-side and clear local credentialsIf a browser isn’t available (a remote host, a container), dst login prints a verification URL and a code so you can approve from another device.
API keys (CI and automation)
Section titled “API keys (CI and automation)”For pipelines, mint a long-lived key and hand it to the runner as an environment variable — no browser, no interactive login:
dst api-key create --label "my laptop" # a personal tokendst api-key list # see your keysdst api-key revoke <id> # revoke oneFor CI specifically, mint a preview-runner key. It is scoped to preview:write on a single workspace, so leaking it from a build log can’t touch your database branches, other workspaces, or the rest of your account:
dst api-key create --preview-runner --workspace my-workspace --label github-actions -o tokenThe plaintext token is shown once at creation — store it immediately. Provide it to dst in CI via the DESTESI_API_KEY environment variable (see below); no dst login is required.
See Accounts & SSO for how sessions work across the suite and Auth in the CLI for the credential model in depth.
Workspace context
Section titled “Workspace context”Almost every product command runs against your active workspace — the unit of collaboration where all your data lives. Set it once:
dst workspace switch my-workspaceThe active workspace is saved in ~/.dst/config.yaml and reused by dst snap, dst preview, dst third-party-apps, and friends. A workspace is identified by its slug (a lowercase, URL-safe handle like my-workspace); dst workspace switch accepts either the slug or the workspace id and resolves to the canonical slug. Run a product command before selecting a workspace and dst tells you exactly what to do:
no active workspace — run `dst workspace switch <name>` firstIn CI, set the workspace with the DESTESI_WORKSPACE environment variable instead of switching interactively. See Workspaces.
Config resolution
Section titled “Config resolution”dst reads its settings from ~/.dst/config.yaml (written by dst login and dst workspace switch), then layers environment variables on top. Environment variables always win, so a CI runner can override whatever a developer image happened to ship with. Precedence, highest first:
- Per-command flags — e.g.
--api-url,--workspace - Environment variables —
DESTESI_API_URL,DESTESI_IDENTITY_API_URL,DESTESI_API_KEY,DESTESI_WORKSPACE ~/.dst/config.yaml— the on-disk config
Empty environment variables are ignored — unsetting one means “leave the on-disk value alone”, not “force it empty”. The config file is created with 0600 permissions in a 0700 directory because it holds your bearer token. See the reference for the full list of fields and variables.
Output formats and exit codes
Section titled “Output formats and exit codes”The CLI is designed to be both readable at a terminal and parseable in a script.
- Most commands print a human-readable table by default and accept
-o json(or--output json) for the full object. - Single-field formats keep pipelines to one line:
dst preview show <id> -o urlprints just the public URL;-o idprints just the id;dst review list -o idsprints one id per line. dst preview waituses distinct exit codes so a CI step can branch on the result:0healthy,1failed,2timed out,3deleted while waiting.
These shapes are part of the contract — scripts can depend on them. The reference lists the supported format for each command.
How it fits the suite
Section titled “How it fits the suite”dst is one of several ways into Destesi — alongside the web apps and the MCP server. They all share the same backbone:
- One identity, one workspace. The token
dstcarries is the same single sign-on identity you use in the browser, scoped to the same workspace. - Credentials live in Connect. To preview a private GitHub repo, the workspace connects a GitHub account once; products fetch that credential at call time. You never store a third-party token per product. See Connect.
- Artifacts land in Drive. Output that products produce is registered in Drive, the single library across the suite.
- What you can do is gated by entitlements. Your plan determines which products and limits apply — see Entitlements.