Skip to content
↑↓Navigate ↵Open escClose

Environment Variables

OpenChamber reads these environment variables at startup. For startup services, openchamber startup enable snapshots the current environment by default, so rerun it after changing variables you want the service to use. Variables OpenChamber itself set in the shell you run it from, such as the desktop app’s terminal or an agent’s shell, stay out of the service; your own exports carry over from there too, unless you re-export a name OpenChamber already set in that shell, which a regular terminal avoids.

Variables for OpenCode, Git and the terminal

To give OpenCode, Git, the terminal and project actions variables of your own, such as an API token or a database address, add them in Settings → General → Environment variables instead of exporting them before OpenChamber starts. Values stay on the machine that runs OpenChamber, in environment.json in the data directory, readable only by your user. Settings never shows a value again: you can replace or remove it, not read it back.

  • OpenCode gets them when it starts, so restart it after a change. Settings offers the button.
  • Variables you set with opencode service set env reach OpenCode too. The ones from Settings win.
  • Git, the terminal and project actions get them on their next run.
  • Variables OpenChamber sets for OpenCode itself, like its password and config, win over yours.

A project can add its own variables, or a command such as direnv export json that prints them, in Settings → Projects. See Projects.

The variables don’t reach an OpenCode server you started yourself, and the VS Code extension has no such setting. Everything below is read by OpenChamber itself at startup.

OpenChamber server

OPENCHAMBER_HOST

Bind address for the OpenChamber web server. Use 0.0.0.0 to allow access from other machines.

OPENCHAMBER_LAN_URL

The address other devices on your network use to reach OpenChamber, such as http://192.168.1.20:3000. Pairing links and QR codes offer it instead of the address OpenChamber detects itself. Set it when that guess is wrong, for example in Docker, where OpenChamber only sees the container’s internal address.

OPENCHAMBER_UI_PASSWORD

Password for the browser UI. Use this when binding outside localhost, using tunnels, or running behind a reverse proxy.

OPENCHAMBER_UI_SESSION_TTL_HOURS

How long a browser sign-in lasts, in hours, when “trust this device” is off. The default is 12.

OPENCHAMBER_UI_TRUSTED_SESSION_TTL_DAYS

How long a sign-in lasts, in days, on a device you chose to trust. The default is 7.

OPENCHAMBER_API_ONLY

Starts OpenChamber in headless mode when set to true or 1. API routes stay available for desktop and mobile clients, but the browser UI is not served.

OPENCHAMBER_FRAME_ANCESTORS

Origins allowed to show OpenChamber inside a frame on their own page, separated by spaces, for example https://dash.example.com. * allows any site. By default only OpenChamber itself and its desktop and mobile apps may frame it, which keeps other sites from overlaying its buttons.

OPENCHAMBER_DATA_DIR

Overrides the OpenChamber data directory. The default is ~/.config/openchamber.

Everything OpenChamber stores lives under this directory: settings, auth, project configs, themes, plans, and speech models. An instance that used a custom directory before version 1.23 gets its projects, themes, and speech-models folders copied from ~/.config/openchamber on the first start; the originals stay in place and nothing is merged.

OPENCHAMBER_CHATS_DIR

Moves the managed chat directories that OpenChamber creates for chats without a project. The default is ~/.config/openchamber/chats. Set it to a directory the OpenCode server can read when OpenChamber and OpenCode run as different users. Existing chats are not moved.

OPENCHAMBER_COMPRESS_API

Controls API response compression. Use true or 1 to force it on, false or 0 to force it off.

OPENCHAMBER_SKIP_API_COMPRESSION

Disables API response compression when set to true or 1. This takes precedence over OPENCHAMBER_COMPRESS_API.

OPENCHAMBER_VERBOSE_REQUEST_LOGS

Enables verbose HTTP request logs when set to true or 1.

OPENCHAMBER_UPDATE_API_URL

Overrides the update-check API endpoint. Most users should leave this unset.

OPENCHAMBER_PACKAGE_MANAGER

Forces the package manager used by update operations when auto-detection is wrong.

Proxy

HTTP_PROXY, HTTPS_PROXY, NO_PROXY

Sends OpenChamber’s own outgoing requests, such as usage limits and skill catalogs, through a proxy. Lowercase names work too. Hosts in NO_PROXY connect directly, and localhost, 127.0.0.1 and ::1 always do, so sign-in callbacks and the local OpenCode server keep working.

OpenCode server

OPENCODE_HOST

Connects OpenChamber to an existing OpenCode server. The value must be an http or https origin with an explicit port and no path, query, or hash. OPENCODE_HOST takes precedence over OPENCODE_PORT.

OPENCODE_PORT

Sets the OpenCode server port. With managed OpenCode this requests the managed port; with OPENCODE_SKIP_START=true it connects to an external server on that port.

OPENCODE_SKIP_START

Prevents OpenChamber from starting its own OpenCode server when set to true.

OPENCHAMBER_OPENCODE_HOSTNAME

Bind hostname for the OpenCode server managed by OpenChamber. The default is 127.0.0.1.

OPENCODE_BINARY

Path to the opencode executable OpenChamber should run.

OPENCODE_CONFIG

Path to a specific OpenCode config file.

OPENCODE_CONFIG_DIR

Path to a specific OpenCode config directory for agents, skills, snippets, and config discovery.

OPENCODE_DATA_DIR

Custom data directory for the managed OpenCode server.

OPENCODE_WSL_DISTRO

Selects the WSL distro used for OpenCode integration on Windows.

OPENCHAMBER_OPENCODE_WSL_DISTRO

OpenChamber-specific alias for selecting the WSL distro. OPENCODE_WSL_DISTRO takes precedence when both are set.

OPENCODE_JWT_SECRET

Secret used to sign UI authentication tokens. Use a long random value for persistent service deployments.

Terminal and Git

OPENCHAMBER_TERMINAL_SHELL

Shell executable used for OpenChamber terminal sessions.

OPENCHAMBER_GIT_BINARY

Git executable used by OpenChamber Git features.

GIT_BINARY

Alternative Git executable override. Prefer OPENCHAMBER_GIT_BINARY for OpenChamber-specific configuration.

OPENCHAMBER_GIT_READ_CACHE_TTL_MS

Time-to-live, in milliseconds, for cached Git-backed file reads. Set 0 to disable this cache while debugging.

Voice and tunnels

OPENAI_API_KEY

API key OpenChamber voice features use when they call OpenAI itself. It is never sent to a custom OpenAI-compatible server: give that server its own key in Settings.

OPENCHAMBER_ALLOW_REMOTE_OPENAI_COMPAT_URLS

Allows remote OpenAI-compatible base URLs for voice features when set to true or 1.

NGROK_AUTHTOKEN

ngrok auth token used by OpenChamber tunnel commands. You can also configure ngrok with ngrok config add-authtoken <token>.

Runtime helpers

BUN_BINARY

Bun executable OpenChamber should use when spawning daemon processes.

BUN_INSTALL

Bun installation root. OpenChamber uses it to find bin/bun for daemon startup and updates.

VITE_OPENCODE_URL

Build-time API base URL for the Vite-built web app. Most users should not set it for normal CLI or desktop usage.