$$$`. Anyone who
reads the hash cannot sign in with it, and it cannot be turned back into the
password.
Sessions are not signed with the password hash. A random signing key is created
on first start in `~/.omp/agent/omp-web/web-auth-secret.json` (mode `0600`) and
mixed with the hash, so changing the password still signs everyone out while the
stored hash alone is never enough to forge a session.
The service installers (`ompweb systemd install`, `ompweb-launchd install`, the
Linux tray, and the Windows service) still accept `OMP_WEB_PASSWORD` at install
time and hash it before writing it to their configuration. Only the hash is
stored.
On Windows, the tray and background service read `OMP_WEB_PASSWORD_HASH` from
your user or system environment (for example `setx OMP_WEB_PASSWORD_HASH
"scrypt$…"`) each time they start the server, not from the environment they were
started with. Changing or removing the hash takes effect at the next server
restart, without signing out of Windows.
### Run as a Windows Service (System Tray)
Install ompweb as a Windows background service with a system tray icon and autostart at login:
```bash
ompweb --install-tray
```
Manage it from **Settings → System & Updates → Windows Background Service**, or via CLI:
```bash
ompweb --tray # Start the tray manager
ompweb --uninstall-tray
```
Shortcuts are created on the Desktop and Start Menu. The service restarts automatically and shows the current port and status in the tray.
### Run as a macOS Service (launchd)
Install ompweb as a launchd user agent that starts at login and restarts on crash:
```bash
npx --yes @kahme247/ompweb@latest ompweb-launchd install
```
Manage it with:
```bash
npx --yes @kahme247/ompweb@latest ompweb-launchd status # Show service state
npx --yes @kahme247/ompweb@latest ompweb-launchd uninstall # Stop and remove
```
The service runs `npx --yes @kahme247/ompweb@latest`; pass a package spec to pin a
version, e.g. `ompweb-launchd install @kahme247/ompweb@0.3.6`. All
[environment variables](#environment-variables) are read at install time and baked
into the plist, plus `OMP_WEB_PKG` (package spec, same as the positional argument).
As a service, the browser is **not** auto-opened by default — install with
`OMP_WEB_NO_OPEN=0` to restore that.
```bash
OMP_WEB_PASSWORD=secret npx --yes @kahme247/ompweb@latest ompweb-launchd install
```
`OMP_WEB_PASSWORD` is hashed at install time; the plist holds the hash, never
the password. Pass `OMP_WEB_PASSWORD_HASH` to install a hash you generated with
`ompweb hash-password`.
When binding to a non-loopback host, require authentication (`OMP_WEB_PASSWORD_HASH`
or equivalent access control) and HTTPS through a trusted reverse proxy or VPN.
Never expose the unauthenticated web UI or send its password/session cookie over
plaintext HTTP.
Logs go to `~/Library/Logs/ompweb/ompweb.log` and the plist lives at
`~/Library/LaunchAgents/com.kahme247.ompweb.plist` (mode 600; the password
hash — not the password — is stored there).
### Run as a Linux Service (systemd)
Install ompweb as a systemd **user** service that starts at login and restarts
on crash:
```bash
npx --yes --package=@kahme247/ompweb@latest ompweb-systemd install
```
The installer creates `~/.omp/agent/web-service.env` automatically with mode
`600`; no manual file creation is required. The explicit `--package` form makes
`npx` run the systemd executable from the selected package.
To bind the service to all IPv4 interfaces for LAN access, set a password while
installing:
```bash
OMP_WEB_HOSTNAME=0.0.0.0 OMP_WEB_PASSWORD='change-me' \
npx --yes --package=@kahme247/ompweb@latest ompweb-systemd install
```
The password is hashed before it is written to `web-service.env`.
Manage it with:
```bash
npx --yes --package=@kahme247/ompweb@latest ompweb-systemd status # Show service state
npx --yes --package=@kahme247/ompweb@latest ompweb-systemd restart # start / stop / restart
npx --yes --package=@kahme247/ompweb@latest ompweb-systemd uninstall # Stop and remove
```
The service runs the locally installed `ompweb` binary resolved at install time
(override with `OMP_WEB_SYSTEMD_BIN`). Runtime configuration lives in
`~/.omp/agent/web-service.env` — the tray (or any editor) can change the port,
hostname, and password hash there and just restart the service; no reinstall
needed.
Install-time [environment variables](#environment-variables) are baked into
that file. As a service, the browser is **not** auto-opened by default. The
unit lives at `~/.config/systemd/user/ompweb.service` and logs go to the
journal:
```bash
journalctl --user -u ompweb -f
```
On a headless server, enable user lingering if the service must keep running
after the last login session ends:
```bash
loginctl enable-linger "$USER"
```
### Linux System Tray (KDE Plasma and compatible)
On Linux, `ompweb-tray` registers a StatusNotifierItem tray icon with a context
menu: open the web UI, copy its URL, start/stop/restart the systemd service,
view logs, expose the web UI to the network, change the port, set the web
password, toggle autostart, and quit the tray.
```bash
npx --yes @kahme247/ompweb@latest ompweb-tray --install # Icons + autostart + start tray
npx --yes @kahme247/ompweb@latest ompweb-tray --status # Tray and service status
npx --yes @kahme247/ompweb@latest ompweb-tray --uninstall # Remove autostart, stop tray
```
**Expose to Network** rebinds the service from `127.0.0.1` to `0.0.0.0` so the
web UI is reachable from your LAN or VPN (e.g. Tailscale). Leaving loopback
requires a web password — the tray prompts for one via `kdialog`/`zenity` when
needed, and stores its hash. **Change Port…** and **Set Web Password…** edit
`~/.omp/agent/web-service.env` and restart the service. When binding to a
non-loopback host, use HTTPS through a trusted reverse proxy or VPN for remote
access.
"Start with Plasma" in the tray menu toggles a desktop autostart entry at
`~/.config/autostart/ompweb-tray.desktop`. Requires a running StatusNotifierItem
host (KDE Plasma, and most Wayland/X11 desktops).
## Features
- **Interactive Chat**: Real-time streaming conversation with your local `omp` agent — tool calls, thinking levels, token counts, cost, context gauge, queue controls, and interrupt & retry.
- **Message Copy**: Copy user messages and completed assistant replies as rendered plain text or original Markdown using the buttons below each message. Thinking, tool output, and message controls are excluded. Oversized messages that use the raw-text viewer copy their full source in either format.
- **Queue Deletion Confirmation**: Preview and confirm before cancelling queued follow-ups or steered messages in OMP. Requires native `remove_queued_message` support; already-delivered messages cannot be recalled.
- **Session Management**: Browse past conversations by project, fork sessions, branch within a session, archive/restore, import session files, and deep-link via URL.
- **Draft Recovery**: Unsent text stays scoped to its conversation or new-session workspace and is restored after Back/Forward navigation or reload in the same tab when browser storage is available (up to 50 drafts). Images and file attachments remain in memory only.
- **Live Plans & Subagents**: Collapsible panels pinned above the composer track live todo phases and running subagents (status, tool, retries, tokens/cost, nested tasks) with transcript dialogs and history recovery.
- **Tool Preset Picker**: Choose the toolset for new sessions in the composer — `none` / `default` (`read,bash,edit,write`) / `full` (all tools including subagents). Persists to localStorage.
- **File Explorer & Previews**: Browse workspaces side-by-side with chat; preview code, markdown, Mermaid, images, audio, PDFs, and diffs with allow-listed access.
- **Git Worktree Support**: Create, switch, and manage Git worktrees directly from the sidebar; sessions and file roots stay grouped by project.
- **Usage & Analytics**: Dashboard in **Settings → Usage** for tokens, costs, cache savings, and breakdowns by provider / model / day / project with SQLite persistence.
- **Windows System Tray & Service**: Background service, tray icon, logon autostart, and Desktop/Start Menu shortcuts (Windows).
- **macOS launchd Service**: LaunchAgent that starts at login, restarts on crash, and logs under `~/Library/Logs/ompweb`.
- **Linux systemd Service & Tray**: User service that starts at login and restarts on crash, plus a StatusNotifierItem tray icon with service controls (KDE Plasma and compatible desktops).
- **Notifications**: Desktop and mobile (PWA) notifications for finished tasks, questions waiting for an answer, failed runs, and automatic model switches, with Web Push when served over HTTPS. See [Notifications](#notifications).
- **Web-based Settings** (10 tabs): Interface & Behavior, Safety & Approvals, AI Model Defaults, API Keys & Providers, Usage, Agent & Intelligence (advisor, memory, compaction), Agents, Extensions & Tools (MCP, skills, plugins), Notifications, System & Updates.
- **Slash Commands & Shortcuts**: Quick prompts (`/plan`, `/review`, `/fix`, `/test`, etc.), `⌘K` / `Ctrl+K` palette, and model/reasoning cycling.
- **UI Themes & Localization**: Warm paper light/dark themes plus an omp.sh-inspired midnight (`omp`) theme, chat font size & interface scale, with full English, Chinese (简体中文), and Japanese (日本語) translations.
## Environment Variables
| Variable | Description | Default |
| --- | --- | --- |
| `PORT` | Server port | `30177` |
| `OMP_WEB_HOSTNAME` | Server bind host | `127.0.0.1` |
| `OMP_WEB_PASSWORD_HASH` | Optional scrypt hash of the web login password, from `ompweb hash-password`. Required for a non-loopback bind | _None (auth disabled)_ |
| `OMP_WEB_TRUSTED_HEADER_SHA256` | SHA-256 hex digest of the secret a trusted reverse proxy sends in `X-Omp-Web-Auth` to skip the password for that request; see [Skipping the password on trusted networks](#skipping-the-password-on-trusted-networks) | _None (disabled)_ |
| `OMP_WEB_NO_OPEN` | Set to `1` to prevent auto-opening browser | `0` |
| `OMP_WEB_DISABLE_AUTOUPDATE` | Set to `1` to disable update checks and in-app updates; restart after changing | `0` |
| `OMP_WEB_NAME` | Name shown in browser tabs and installed-app names. `url`, `host` or `domain` (any case) uses the hostname the browser connected to, without port; localhost and IP addresses keep `omp web`. Any other value is used as-is. Restart after changing | `omp web` |
| `OMP_WEB_OMP_BIN` | Path to `omp` binary if not on `PATH` | _auto-detected_ |
| `OMP_WEB_DEV_ORIGIN` | Additional allowed hostname for the development server (no scheme or port); ignored in production | _None_ |
| `PI_CODING_AGENT_DIR` | Custom omp agent directory | `~/.omp/agent` |
| `OMP_WEB_STT_ENDPOINT` | OpenAI-compatible transcription endpoint URL. Leave unset to transcribe with `OMP_WEB_STT_MODEL` through omp's own credentials | _None_ |
| `OMP_WEB_STT_KEY` | Optional API key for the STT endpoint | _None_ |
| `OMP_WEB_STT_MODEL` | Model name for the STT endpoint. Without an endpoint: an omp speech-to-text model run with omp's logins, such as `openai-codex/codex-transcribe` (ChatGPT subscription; needs an omp version with that model) | _None (disabled without an endpoint)_ |
**`OMP_WEB_NAME` and installed apps.** An installed app (PWA) is usually named after the page it was installed from. If you later change `OMP_WEB_NAME`, or reach omp-web through a different address while `OMP_WEB_NAME` is `url`, `host` or `domain`, your operating system may rename the installed app as well. Leave `OMP_WEB_NAME` empty, or set a name that identifies this omp-web server whatever domain name or address is used to reach it.
## Skipping the password on trusted networks
omp-web cannot see the client's address itself, so it leaves the decision to
your reverse proxy. The proxy sends a secret in the `X-Omp-Web-Auth` header,
and omp-web holds only that secret's SHA-256 digest in
`OMP_WEB_TRUSTED_HEADER_SHA256`. A request whose header hashes to that digest
is treated as signed in. Everyone else still signs in with the password whose
hash is in `OMP_WEB_PASSWORD_HASH`; without a password there is nothing to
skip, and the header is ignored. Keep omp-web bound to `127.0.0.1` so only the
proxy reaches it.
Generate the secret and its digest without typing the secret on a command line,
so it never lands in your shell history. This writes a random secret straight
into an nginx include file readable only by root and nginx, and prints only the
digest:
```bash
secret=$(openssl rand -hex 32)
printf 'map $ompweb_trusted $ompweb_auth {\n 1 "%s";\n default "";\n}\n' "$secret" \
| sudo install -m 0640 -o root -g www-data /dev/stdin /etc/nginx/ompweb-auth.conf
printf %s "$secret" | sha256sum | cut -d' ' -f1
unset secret
```
Use your nginx group in place of `www-data` (`nginx` on some distributions).
Set the printed digest as `OMP_WEB_TRUSTED_HEADER_SHA256`. The command history
holds only the commands, never the secret. On Windows, the tray and background
service read it from your user or system environment, like
`OMP_WEB_PASSWORD_HASH`.
Always generate the secret this way; do not reuse a password or another chosen
value. omp-web stores only a fast, unsalted SHA-256 digest, which is safe only
for a long random secret: anyone who reads the digest could recover a short or
guessable one with a dictionary attack.
With nginx, send the secret only to the address ranges you trust:
```nginx
# http {} context
geo $ompweb_trusted {
default 0;
10.0.0.0/16 1;
}
include /etc/nginx/ompweb-auth.conf; # the map written above
# the location that proxies to omp-web
proxy_set_header X-Omp-Web-Auth $ompweb_auth;
```
Always set the header, as above: the empty value for other clients replaces any
`X-Omp-Web-Auth` a client sends itself. nginx only inherits `proxy_set_header`
from outer blocks when a block sets none of its own, so put this line next to
the location's other `proxy_set_header` lines.
Serve omp-web only for its own hostname: give its `server` block an explicit
`server_name`, and add a `default_server` block that answers every other
hostname with `return 444;`. Otherwise a web page that a trusted browser visits
can point its own domain name at your nginx (DNS rebinding) and have nginx add
the secret to its requests.
`geo` checks `$remote_addr`, the address that connected to nginx. When clients
reach nginx through another proxy, use the
[`realip` module](https://nginx.org/en/docs/http/ngx_http_realip_module.html) to
replace it with the real client address. It does so only for connections from
addresses you list in `set_real_ip_from`:
- **Cloudflare (proxied DNS):** trust `CF-Connecting-IP`, and only from
Cloudflare. List every range from and
, and keep them up to date. Use this only
when Cloudflare is really in front.
```nginx
set_real_ip_from 173.245.48.0/20; # ...one line per Cloudflare range
real_ip_header CF-Connecting-IP;
```
Also refuse connections that come neither from Cloudflare nor from your
trusted ranges. `$realip_remote_addr` is the address that actually
connected, before `realip` replaced it:
```nginx
geo $realip_remote_addr $ompweb_peer_allowed {
default 0;
173.245.48.0/20 1; # ...every Cloudflare range
10.0.0.0/16 1;
}
# in the server block
if ($ompweb_peer_allowed = 0) { return 403; }
```
- **Cloudflare Tunnel (`cloudflared`):** the tunnel connects to nginx from
`cloudflared`'s address (`127.0.0.1` when it runs on the same machine), so
trust `CF-Connecting-IP` from there: `set_real_ip_from 127.0.0.1;` and
`real_ip_header CF-Connecting-IP;`. Any local process can then send its own
`CF-Connecting-IP` to nginx and claim a trusted address, and a local
connection without that header keeps `127.0.0.1`, so listing `127.0.0.1` in
`$ompweb_trusted` trusts every local process that connects to nginx.
- **Any other proxy or load balancer:**
```nginx
set_real_ip_from ;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
```
`real_ip_recursive on` reads `X-Forwarded-For` from the right and skips the
hops listed in `set_real_ip_from`. Addresses a client adds itself are
ignored.
## Development
```bash
git clone https://github.com/kahme247/ompweb.git
cd ompweb
npm install
npm run dev
```
The dev server runs at [http://127.0.0.1:30178](http://127.0.0.1:30178).
The development server allows loopback and RFC1918 private IPv4 origins
(`10.0.0.0/8`, `172.16.0.0/12`, and `192.168.0.0/16`). When using a tunnel
or reverse proxy with a custom hostname, set it without editing `next.config.ts`:
```bash
OMP_WEB_DEV_ORIGIN=dev.example.com npm run dev
```
For a persistent setup, set the variable in your local environment or service
configuration and restart the dev server. This does not change the bind address
or enable authentication. Next.js hostname patterns cannot express IPv6 CIDRs;
a private IPv6 origin must be supplied explicitly (for example, `[fd00::1]`).
### Checks
```bash
npm run typecheck # Type check (TypeScript)
npm run lint # ESLint
npm test # Run test suite
```
> **Note**: Do not run `npm run build` during local dev — it populates `.next/` and can break `npm run dev`.
## License & Credits
- Forked from [agegr/pi-web](https://github.com/agegr/pi-web) (MIT) and adapted for [can1357/oh-my-pi](https://github.com/can1357/oh-my-pi).
- Released under the [MIT License](./LICENSE).