Skip to Content
ReferenceCLI configuration

CLI environment variables and file locations

This page lists every environment variable the SynapseX CLI supports and every file it reads or writes. Use it to point the CLI at a different endpoint, run it unattended in CI, or find out exactly where your credentials and session database live before you back them up or delete them.

Two commands print the authoritative values for your operating system:

synapsex-code debug paths synapsex-code debug config

debug paths prints the resolved data, config, cache, state, log, bin, repos and tmp directories. debug config prints the merged configuration after every file below has been applied. When this page and those two commands disagree, trust the commands.

Which environment variables change where the CLI connects

VariableWhat it doesDefault
SYNAPSEX_API_KEYAPI key for the built-in synapsex model provider. Setting it loads the provider without running providers loginunset
SYNAPSEX_API_URLBase URL of the SynapseX model APIhttps://platform.synapsex.ai/api/v1
SYNAPSEX_AUTH_URLOrigin used by the device-flow sign-in for the synapsex providerhttps://chat.synapsex.ai
SYNAPSEX_COMPUTE_URLOrigin of SynapseX Compute, used by lab login and the lab commandshttps://chat.synapsex.ai

Setting SYNAPSEX_API_KEY is the supported way to run the CLI unattended — for example in CI, where there is no browser to complete the device flow:

export SYNAPSEX_API_KEY=YOUR_API_KEY synapsex-code models

Which environment variables change how the CLI runs

VariableWhat it doesDefault
SYNAPSEX_PYTHONInterpreter used by lab run --local for .py filespython3
SYNAPSEX_CODE_SERVER_USERNAMEBasic-auth username for the headless serversynapsexCode
SYNAPSEX_CODE_SERVER_PASSWORDBasic-auth password for the headless server. Leaving it unset starts the server unsecuredserve and web say so explicitly on startupunset
SYNAPSEX_CODE_CONFIGPath to an explicit config fileunset
SYNAPSEX_CODE_CONFIG_DIROverride the config directory used for global config resolutionXDG config dir
SYNAPSEX_CODE_DISABLE_PROJECT_CONFIGWhen true or 1, stop discovering per-project .synapsexCode directoriesunset
SYNAPSEX_CODE_LOG_LEVELSame as --log-levelunset
SYNAPSEX_CODE_PRINT_LOGSSame as --print-logsunset
SYNAPSEX_CODE_PURESame as --pureunset

The binary also carries a large number of experimental SYNAPSEX_CODE_* variables. They are unstable and are deliberately not documented here — do not build on them.

In which order are config files loaded?

Configuration is merged from several places. Later sources win over earlier ones, so a project setting always overrides a global one.

1. The global config directory — three files, loaded in this exact order:

OrderFile
1config.json
2synapsexCode.json
3synapsexCode.jsonc

2. Per-project config files. Starting from your current directory, the CLI walks up to the worktree root looking for synapsexCode.jsonc and synapsexCode.json. Files closer to your current directory win. Set SYNAPSEX_CODE_DISABLE_PROJECT_CONFIG=1 to switch this discovery off.

3. .synapsexCode/ directories. The same upward walk also collects .synapsexCode/ directories in the project, plus one in your home directory.

Run synapsex-code debug config to see the result of all of this on your machine.

Where does the CLI store credentials and data?

The CLI keeps its files in four standard directories, each with a synapsexCode folder inside it. Run synapsex-code debug paths to print the resolved location of each on your OS.

FileDirectoryWhat it holds
auth.jsondataYour stored credentials — the synapsex entry created by providers login and the synapsex-compute entry created by lab login. Written with permissions 0600 (owner read/write only)
synapsexCode.dbdataThe local SQLite database backing sessions and stats. synapsex-code db path prints its full path
lab-sessions.jsonstateA map of project directory to active Lab session id, written by lab open. It contains only session ids — never a token
cacheCache directory
bin/cacheDownloaded helper binaries

To remove everything, use synapsex-code uninstall — see /reference/cli-commands for its --keep-config, --keep-data and --dry-run flags.

Installer environment variables

These are read by the install script only, not by the CLI itself.

VariableWhat it doesDefault
INSTALL_DIRDirectory the binary is written to/usr/local/bin on macOS and Linux; %LOCALAPPDATA%\synapsex-code on Windows
BINARY_NAMEName the binary is installed undersynapsex-code
DOWNLOAD_BASEBase URL artifacts are fetched fromhttps://synapsex.ai/downloads
# Install without needing write access to /usr/local/bin curl -fsSL https://synapsex.ai/install.sh | INSTALL_DIR=$HOME/.local/bin sh

There is no supported way to pin a version. The download URL contains no version component, so the installer always fetches the current release. To update, re-run the same install command.

Install commands and download URLs for every platform: /reference/downloads.