Configuration
Most preferences are available in Settings. For repeatable setup, use the configuration file . Startup flags override the corresponding saved options.
Jump to running ocman , flags , environment variables , authentication or OpenCode setup .
Settings categories
Settings uses seven categories. Each page has named sections rather than another layer of tabs or collapsible panels.
| Category | Sections |
|---|---|
| App & notifications | Notifications, This device, Account |
| Sessions | New sessions, Conversation, Voice, History & archiving |
| Agents & models | Platforms, Hooks, Model fallback |
| Permissions | Auto-approve, AI reviewer, Worktrees |
| Connections & sharing | Remotes, Link previews, Public sharing, Webhooks |
| Plugins | Plugin management and per-plugin settings |
| System | Resource management, Application health |
Device, account and hooks sections appear only when applicable. Search opens the matching category and scrolls to the setting. Existing links to the old categories still open the corresponding new category.
Custom permission reviewer
Settings → Permissions → AI reviewer → Reviewer endpoint lets you use a self-hosted
model or a provider API directly. Ocman does not install models or manage their
servers. Choose an API format, enter its complete POST URL, supply a model ID,
and optionally enter a Bearer API key. The URL is reached from the ocman backend,
so 127.0.0.1 means the machine running ocman, not the browser’s machine.
| Reviewer API | Endpoint example | Model ID |
|---|---|---|
| OpenCode | Uses your existing OpenCode provider setup | Uses the separate reviewer-model setting |
| OpenAI-compatible chat completions | http://127.0.0.1:8080/v1/chat/completions | Required |
| TypeSafe-compatible System One | https://api.typesafe.ai/v1/systemone | Optional; omitted to use the server default |
The alternatives to Jev do not all use the same API. A server must implement one of the contracts below, or you must provide an adapter. Span-01 and a model that returns a single answer letter are not automatically compatible.
Reviewer requests include tool input and configured custom rules. OpenAI-compatible requests include up to six recent user-message excerpts. TypeSafe-compatible requests include the project directory and up to 32,000 bytes of retained user text across all messages, not a message-count or token limit. Exactly 32,000 bytes is accepted in full. Larger histories use the most recent text within that budget, oldest first, with UTF-8-safe clipping of the oldest included message. The request marks this context as incomplete. Limited-context reviews can grant automatic approval under the same deny rules and confidence thresholds, and their explanations identify the limited context. Earlier user restrictions may be omitted; the reviewer must not invent consent from omitted messages. Missing project or user context, policy-loading failure, and history-refresh failure or timeout stop the review before any endpoint request, with a specific explanation. Each Jev authorization read, including the final recheck, waits up to five seconds for a session-specific ingestion refresh. Unavailable ingestion or a failed refresh requires human review rather than using stale consent. Choosing a hosted endpoint sends that context to its provider.
- OpenAI-compatible. Ocman sends non-streaming
messageswith the existing permission-review prompt and custom rules. The response must contain one completed choice withfinish_reason: "stop"and JSON text inchoices[0].message.content, such as{"verdict":"safe","reasoning":"Read-only repository inspection."}. Refusals, incomplete outputs and malformed verdicts require human review. - TypeSafe-compatible. Ocman sends separate
environment,user_messagesand untrustedtool_callfields instate. Each policy rule is a namednoulquestion; the response must containanswers.<id>.type: "noul"and a numericanswers.<id>.noulprobability from 0 to 1 for every question. These are independent probabilities, not a distribution that sums to one. Existing adapters returning a singleverdictchoice must adopt this contract. Go applies the decision policy:- Hard-deny matches, including exfiltration, security bypasses, and violations of configured custom policy sections, cannot be cleared by an exception or consent.
- Soft-deny matches cover writes, deletion, remote side effects, operations outside the project, credentials, privilege changes, and user boundaries. A routine-project-work exception or explicit consent for the exact operation and target can clear them. An unlifted user boundary requires explicit consent, even if the routine-work exception matches.
- Deny rules match at
0.6. Exceptions, consent and sufficient-evidence checks must meet Minimum safe probability, default0.99, with a floor of0.7. Missing, malformed or insufficient evidence leaves the request for human review. The explanation names matched rules and any exception used. These are model probabilities, not measured error-rate guarantees. The static hard denylist still runs before the reviewer; Jev does not override manual permission rules.
Endpoint settings persist in the configuration file
; UI-managed keys
remain encrypted in this instance’s owner-only state.db and are referenced from
the file. External secret references are read-only through the UI.
Settings responses never return a saved key. Leave the key field blank to keep
it, or use Remove stored API key and save to delete it. Changing the URL
clears the old key unless you supply a replacement. Keys are sent only as
Authorization: Bearer …; redirects are not followed.
Endpoint failures leave the permission for human review. Jev judgments are never reused from the command cache or a parent’s cache. Policy and user context are checked again before applying an in-flight approval. A digest of all retained user prose also invalidates approval when omitted messages change. New Jev approvals remain visible in the audit history but cannot become inherited allow rules in child sessions. Other reviewers’ cached safe judgments remain scoped to the endpoint configuration that produced them, including the model and probability threshold. Choose OpenCode and save to return to the existing reviewer. Direct provider API calls use that provider’s billing, independently of any ChatGPT subscription.
Running ocman
Startup options and supported saved settings can also be managed through the configuration file . On first startup, ocman migrates supported saved settings into YAML and retains the database rows as a backup. The UI writes supported settings back to that file.
./ocman # default: listens on 127.0.0.1:8228
./ocman -addr localhost:9090 # custom listen address
./ocman -db /path/to/opencode.db # custom OpenCode database path
./ocman -platforms opencode # OpenCode only; default: OpenCode and Claude Code
./ocman -platforms claudecode # Claude Code only
./ocman -platforms opencode,codex # OpenCode and CodexOcman’s own runtime state (archived/seen flags, auth secret, favorites and managed credentials) lives in
~/.local/share/ocman/state.db, created on first run and migrated automatically. Startup
enforces owner-only permissions, 0700 for the directory and 0600 for the database and
SQLite sidecars, and fails rather than continuing if existing paths cannot be secured.
Before upgrading an existing state database, ocman saves a consistent SQLite backup
beside it, named state.db.backup-v<old>-to-v<new>-<unique>.db. The backup includes
committed WAL data and has owner-only permissions (0600). One backup covers the
entire migration batch, which runs in a single transaction. Startup logs the backup
path and refuses to migrate if the backup cannot be created or synced to disk.
Fresh databases, in-memory databases, and databases already at the current version
do not need a backup. Backups are retained, including after a failed migration;
remove unneeded copies manually. They cover the state database only, not external
artifact files or OpenCode’s database. Ocman never restores a backup automatically.
Conversation history and health
Retained conversations, project-list caches, text search and analytics live in a
separate state_conv.db beside state.db. Storage and ingestion are always
enabled. -conversations-db overrides OCMAN_CONVERSATIONS_DB, which overrides
the default path. The deprecated -statev2-db and OCMAN_STATEV2_DB aliases
remain accepted; the legacy environment variable is used only when the new one
is unset. If both flag names are supplied, the last one wins.
On first use of the default filename, startup can adopt an adjacent statev2.db
using a consistent SQLite snapshot, leaving the original intact. An existing
destination wins. A recorded adoption prevents a later reset from importing the
retired file again. This is durable history: deleting native sessions does not
delete retained conversations. Do not delete this database as a cache repair.
For a full backup, preserve both ocman databases and artifact files, using
SQLite-consistent backups or stopping ocman and its writers before copying.
Settings → System → Application health reports the backend connection and
conversation-history sync. Syncing in background means analytics can show
already-imported data while ingestion continues. Background tasks opens
/background-tasks to inspect import progress and individual failures. Sync
retries automatically; application reads do not fall back to native history
when stored history is unavailable. Each remote imports its own history.
Raw conversation history retention
Ocman keeps recent raw replay data and expires it automatically. Background cleanup waits one minute after startup, then works in slices of about 30 seconds with five minutes between slices. Once a pass finishes, the next pass is due a day later. The sweep saves its place across restarts and yields when ingestion needs the writer.
For OpenCode v2, the original message body expires 30 days after creation or its last source update, whichever is later. OpenCode v1 already supplies the message and part format used by Ocman and has no extra replay copy. For Claude Code and Codex, recent imports retain one compressed replay snapshot per session, including the context required to convert it offline. That snapshot expires 30 days after the session’s last source update. The snapshots add short-term storage on installations that did not previously save these inputs.
Normalized messages, tool outputs, diffs, attachments and provider databases are unchanged. If the platform has also deleted an expired original, Ocman can still render the saved conversation, but cannot recover fields it did not understand. SQLite can reuse freed pages; the sweep does not shrink the file. New conversation databases use SQLite’s incremental auto-vacuum mode, but Ocman does not yet schedule incremental reclamation. Existing databases keep their current mode. Upgrading does not rebuild them.
HTTP serving
The HTTP server limits request-header read time and idle keep-alive connections, and bounds how long a request body may take to arrive (30 s for normal API calls, 5 min for uploads). There is deliberately no global read/write timeout, so SSE streams and in-app terminals keep working. Ocman size-limits responses it reads from upstream services (OpenCode, GitHub/Forgejo). Browser responses deny framing and MIME sniffing and carry a Content Security Policy. That policy permits inline styles, same-origin/data/blob images, blob workers, and WebSockets only on the serving host and port. The same browser policy protects the relay viewer. External conversation images do not load automatically. In authenticated views, each image offers an explicit opt-in that loads it in a script-free, opaque-origin iframe restricted to that image’s origin. The wrapper does not fetch anything on the server and sends no referrer. Loading may still disclose your IP address or that external site’s cookies. Consent is not persisted; public shared views keep remote images blocked. Existing local/embedded images and user-clicked external links still work. Both static and interactive HTML file previews block external subresources.
Privileged localhost routes reject cross-origin browser requests. Origin-less local CLI and
MCP clients still work, but once password auth is configured they must present a valid auth
cookie like everyone else. Behind a reverse proxy a loopback peer address is not a credential.
Use -auth-trust-localhost to restore the unauthenticated local path. MCP clients cannot send
a cookie, so they use the separate loopback-only listener on -mcp-addr (127.0.0.1:8227 by
default), which requires a per-install bearer token because any local user can reach a loopback
port. A proxy pointed at -addr cannot reach it, and ocman refuses to bind it to a
non-loopback address. Browser access through a local reverse proxy requires password
authentication and an OCMAN_PUBLIC_BASE_URL matching the external origin.
Ocman also checks every request against a Host allowlist before routing, which blocks DNS
rebinding. Allowed hosts are loopback names (localhost, *.localhost, 127.0.0.1, ::1),
bare IP literals, and the host of OCMAN_PUBLIC_BASE_URL. Anything else gets
421 Misdirected Request. If you reach ocman through a hostname (a tunnel, a Tailscale
MagicDNS name, a reverse proxy), set OCMAN_PUBLIC_BASE_URL to that external origin.
Security model / trust boundary
An unauthenticated loopback deployment trusts every process on the machine. That includes local agents and other software that can call ocman’s privileged session, worktree, tmux, OpenCode, and MCP actions. Loopback means local reachability, not user identity. Treat the machine and every process on it as part of the trust boundary, or configure password authentication.
Auto-approval is not a trust boundary: its judge evaluates session content and permission metadata that an agent can influence. The judge is deliberately scoped to the supplied request and cannot read files, run commands, or use tools; it also uses a per-session safe-command cache and a hard denylist. These are guardrails, not a replacement for authentication or human review, and the judge denies when it is uncertain.
When worktree permission inheritance is enabled, child sessions can receive the parent’s approved permissions, custom permission rules, or YOLO permission posture. Review a parent’s permissions before starting child sessions, especially when the parent or its content is not fully trusted.
Do not treat a same-host reverse proxy as a credential. Requests forwarded by a
local proxy may appear to come from loopback even when the client is remote or
untrusted. Require password authentication in this setup and set
OCMAN_PUBLIC_BASE_URL (or -public-base-url) to the public origin; proxy
locality must not be used to justify -auth-trust-localhost.
Flags
| Flag | Default | Description |
|---|---|---|
-addr | 127.0.0.1:8228 | Listen address. |
-config | XDG config path, or beside an explicitly isolated state DB | YAML configuration file; also OCMAN_CONFIG. See configuration file
. |
-db | ~/.local/share/opencode/opencode.db | Path to OpenCode’s SQLite DB. Opened read-only. |
-conversations-db | state_conv.db beside state.db | Retained conversation store. Also OCMAN_CONVERSATIONS_DB; deprecated alias -statev2-db. |
-gui | Auto-enabled in an app bundle, otherwise false | Open a native Wails desktop window. Only the desktop build (make build-desktop) includes it; headless builds exit with an error. |
-gui-addr | 127.0.0.1:0 | Backend listen address in desktop mode; the default picks an ephemeral port. |
-log-file | (platform default) | Also write the log to this file (plain text, dir 0700, file 0600). Default ~/Library/Logs/ocman/ocman.log on macOS, otherwise $XDG_STATE_HOME/ocman/ocman.log (~/.local/state/ocman/ocman.log). A file over 10 MB at startup moves to ocman.log.1. - or off logs to stderr only. Check this file when the desktop app fails to start. |
-gui-boot-timeout | 10s | With -gui, how long to wait for the backend to answer before showing an error dialog instead of opening the window. In -gui mode every startup failure shows a native alert (macOS osascript, Linux zenity when installed) naming the log file. |
-mcp-addr | 127.0.0.1:8227 | Loopback listen address for the MCP endpoint. Clients authenticate with the bearer token in mcp-token beside state.db (see MCP authentication
); non-loopback addresses are refused. Empty disables it. |
-platforms | Saved connections, otherwise opencode,claudecode | Use legacy platform composition for this launch with a comma-separated list (opencode, claudecode, codex). Does not rewrite saved connections. Without opencode, the OpenCode binary and database are not needed. See Platform connections
and Codex
. |
-public-base-url | (unset) | Externally reachable base URL, e.g. https://ocman.example.ts.net. Used for the links ocman hands to readers elsewhere (share links, plugin attention notices) and for cookie/origin decisions. Falls back to the listen address, which only works locally. Also OCMAN_PUBLIC_BASE_URL. |
-relay-url | https://relay-ocman.stenic.io | Relay base URL for sharing, webhook enrollment and usage reports; overrides OCMAN_RELAY_URL. |
-otel | (unset) | OTLP/HTTP endpoint; falls back to OTEL_EXPORTER_OTLP_ENDPOINT. |
-auto-approve | false | Default new sessions to ocman’s permission reviewer. |
-auth-password | (unset) | Password to require. Prefer OCMAN_AUTH_PASSWORD or -auth-password-file. |
-auth-password-file | (unset) | Read auth password from file (trailing whitespace trimmed). |
-auth-session-ttl | 720h (30 days) | Auth cookie lifetime. |
-auth-trust-localhost | false | Exempt loopback clients from auth. Refused with a non-loopback -addr / -gui-addr or a public -public-base-url unless -insecure-no-auth is set. Also OCMAN_AUTH_TRUST_LOCALHOST=1. |
-opencode-server-password-file | (unset) | Read the managed OpenCode API password from a file (trailing whitespace trimmed). |
-opencode-server-generate-password | false | Generate an ephemeral managed OpenCode API password at startup. |
-remote-listen | (unset, off) | Bind address for the remote-access gRPC server (multi-remote), e.g. 0.0.0.0:8230. Empty disables it. |
-remote-tls-cert | (unset) | TLS certificate file for the remote-access gRPC server (enables TLS with -remote-tls-key). |
-remote-tls-key | (unset) | TLS key file for the remote-access gRPC server. |
-remote-trusted-overlay | false | Explicitly allow plaintext remote gRPC on a trusted overlay network. |
-insecure-no-auth | false | Allow a non-loopback -addr / -gui-addr or a public -public-base-url with no password configured or with -auth-trust-localhost. Also OCMAN_INSECURE_NO_AUTH=1. |
Environment variables
| Variable | Description |
|---|---|
OCMAN_AUTH_PASSWORD | Auth password. Empty string is treated as unset. |
OCMAN_CONVERSATIONS_DB | Retained conversation database path, unless -conversations-db is supplied. OCMAN_STATEV2_DB is a deprecated fallback alias. |
OCMAN_RELAY_URL | Share relay base URL, unless -relay-url is supplied. |
OCMAN_PUBLIC_BASE_URL | Externally reachable base URL (same as -public-base-url, which takes precedence). Set it whenever something other than your own browser follows ocman’s links — a shared session, or a conversation plugin
posting attention notices into a chat thread. |
OCMAN_AUTH_TRUST_LOCALHOST | Truthy value enables the loopback auth bypass. |
OCMAN_INSECURE_NO_AUTH | Truthy value allows a non-loopback listen address with no password configured. |
OPENCODE_SERVER_PASSWORD | Password for managed OpenCode servers and all ocman-to-OpenCode HTTP/SSE traffic. |
OCMAN_SLACK_PREVIEW_CLIENT_ID, OCMAN_SLACK_PREVIEW_CLIENT_SECRET | Enable Slack message previews. Register a dedicated Slack app (not the conversation plugin’s) with redirect URL <public base>/api/previews/oauth/callback and user token scopes channels:history, channels:read, users:read. Sign in once under Settings → Link previews; private channels and DMs are always shown as denied. |
OCMAN_GITHUB_PREVIEW_CLIENT_ID, OCMAN_GITHUB_PREVIEW_CLIENT_SECRET | Optional sign-in app for GitHub previews; a personal token pasted in Settings, or your gh login, is simpler. Register a GitHub App with callback URL <public base>/api/previews/oauth/callback, expiring user tokens, and read-only Metadata, Pull requests, Issues and Contents permissions. Public links preview without it. |
OCMAN_FORGEJO_PREVIEW_APPS | host=client_id:client_secret[,host=…]: one Forgejo OAuth2 application per exact host (https only), with redirect URI <public base>/api/previews/oauth/callback. Forgejo OAuth tokens have no granular scopes, so a grant can read and change everything the account can on that host; Settings says so before sign-in. A personal token pasted in Settings is simpler. Listed hosts join the tea-login hosts as previewable. |
OCMAN_NOTION_PREVIEW_CLIENT_ID, OCMAN_NOTION_PREVIEW_CLIENT_SECRET | Enable Notion page previews. Create a Notion public connection with redirect URI <public base>/api/previews/oauth/callback and only the Read content capability. Pick the pages to share at sign-in; only those pages preview. An internal integration token pasted in Settings works too. A link rule routed to notion looks identifiers such as ABC-42 up by page title; several matches list the candidates, none leaves the rule’s own link. |
OCMAN_LINEAR_PREVIEW_CLIENT_ID, OCMAN_LINEAR_PREVIEW_CLIENT_SECRET | Enable Linear issue previews. Create a Linear OAuth2 application with callback URL <public base>/api/previews/oauth/callback; ocman requests only the read scope with PKCE, so the secret is optional. A personal API key pasted in Settings works without an app. linear.app/<workspace>/issue/ENG-1 links preview only with a token or sign-in for that workspace, and a link rule routed to linear resolves identifiers such as ENG-1. |
OCMAN_JIRA_PREVIEW_CLIENT_ID, OCMAN_JIRA_PREVIEW_CLIENT_SECRET | Enable Jira Cloud issue previews. Create an Atlassian OAuth 2.0 (3LO) app with callback URL <public base>/api/previews/oauth/callback and the read:jira-work (Jira API) and read:me (User identity API) scopes; ocman also requests offline_access for refresh. Sign in once and pick sites at consent. <site>.atlassian.net/browse/KEY-1 links preview only for a site the grant can reach, always through api.atlassian.com; a link rule routed to jira looks identifiers up on every connected site and lists the candidates when several match. |
OCMAN_GITLAB_PREVIEW_APPS | host=client_id[:client_secret][,…]: one GitLab OAuth application per exact host — gitlab.com and/or allowlisted self-managed hosts (https only) — with redirect URI <public base>/api/previews/oauth/callback and only the read_api scope. Ocman uses authorization code + PKCE, so the secret is optional for a non-confidential app, and refreshes the two-hour access tokens. Merge request, issue and commit links on a listed host preview; public projects on gitlab.com preview without setup, others need a token or sign-in for that host (a personal token pasted in Settings needs no app). Unlisted hosts are never contacted, redirects are not followed, and API calls refuse loopback and link-local addresses (and private ones for gitlab.com), so a self-managed host on localhost is not supported. |
OCMAN_ALLOWED_HOSTS | Vite dev/preview only: comma-separated extra hostnames allowed by the dev server (e.g. foo.tailnet.ts.net,bar.lan). |
Link previews mostly need no variables: paste personal tokens under Settings → Link previews. The *_PREVIEW_* sign-in apps can also be added there; a saved app overrides the environment’s for the same provider and host. See link previews
.
Forge link previews and the machine token
GitHub and Forgejo links (/owner/repo/pull|pulls|issues|commit/… on github.com, the https hosts from your tea logins, and hosts with a saved token or app) render as preview cards. Resolution, in order:
- A token or sign-in saved under Settings → Link previews.
- Otherwise the machine’s forge token (
GITHUB_TOKEN/GH_TOKEN,gh auth token,FORGEJO_TOKEN/GITEA_TOKEN,tealogin), for any request with app access, private repositories included. - A request without app access previews public repositories only.
Authentication
By default ocman binds 127.0.0.1:8228 and serves unauthenticated. Any other listen address
(0.0.0.0:8228, a bare :8228, a LAN IP) requires a password. Ocman refuses to start without
one, because session routes can send messages, run commands, and launch agents. A public
-public-base-url / OCMAN_PUBLIC_BASE_URL requires a password too, even on a loopback
listener: it documents a reverse proxy in front of ocman, and every proxied request then
arrives from 127.0.0.1, so the loopback check is not a credential for off-box clients.
Override either refusal with -insecure-no-auth (or OCMAN_INSECURE_NO_AUTH=1) only on a
network you control.
To require a password, say when exposing ocman over a tunnel, Tailscale, or any non-loopback listener, set one of the following (highest precedence first):
OCMAN_AUTH_PASSWORDenv var (preferred)-auth-password-file /path/to/file-auth-password '<plaintext>'(visible inps; use only for testing)
Once auth is configured it applies to every client, localhost included. For local dev loops,
pass -auth-trust-localhost (or OCMAN_AUTH_TRUST_LOCALHOST=1) to restore the loopback
bypass. That bypass counts as no authentication when ocman is exposed: with a non-loopback
listen address or a public base URL, ocman refuses to start with -auth-trust-localhost even
when a password is configured, because behind a reverse proxy every request arrives from
127.0.0.1. Use it only on a loopback listener without a public base URL, or override with
-insecure-no-auth.
Ocman bcrypt-hashes the password at startup. Auth cookies are HMAC-signed and stateless, using
a key persisted in state.db so logins survive restarts. Login attempts are rate-limited to
5/min per IP, and trusted-localhost clients skip the limiter.
Auth cookies are marked Secure when the request arrives over TLS, or when
OCMAN_PUBLIC_BASE_URL / -public-base-url is an https:// URL. Behind a TLS-terminating
reverse proxy the request itself looks like plain HTTP, so set the public base URL to the
external https:// origin and the cookie never travels in cleartext. Ocman deliberately does
not trust the client-supplied X-Forwarded-Proto header for this decision.
OpenCode: enabling interactive features
Ocman requires OpenCode v2 or later. At startup it runs opencode --version. If that reports
v1, ocman logs an error, starts without the OpenCode platform, and the setup check shows
“OpenCode version” with an upgrade hint. Other enabled platforms keep working. Upgrade
OpenCode and restart ocman to enable it. A missing opencode binary is reported by the
setup check instead, and saved history stays readable. Each machine checks its own
OpenCode, so a remote is refused or accepted independently of the hub. After upgrading
OpenCode, restart ocman (it logs a warning when it notices the change).
Sessions launched from ocman (command palette, Worktrees view, PR/Issue sidebar) are interactive out of the box. Ocman connects only to the OpenCode server it manages, or to OpenCode’s registered background service, using its persisted runtime inventory and API identity probes. It does not discover or adopt instances you start yourself. Their saved sessions remain readable from the database.
Managed OpenCode server
By default, OpenCode projects on the same machine share a server. A separate platform connection can have its own native server and database.
- Shared server for the default setup. When OpenCode’s own background service is running (the
opencode serve --servicethatopencodestarts, registered in~/.local/state/opencode/service.json), ocman uses it instead of starting a second server on the same database. Ocman never stops or restarts that service:/restart-opencoderefuses, and a project stop only stops routing to it. While the service is busy, for example migrating the database after an upgrade, ocman waits for it. Otherwise ocman startsopencode serveon a loopback port it picks and keeps it running, relaunching it within 30 seconds if it stops. It runs in a tmux session with its own working directory under~/.local/share/ocman/opencode-v2(one per database, so a different-dbnever reuses a server writing another file). A server that is still starting is never killed and replaced. Ocman keeps a healthy server it started even if the service appears later. To use ocman’s server from the TUI, runopencode --server http://127.0.0.1:<port>. - Only on the default database. Ocman uses the background service only when it reads
OpenCode’s default database. With
-dborOPENCODE_DBpointing elsewhere it always runs its own server. - Always authenticated. OpenCode requires a password. When none is configured (see below),
ocman uses the background service’s password from
~/.config/opencode/service.jsonon the default database. Otherwise it generates one, stores it encrypted instate.db, and reuses it across restarts. This keeps the server running across an ocman restart. - Native follow-up queue. Ctrl/Cmd+Enter hands the message to OpenCode’s own session inbox, which delivers it when the turn ends. The composer lists these messages with ocman’s own queued messages. You can delete them but not reorder them. If ocman’s own queue already holds messages for the session, a new one joins that queue instead, so the order stays the same.
- History. OpenCode stores conversations in
session_v2andsession_message. Ocman reads them through read-only views, so the session list, transcripts, search and analytics work on the same rows the server writes. - MCP. Ocman writes its MCP entry in OpenCode’s
mcp.servers.ocmanlayout, with"codemode": false, so the agent calls ocman’s tools directly instead of through OpenCode’s Code Modeexecutetool. OpenCode still reads oldermcp.ocmanentries but dropscodemodefrom them. At startup ocman moves an existing ocman entry to the new layout, keeping its URL and enabled state, after backing up the config. It never adds an entry you haven’t installed, and it leaves a JSONC config alone.
Use /reload-opencode in an existing conversation to refresh the owning machine’s
OpenCode skills and configuration without restarting its server. Running turns
continue with fresh services at the next step boundary. Pending permission and
question prompts are cancelled during the reload. The command refreshes the
composer’s agent, model, command and skill catalogs after completion. It does not
launch a server if none is managed.
Keep /restart-opencode for an unhealthy server, a binary upgrade, changed process
environment or launch settings, or unwatched plugin dependencies. It restarts the
machine-wide server, affecting every project on that machine.
Ocman resolves one absolute database path and exports it as OPENCODE_DB for the server,
so both read and write the same file. An explicit -db wins (including the default path);
otherwise OPENCODE_DB wins, then the default. Relative paths are resolved from ocman’s
working directory before launching the server.
OpenCode server authentication
To choose the managed server’s password yourself, configure one source in this precedence order:
OPENCODE_SERVER_PASSWORDenvironment variable-opencode-server-password-file /path/to/file-opencode-server-generate-password
Ocman injects the selected password as OPENCODE_SERVER_PASSWORD when it launches OpenCode and
uses OpenCode’s default opencode HTTP Basic Auth username for every API and SSE request. A
configured password stays in backend memory and the managed process environment. Ocman does not
store it in state.db, return it to the browser, or include it in runtime diagnostics.
To rotate a supplied password, update the environment variable or file and restart ocman, then
run /restart-opencode. You can also let the next managed launch replace a server whose
credential no longer matches. -opencode-server-generate-password creates a new value on every
ocman restart, so a recovered managed server is stopped and relaunched on first use. Without any
of these, ocman uses the stored password described above. Authentication configuration does not
enable adoption of unmanaged instances.
Claude Code
Use Settings → Platform connections to add or enable a connection for the
selected machine, including in the desktop app. Remote machines use their own
connections. An explicit -platforms flag overrides the saved connections for
that launch without changing them. OpenCode and Claude Code are enabled when no
selection has been saved; Codex is opt-in.
-platforms claudecode enables only Claude Code sessions. Setup, permissions, the opt-in
terminal-session hooks, subscription usage and limits are described in
Claude Code
. Codex is opt-in: add codex to the list or
add a Codex connection in Settings → Platform connections; see Codex
.
Remote machines (optional)
Attach other ocman instances over the network and manage every machine’s sessions from one hub. On a machine you want to manage remotely, start its gRPC server:
ocman -remote-listen 0.0.0.0:8230 \
-remote-tls-cert cert.pem -remote-tls-key key.pem # secure default
ocman -remote-listen 0.0.0.0:8230 -remote-trusted-overlay # Tailscale/WireGuard onlyWarning:
-remote-trusted-overlaysends the bearer token and all session traffic without TLS. Use it only when Tailscale, WireGuard, or an equivalent encrypted overlay protects the complete route. A private LAN alone is not sufficient.
Then attach it from the hub’s Settings → Remotes page using the remote’s address and access token. This is off by default, so a fresh install with no remotes is unchanged. See Remote machines for the full step-by-step guide, security notes, and troubleshooting.
OpenTelemetry (optional)
Product usage collection
is separate from these
diagnostics. It is enabled by default when a relay is configured. Opt out under
Settings → Privacy & usage, or set settings.usage.collection_enabled: false
in the configuration file. Relay controls live under Settings → Relay.
Pass --otel=<endpoint> (or set OTEL_EXPORTER_OTLP_ENDPOINT) to ship traces, metrics, and logs to
an OTLP collector. Empty or unset disables telemetry export.
ocman exports OTLP/HTTP only; use an http:// or https:// endpoint, normally on
port 4318. OTLP/gRPC is not supported. A grpc(s):// or bare host:port endpoint,
or OTEL_EXPORTER_OTLP_PROTOCOL=grpc, logs a warning and exports OTLP/HTTP instead,
rewriting port 4317 to 4318.
All other configuration uses standard OTEL_* env vars (OTEL_SERVICE_NAME,
OTEL_RESOURCE_ATTRIBUTES, OTEL_TRACES_SAMPLER, OTEL_EXPORTER_OTLP_HEADERS, etc.).
For local dev, make otel-up starts a bundled Grafana LGTM stack with Grafana on :3000
and OTLP/HTTP on :4318. The make dev* targets export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
and OTEL_SERVICE_NAME=ocman-dev for you. See observability/ for dashboard provisioning.
The provisioned dashboard selects an available ocman* service on load. Select
ocman-dev for development runs or ocman for the default service name.
When telemetry export is enabled, LLM token, cost, and request metrics are collected
every 30 seconds even when no ocman page is visible. The scanner stays off when
telemetry export is disabled. Collection counts new assistant messages after ocman starts;
existing message history is not imported into these counters.
Permission judge evaluations emit these metrics after the safe-command cache gates:
| Metric | Meaning |
|---|---|
ocman.judge.calls | Evaluation count, including failed evaluations and unavailable backends. |
ocman.judge.duration | Evaluation duration in seconds. |
ocman.judge.probability | SystemOne/TypeSafe match probability histogram for each rule. |
ocman.judge.rule_threshold | Effective match threshold for each validated SystemOne/TypeSafe rule. |
All have bounded backend and outcome labels. Outcomes are approved,
not_approved, error, and needs_user. Probability and threshold histograms
also carry the rule ID and its tier, never the rule text. These replace the old
verdict choice/answer labels and ocman.judge.safe_threshold metric.
Scores and thresholds range from 0 to 1, not percentages. Invalid responses emit
an error outcome without scores. Cache hits do not count as judge calls.
Commands, prompts, paths, session IDs and credentials are never metric labels.
These aggregates help inspect confidence distributions, but do not establish
accuracy without separately reviewing decisions against known safe/unsafe examples.
Logrus logs are exported in batches using the same endpoint and transport, while console logging stays enabled. Export respects the configured log level and includes structured fields and the service resource. Logs with an active span carry its trace and span IDs; logs outside spans are exported too. Shutdown flushes pending logs. The existing log-to-span-event hook remains enabled.
With the bundled stack, open Grafana Explore, select Loki, and query
{service_name="ocman-dev"} for dev runs or {service_name="ocman"} for the default
service name. Logs begin arriving after restarting ocman with this build and
telemetry enabled; earlier console logs are not imported.
The dashboard’s Database section shows query rate and p95 latency by SQL fingerprint.
SQLite handles for OpenCode, ocman state, retained conversation history and
maintenance are instrumented. Direct and prepared executions are counted, including queries inside
transactions. Preparation, row iteration, and commit/rollback are excluded from query rates.
The rate uses the count of db_client_operation_duration_seconds; no separate counter is needed.
Latency measures the driver’s execution call, not the subsequent row scan.
db_query_fingerprint identifies a normalized query shape; db_query_summary gives
its first 160 characters. Literal values and comments are removed, parameter names
are replaced, and variable-length IN lists are collapsed before hashing. Bound
arguments are never included. Quoted identifiers remain distinct. Both labels are
also trace attributes, so search Tempo with
{ resource.service.name="ocman" && span.db.query.fingerprint="<fingerprint>" }
to locate the query’s SQL and calling request. Use your configured service name.
New series appear after running a build containing this instrumentation with telemetry enabled.