Skip to content

opencolin/codeview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codeview

View opencode sessions on Even Realities G2 smart glasses.

Status: working prototype. Streams session status, assistant messages, tool calls, and permission prompts from opencode to the glasses display in real time. Approval write-back is stubbed (UI works, the call back into opencode isn't wired yet).

What it is

A two-process system for following along with an opencode session on the G2:

  • Glasses app (src/) — Even Hub plugin (Vite + TS) that renders the latest session event into a single text container.
  • Bridge (bridge/) — Node process that subscribes to opencode's SSE event stream and rebroadcasts a compact subset over WebSocket.
opencode (:4096)  ──SSE──►  bridge (:7878)  ──WS──►  glasses webview

The point is short-form, glanceable "vibe coding" — not typing on the glasses, but staying in the loop while away from the keyboard.

Stack

Develop

# one-time
npm install
npm run bridge:install

# in three terminals
opencode               # 1. the agent (or `opencode serve` for headless)
npm run bridge         # 2. SSE → WS bridge on :7878
npm run dev            # 3. glasses dev server on :5173
npm run sim            # 4. (optional) simulator pointing at the dev server

The simulator window will show the latest event from the bridge. As you interact with opencode, you should see status changes, assistant messages, and tool calls appear on the simulated glasses.

Real hardware

Generate a QR that includes the bridge URL so the phone webview can reach it on your LAN:

npx evenhub qr --url "http://<lan-ip>:5173?bridge=ws://<lan-ip>:7878"

Scan with the Even Realities App. The glasses app reads ?bridge= to find the WebSocket; defaults to ws://<page-host>:7878 if not provided.

Bridge env vars

Var Default Purpose
OPENCODE_URL http://127.0.0.1:4096 opencode HTTP server
BRIDGE_PORT 7878 WS port
BRIDGE_HOST 0.0.0.0 bind address (LAN-reachable so phones can connect)
DEBUG unset log unmapped opencode event types

Event mapping

opencode event glasses display
session.idle idle
session.error error: …
session.created new session: …
message.part.updated (text) last ~400 chars of assistant text
tool.execute.before ▶ <tool> + truncated input
tool.execute.after ✓ <tool>
permission.asked ? <tool>\n<summary>\nclick=approve dbl=deny
file.watcher.updated, lsp.*, installation.*, shell.env, server.connected dropped (too noisy)

Set DEBUG=1 on the bridge to log unknown event types so the mapping can be extended.

Package for distribution

npm run build
npm run pack
# -> codeview.ehpk

Upload the .ehpk to the Even Hub developer portal.

Roadmap

  • opencode SSE bridge
  • glasses app renders session events
  • permission prompt UI
  • approval write-back — call opencode back to actually approve/deny
  • paginate long assistant messages with swipe up/down
  • session history scrollback
  • Tailscale-friendly remote mode
  • generalize bridge to also support Claude Code (HTTP hooks)

Prior art

License

MIT

About

View opencode sessions on Even Realities G2 smart glasses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors