Run it headless: the services
How to stand LegalWork up without the desktop shell — the orchestrator that supervises everything, the workspace API it fronts, and the chat bridge.
Quick start
npm install -g legalwork-orchestrator
legalwork start --workspace /path/to/workspace --approval auto
When run in a TTY, legalwork shows an interactive status dashboard with service health, ports, and
connection details. Use legalwork serve or --no-tui for log-only mode.
legalwork serve --workspace /path/to/workspace
legalwork ships as a compiled binary, so Bun is not required at runtime.
If npm skips the optional platform package, postinstall falls back to downloading the matching
binary from the legalwork-orchestrator-v<version> GitHub release. Override the download host with
LEGALWORK_ORCHESTRATOR_DOWNLOAD_BASE_URL when you need to use a mirror.
legalwork downloads and caches the legalwork-server, opencode-router, and opencode sidecars on
first run using a SHA-256 manifest. Use --sidecar-dir or LEGALWORK_SIDECAR_DIR to control the
cache location, and --sidecar-base-url / --sidecar-manifest to point at a custom host.
Use --sidecar-source to control where legalwork-server and opencode-router are resolved
(auto | bundled | downloaded | external), and --opencode-source to control
opencode resolution. Set LEGALWORK_SIDECAR_SOURCE / LEGALWORK_OPENCODE_SOURCE to
apply the same policies via env vars.
By default the manifest is fetched from
https://github.com/eigenweltlabs/legalwork/releases/download/legalwork-orchestrator-v<version>/legalwork-orchestrator-sidecars.json.
OpenCode Router is optional. If it exits, legalwork continues running unless you pass
--opencode-router-required or set LEGALWORK_OPENCODE_ROUTER_REQUIRED=1.
For development overrides only, set LEGALWORK_ALLOW_EXTERNAL=1 or pass --allow-external to use
locally installed legalwork-server or opencode-router binaries.
Add --verbose (or LEGALWORK_VERBOSE=1) to print extra diagnostics about resolved binaries.
OpenCode hot reload is enabled by default when launched via legalwork.
Tune it with:
--opencode-hot-reload/--no-opencode-hot-reload--opencode-hot-reload-debounce-ms <ms>--opencode-hot-reload-cooldown-ms <ms>
Equivalent env vars:
LEGALWORK_OPENCODE_HOT_RELOAD(router mode)LEGALWORK_OPENCODE_HOT_RELOAD_DEBOUNCE_MSLEGALWORK_OPENCODE_HOT_RELOAD_COOLDOWN_MSLEGALWORK_OPENCODE_HOT_RELOAD(start/serve mode)LEGALWORK_OPENCODE_HOT_RELOAD_DEBOUNCE_MSLEGALWORK_OPENCODE_HOT_RELOAD_COOLDOWN_MS
Or from source:
pnpm --filter legalwork-orchestrator dev -- \
start --workspace /path/to/workspace --approval auto --allow-external
When LEGALWORK_DEV_MODE=1 is set, orchestrator uses an isolated OpenCode dev state for config, auth, data, cache, and state. LegalWork's repo-level pnpm dev commands enable this automatically so local development does not reuse your personal OpenCode environment.
The command prints pairing URLs by default and withholds live credentials from stdout to avoid leaking them into shell history or collected logs. Use --json only when you explicitly need the raw pairing secrets in command output.
Use --detach to keep services running and exit the dashboard. The detach summary includes the
LegalWork URL and a redacted opencode attach command, while keeping live credentials out of the detached summary.