Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eveng2-terminal-textinput

Typed text input for Even Terminal — the Terminal Mode of the Even Realities G2 smart glasses.

The official Terminal Mode drives your coding agents (Claude Code, Codex…) by voice, with a tap on the glasses' temple. This project adds the missing piece: typing your prompts from a plain web page on your phone, while keeping the glasses HUD — both see exactly the same sessions.

  • 📋 All your Claude Code sessions, with live status (busy / idle), including sessions started elsewhere on the machine
  • 💬 Live transcript: streamed text, expandable tool calls (input/output), cost and duration per turn
  • ⌨️ Text composer to send a prompt — resume an existing session or create a new one in any project directory
  • 📎 Screenshot input: attach images from the phone; they're saved locally and referenced by path in the prompt, so Claude Code reads them with its Read tool (even-terminal's API stays text-only)
  • Permission and question prompts answered with buttons, plus an interrupt button
  • 🔄 Restart button for when everything is stuck: the companion kills the wedged even-terminal process (and its claude subprocesses) and respawns it detached with the same command line — sessions live on disk, so the open one resumes with the next message
  • 🗄 Archive conversations to clear them off the main screen; archived ones move to a read-only Archives view where they can only be unarchived
  • 🌐 Unified view: one list aggregating the sessions of every running even-terminal instance, with a per-project pill on each row and a global bar of pills showing what's running where at a glance (also acts as a filter); the header selector still lets you focus a single project
  • 🪶 Zero dependencies, zero patching: one Node server file + one HTML page; the official app is left untouched

How it works

On startup, even-terminal writes a pidfile to ~/.even-terminal/instances/ containing its HTTP port and bearer token. server.mjs discovers live instances from those pidfiles, serves the mobile page, and proxies /api/* to the selected instance while injecting the Authorization header — the token never leaves the machine.

phone (Safari) ──► server.mjs :8790 ──► even-terminal :4444 ──► Claude Code
G2 glasses ◄── Even Realities app ◄──────────┘

The page relies only on even-terminal's existing API:

Endpoint Purpose
GET /api/sessions session list (everything under ~/.claude/projects)
GET /api/events (SSE) live transcript: text_delta, tool_start/end, permission_request
POST /api/prompt send text — resumes a session or creates one
POST /api/permission-response / question-response / interrupt drive the current turn

Since everything flows through even-terminal, the glasses display the same thing: type on the phone, follow along and approve on the glasses (or the other way around).

Requirements

Install & run

git clone https://github.com/soualid/eveng2-terminal-textinput.git
cd eveng2-terminal-textinput
npm start

The companion listens on port 8790 by default. Open one of the printed URLs on your phone — http://<your-machine-ip>:8790/ (prefer the Tailscale IP). Tip: Safari's "Share → Add to Home Screen" gives you a proper full-screen app.

Configuration

Everything is driven by environment variables; none are required:

Variable Default Purpose
PORT 8790 companion listen port
BIND_HOST 0.0.0.0 listen interface — set your Tailscale IP (100.x) to restrict access to your tailnet
EVEN_TERMINAL_PORT (most recent) default even-terminal instance when several are running (the UI selector still takes precedence)

Optional: patch even-terminal (prompt auto-deny/skip + stale busy status + model picker + timestamps)

Four even-terminal behaviors are changed by a bundled patch:

  • Prompt auto-deny/auto-skip — even-terminal auto-denies any permission prompt left unanswered for 60 seconds and auto-skips AskUserQuestion prompts after 120 seconds (hardcoded, not configurable). Patched, both wait indefinitely until you answer them. Aborting a run (stop button) still resolves pending prompts as denied/skipped, so nothing leaks.
  • Sessions stuck on "busy" — even-terminal decides busy/idle from the last line of the session's .jsonl file, but newer Claude Code versions append timestamp-less metadata trailers (ai-title, mode, pr-link, …) after the turn ends, so finished sessions report "busy" forever. Patched, the scan skips those trailers back to the real turn-end marker.
  • Model selection — even-terminal hardcodes the Claude model (claude-opus-4-6). Patched, POST /api/prompt accepts an optional model field applied to the session's next run. The page's session header shows a 🧠 model selector built on this; without the patch the field is ignored and the default model is used.
  • Message timestamps — SSE events carry no clock, so after a replay the page can't tell when anything actually happened. Patched, every buffered event is stamped with ts (epoch ms) and history entries expose the session file's ISO timestamp. The page shows the time on every transcript line (bubbles, tools, info and result lines; full date in the hover tooltip), so you can tell when the last LLM roundtrip took place. Without the patch nothing is shown.
npm run patch:even-terminal

This applies patches/ to the global @evenrealities/even-terminal install via patch-package, then restart your even-terminal instances. Re-run it after every even-terminal update; if the version changed, regenerate the patch first (the patch file is pinned to the version in its name).

Known limitations

  • Typing into a session that is still open in an interactive terminal forks it (two writers on the same history). Keep those read-only; write to finished sessions or ones created from this page.
  • SSE replay only covers sessions alive inside the even-terminal process; for the others, the page loads the latest exchanges from disk.
  • The page has no authentication of its own: don't expose it beyond your tailnet or a trusted LAN (BIND_HOST).
  • claude provider only for now (even-terminal's API also speaks Codex).

License

MIT — personal project, not affiliated with Even Realities or Anthropic.

About

Typed text input for Even Terminal (Even Realities G2 smart glasses) — local web companion, zero dependencies

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages