opencode-webui 2.4.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,9 +37,63 @@ Options:
37
37
  | `WEBUI_TRUST_PROXY` | unset | Set to `1` when a trusted reverse proxy sits in front, so `X-Forwarded-Host`/`Proto` are honored. Without it those headers are ignored. |
38
38
  | `WEBUI_PROXY_PORT` | `4097` | Port for the UI and `/api/*`. |
39
39
  | `WEBUI_EXTENSION_DIR` | the global + project dirs | Adds a higher-precedence source shadowing both (the sandbox uses this to keep WIP isolated; shipped extensions still load underneath). |
40
+ | `WEBUI_NO_SETUP` | unset | `1` skips first-run setup for this run (CI, one-offs). |
41
+ | `WEBUI_NO_PLUGIN` | unset | `1` installs the global command but not the OpenCode lifecycle plugin. |
42
+ | `WEBUI_SETUP` | unset | `1` forces setup even in a repo checkout (testing). |
43
+
44
+ The serve/security vars above can also be set **durably** — no shell needed —
45
+ in `~/.config/opencode/webui/config.json`, edited from **Settings › Access** in
46
+ the UI or `opencode-webui config` on the CLI. Precedence per key is
47
+ **explicit env var → config file → default**; changes apply after a restart
48
+ (the Access tab has a "Restart now" button). The file is `0600`; a password set
49
+ there is stored as a SHA-256 hash, never plaintext. Setting a reachable bind or
50
+ `allowedHosts: ["*"]` is allowed but warned about, and a *reachable* instance
51
+ with **no password** needs an explicit confirmation.
40
52
 
41
53
  Sessions are shared with the `opencode` TUI — open a session in the TUI, continue it in the browser.
42
54
 
55
+ ### Setup (run once) — the `opencode-webui` command + OpenCode plugin
56
+
57
+ First boot self-installs two things, so you don't pay for `bunx` on every
58
+ start and the webui comes up with OpenCode:
59
+
60
+ 1. **A global `opencode-webui` command** (`~/.local/bin/opencode-webui`, or
61
+ `WEBUI_BIN_DIR`) that execs the installed entry directly — fast, no bunx
62
+ resolution. The first-boot banner tells you if that directory isn't on
63
+ `PATH`.
64
+ 2. **A built-in OpenCode lifecycle plugin** written to
65
+ `~/.config/opencode/plugins/opencode-webui/`, which the engine
66
+ auto-discovers. It starts the webui in the background as soon as OpenCode
67
+ activates its plugins (i.e. when you use OpenCode) — detached,
68
+ fire-and-forget, and it never starts a second copy (a running webui answers
69
+ on its port and wins).
70
+
71
+ ```sh
72
+ opencode-webui # start (starts the opencode service first if needed)
73
+ opencode-webui update # update to the latest version and restart
74
+ opencode-webui status # command, plugin, launch command, running pid
75
+ opencode-webui restart # restart the background webui
76
+ opencode-webui stop # stop it
77
+ opencode-webui uninstall # remove the command + plugin (remembered; no auto-reinstall)
78
+ ```
79
+
80
+ A repo checkout (`bun run dev` / `bun run start`) never self-installs, so
81
+ development cannot fight your installed command. `WEBUI_NO_SETUP=1` skips
82
+ setup for one run, `WEBUI_NO_PLUGIN=1` installs the command but not the plugin,
83
+ and `autostart: false` in the config (the **Startup** toggle in Settings ›
84
+ Access) turns it off persistently. The plugin only ever starts a webui that is
85
+ already installed; it installs only its own folder and removes it cleanly on
86
+ `uninstall`.
87
+
88
+ ```sh
89
+ opencode-webui config # show effective serve settings + source
90
+ opencode-webui config set host 0.0.0.0
91
+ opencode-webui config set allowed-hosts 192.168.1.5,myserver.lan
92
+ opencode-webui config set password # read from stdin
93
+ opencode-webui config set auth none --confirm # no login (warned)
94
+ opencode-webui restart # apply
95
+ ```
96
+
43
97
  ## Install (no Bun)
44
98
 
45
99
  Binaries are attached by CI on each version tag — grab one for your platform from
@@ -62,6 +116,13 @@ chmod +x opencode-webui-linux-x64
62
116
  Behind a reverse proxy (Caddy / nginx samples, incl. websocket + SSE timeouts):
63
117
  [docs/reverse-proxy.md](docs/reverse-proxy.md).
64
118
 
119
+ ## Install as app (PWA)
120
+
121
+ Over HTTPS (e.g. Tailscale serve) Chrome offers install — standalone window, splash, home-screen icon.
122
+ Settings → App shows install state plus the **live activity tile**: one silent notification following
123
+ active sessions (dense strip text, tap opens that session, clears itself when idle). Needs notification
124
+ permission; plain-LAN HTTP stays a browser tab (secure context required).
125
+
65
126
  ## Sandbox
66
127
 
67
128
  A second, private instance for agents (or you) to test extensions and settings
@@ -121,14 +182,20 @@ session agent instead, so it can file it via `gh`.
121
182
 
122
183
  ```sh
123
184
  bun install
124
- bun run dev # proxy (4097) + Vite (5173), HMR
185
+ bun run dev # proxy (config port, default 4097) + Vite (5173), HMR
125
186
  bun run sandbox # isolated second instance (4099 / 5175, Vite in dev) — see Sandbox above
126
187
  bun run typecheck
127
188
  bun run build && bun start # production: dist/ + API on 4097
128
189
  ```
129
190
 
191
+ To open the dev UI from a phone/Tailscale, set the bind address to `0.0.0.0`
192
+ and add your host under **Settings › Access** — Vite honors the same values, so
193
+ `http://<this-machine>:5173` works (the proxy stays on its own port).
194
+
130
195
  - Extension authoring guide: [webui-extensions/README.md](webui-extensions/README.md)
131
196
  - Extension contract check: `bun run scripts/uitest/extensions-check.ts`
197
+ - Setup check: `bun run check:setup` (global command + lifecycle plugin + CLI, isolated HOME/XDG)
198
+ - Config check: `bun run check:config` (resolution/precedence, validation, exposure, `config` CLI)
132
199
  - Architecture, editing rules, roadmap: [AGENTS.md](AGENTS.md)
133
200
 
134
201
  ## License