Skip to content
STYXDocs
Download

Docs / Reference

Environment variables

Every `STYX_*` environment variable the app, the `styx` CLI and the broker read or set, and who each one is for.

Styx needs no environment variables to run. The ones below are for a few user choices, for the variables Styx gives each task, and for development and testing. Set them in the environment that starts Styx (for example STYX_WIN_SHELL=wsl in your user environment on Windows).

For users

VariableRead byWhat it does
STYX_WIN_SHELLApp (terminals, Run locally)Windows only. wsl makes terminals and the local run use wsl.exe; anything else, or unset, uses PowerShell.
STYX_GITHUB_CLIENT_IDApp (GitHub target)A GitHub OAuth app client id for connecting a GitHub target through the browser (device flow). Without it, connect GitHub with your gh login or a token instead.

Set by Styx for each task

Styx sets these in every agent's environment when a task starts. The styx CLI, the provider shims and styx mcp read them; your own scripts can too. Never copy STYX_TOKEN anywhere: it lets anything that holds it act as that task until the task ends.

VariableRead byWhat it holds
STYX_SESSION_IDCLI, broker client, MCP configThe task's id.
STYX_TOKENCLI, broker client, MCP configThe task's broker token. Styx keeps only its hash.
STYX_BROKERCLI, broker client, MCP configWhere the local broker listens: a Unix socket in a private styx-<uid> folder in the system temp directory, or a named pipe on Windows.
STYX_SHIM_DIRCLI (styx wrap)The folder with the styx and provider shims. It is first on the task's PATH; styx wrap skips it when it looks for the real tool.
STYX_CLIShim scriptsPath of the bundled styx.js.
STYX_EXEShim scriptsPath of the Styx executable the shims run the CLI with.
STYX_PROJECT_IDNothing in StyxThe project's id, for your own scripts.
STYX_WORKTREENothing in StyxThe task's worktree path, for your own scripts.

Terminals you open in Styx get STYX_SHIM_DIR, STYX_CLI, STYX_EXE and STYX_BROKER, but no task id or token: they aren't tied to a task and can't ask for grants.

Styx also sets:

  • STYX_SSH_HOST (as user@host) in the credentials of an SSH grant, next to SSH_AUTH_SOCK.
  • STYX_OPEN_IN=1 in your Windows user environment when it installs the "Open in Styx" launcher. It only exists to tell Windows the environment changed.

For development and testing

These change what Styx does in ways meant for working on Styx itself: fake data, fake keychain, fake Touch ID. Don't set them on the copy you use.

VariableRead byWhat it does
STYX_FIXTUREAppdemo, empty or error: start with seeded demo data instead of your own. Uses a fresh temporary data folder unless STYX_USER_DATA is set.
STYX_FIXTURE_RESETApp1: delete the database in the data folder before seeding.
STYX_DEMO_REPOSApp0: with the demo or error fixture, don't create the real git repos behind the demo projects.
STYX_USER_DATAAppUse this folder for Styx's data (database, shims) instead of the normal one.
STYX_KEYCHAINAppmemory: keep credentials in memory instead of the OS keychain. With a fixture, fake credentials are seeded and target refresh is off.
STYX_MFAAppauto passes, deny fails every Touch ID / Windows Hello / system password check, without a prompt.
STYX_NOWAppA time in epoch milliseconds: freezes Styx's clock there.
STYX_THEMEAppdark, light or system: force the theme, overriding the setting.
STYX_CHROMEAppmac or win: draw that platform's window chrome (for screenshots).
STYX_SCREENAppOpen on a screen or state, such as workspace, home, onboarding-2, palette or new-project.
STYX_E2EApp1: end-to-end test mode. No confirmation for styx://open, no updater, no usage counts, file pickers answered by STYX_E2E_PICK, and the prototype's sample data in a few places.
STYX_E2E_PICKAppWith STYX_E2E=1: the path every folder picker returns. Unset means the picker was cancelled.
STYX_APIAppBase URL of the Styx accounts API, for a local or fake server. Setting it also turns on usage counts in a development build.
STYX_UPDATE_URLAppInstalled builds only: check this update feed instead of the built-in one.

pnpm dev with STYX_FIXTURE=demo is the usual way to run the app on demo data; see Testing.