feat: add startup launch support (#1421)
Add launch-at-startup support across the Electron desktop app and the web CLI. Electron now supports macOS launch-at-login through the native login item API. Login launches start OpenChamber in the background without opening a window, while Dock activation, deep links, and second-instance launches still open or focus the normal app window. The desktop Settings UI now exposes a localized launch-at-login toggle in Desktop Network Access. The web CLI now includes `openchamber startup status|enable|disable`, backed by native user services: - macOS: launchd LaunchAgent - Linux: systemd --user service - Windows: Task Scheduler Startup services run `openchamber serve --foreground` so the OS service manager owns process lifetime and restarts. Foreground service updates now defer restarts to the service manager instead of spawning duplicate CLI restarts. Startup services snapshot useful environment variables by default so provider tokens, PATH, SSH agent settings, and OpenCode configuration survive login/reboot starts. The snapshot avoids shell/session-only state, uses systemd-compatible env quoting on Linux, and avoids unused env artifacts on macOS. Also adds localized docs for startup services and environment variables.
This commit is contained in:
committed by
GitHub
parent
e97bf0d9dc
commit
2014303bc0
@@ -0,0 +1,134 @@
|
||||
---
|
||||
title: Environment Variables
|
||||
description: Configure OpenChamber and OpenCode integration with environment variables.
|
||||
---
|
||||
|
||||
# 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.
|
||||
|
||||
## OpenChamber server
|
||||
|
||||
### `OPENCHAMBER_HOST`
|
||||
|
||||
Bind address for the OpenChamber web server. Use `0.0.0.0` to allow access from other machines.
|
||||
|
||||
### `OPENCHAMBER_UI_PASSWORD`
|
||||
|
||||
Password for the browser UI. Use this when binding outside localhost, using tunnels, or running behind a reverse proxy.
|
||||
|
||||
### `OPENCHAMBER_DATA_DIR`
|
||||
|
||||
Overrides the OpenChamber data directory. The default is `~/.config/openchamber`.
|
||||
|
||||
### `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.
|
||||
|
||||
## 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 used by OpenChamber voice features that call OpenAI-compatible services.
|
||||
|
||||
### `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.
|
||||
Reference in New Issue
Block a user