onibi

module
v0.0.0-...-4654e9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: Apache-2.0

README

Onibi

Onibi

ci go platform transport license

Coding agents often run locally, but approvals and quick fixes arrive when you are away from the keyboard.

Onibi runs local shells and coding agents in managed tmux-backed sessions, then gives your phone a live terminal and approval cockpit over HTTPS/WebSocket.

Status: v3 web-cockpit pivot in progress. The local shell cockpit, managed tmux session path, iPhone pairing, live terminal, resize/reconnect smoke, handover controls, Claude Code approval overlay, device management command surface, and Tailscale transport have local or real-phone coverage. Remaining work is tracked in GitHub issues.

Launch demos and cockpit visuals live in SHOWCASE.md.

Quick Start

brew install gongahkia/onibi/onibi
onibi install-hooks --agent claude
onibi up

onibi up prompts first for a category (Web URL, Chat, or Notify-only) and then for a supported provider. Use onibi up --transport=<mode> to skip the picker. Supported modes are lan, tailscale, tailscale-private, wireguard, zerotier, cloudflare-quick, cloudflare-named, ngrok, telegram, matrix, slack, discord, zulip, irc, signal, pushover, ntfy, gotify, apns, sms, email, and auto. Run onibi status, onibi update-check, and onibi doctor --fix when validating an install or upgrade. Source-build setup lives in CONTRIBUTING.md.

On iPhone:

  1. Install and fully trust the printed onibi-local-ca.mobileconfig once.
  2. Scan the QR printed by onibi up.
  3. Use the terminal cockpit from Safari. Use MAC to open the same session in a visible macOS terminal and PHONE to return it to Safari.

If a managed Wi-Fi blocks device-to-device traffic, connect the Mac to the iPhone hotspot, rerun ./bin/onibi up, and scan the new QR.

What Makes This Different

  • Host-local sessions: Onibi creates and owns tmux-backed PTYs instead of only monitoring another app's session.
  • Same session everywhere: drive one live session from mobile Safari, a visible Mac terminal, chat transports, or local MCP clients.
  • Approval enforcement: supported hooks can block risky tool calls before execution, including Claude Code PreToolUse deny flows.
  • Terminal fidelity: live xterm.js over WebSocket, xterm-ghostty terminfo, a Ghostty-inspired theme, JetBrains Mono, Sixel/IIP rendering, Kitty graphics transcoding to IIP, and a terminal fidelity smoke matrix.

Branding note: Onibi is not affiliated with the Ghostty terminal emulator project; see Branding.

What Works Now

  • Managed tmux-backed session created by onibi up.
  • Live xterm.js terminal over /ws/pty.
  • Multi-session phone dashboard at /#/sessions with attach and guarded kill actions.
  • Pair-by-QR over local HTTPS.
  • iPhone trusted local CA profile.
  • Top controls: MAC, PHONE, INT, KILL.
  • Bottom soft-key bar: Esc, Tab, Ctrl, Alt, arrows, ^C, ^D, ^Z, Paste, theme toggle.
  • Claude Code hook approvals rendered as web overlay cards.
  • Deny flow blocks Claude Write calls before file creation.
  • Local shell fallback for arbitrary commands and vim.
  • onibi show / onibi hide for tmux-backed session visibility.
  • Experimental chat text control: after experimental.providers=true, Telegram, Matrix, Slack, Discord, Zulip, IRC, and Signal can route terminal text; approvals support provider-native actions where available.
  • Experimental notify-only approvals: Pushover, ntfy, Gotify, APNs, SMS, and email publish approval alerts without terminal text input after the same explicit opt-in.
  • docs/comparison.md covers tradeoffs against remote-agent and terminal-sharing tools.

Roadmap

The v0.3 to v1.0 release arc is tracked in docs/roadmap.md, with each release tied to a GitHub milestone.

Main Commands

./bin/onibi
./bin/onibi quickstart
./bin/onibi status
./bin/onibi up
./bin/onibi show
./bin/onibi hide --headless
./bin/onibi pair
./bin/onibi share <session-id>
./bin/onibi telegram setup
./bin/onibi cloudflare setup
./bin/onibi devices
./bin/onibi unpair <device-id>
./bin/onibi install-hooks --interactive
./bin/onibi hooks --show --all
./bin/onibi adapters
./bin/onibi doctor
./bin/onibi update-check
./bin/onibi uninstall --dry-run
./bin/onibi logo

CLI aliases include start for up, qr for pair, phones for devices, integrations for adapters, integrate for install-hooks, check for doctor, and ps for sessions.

Useful CLI flags:

  • Global: --quiet, --debug, --no-logo, --logo-width <cols>, --color auto|always|never.
  • up: --first-run, --shell <bin>, --cwd <dir>, --no-login-shell, --visible, --no-qr, --log-file <path>.
  • telegram: setup [--no-check], status [--check], disable; up --transport=telegram starts chat-native text control.
  • pair: --host <host>, --port <port>, --copy, --no-qr, --fallbacks=false, --json.
  • share: --ttl <duration>, --max-viewers <n>, --copy, --no-qr, --fallbacks=false, --json.
  • install-hooks: no args auto-detects agent config dirs and shell RC files; --all installs detected hooks without prompting; --dry-run prints the plan.
  • status: --compact, --watch, --interval <duration>, --timeout <duration>, --no-doctor, --no-hooks, --no-update, --refresh-update, --json, --strict.
  • doctor: --fix, --release, --after-upgrade, --explain, --offline, --json.
  • uninstall: --service, --hooks, --agent <name>, --shell <name>, --state, --yes, --dry-run, --json.

Current Test Flow

After ./bin/onibi up and phone pairing:

  1. Run vim /tmp/onibi-smoke.txt from the phone.
  2. Edit, press ESC, then :wq.
  3. Rotate the phone and confirm the terminal remains usable.
  4. Confirm no visible ONIBI-RESIZE:* marker appears.
  5. Tap MAC; confirm the same cwd/history/running process opens in a macOS terminal.
  6. Tap PHONE; confirm the same session returns to Safari.
  7. For hotspot mode, background Safari for 10 seconds and return; use airplane mode only on shared Wi-Fi.
  8. Run claude.
  9. Ask Claude to create /tmp/onibi-approval-deny.txt.
  10. Tap Deny on the Onibi approval card.
  11. Verify the file does not exist.
  12. Stop onibi up and confirm no onibi-* tmux sessions remain.

Architecture

  • internal/tmux creates managed tmux-backed sessions for handover.
  • internal/pty bridges web terminal I/O to local PTYs and tmux attach clients.
  • internal/web serves HTTPS, static frontend assets, /ws/pty, /ws/events, /control, /approval, and /pair.
  • internal/telegram, internal/matrix, internal/slack, internal/discord, internal/zulip, internal/irc, and internal/signal provide chat-native text input/output and approval callbacks.
  • internal/pushover, internal/ntfy, internal/gotify, internal/apns, internal/sms, and internal/email provide notify-only approval delivery.
  • internal/intake receives hook events from onibi-notify over a same-UID Unix socket.
  • internal/approval owns the approval queue and decision state machine.
  • frontend/ contains the xterm.js cockpit.
  • docs/comparison.md compares Onibi's session-hosting architecture with Herdr, Codex Remote, CCRC, and OpenCode Mobile.

Docs

Security

  • HTTPS is required for the phone cockpit.
  • Pair tokens are single-use and short-lived.
  • Owner browser identity is stored in an HttpOnly Secure cookie.
  • WebSocket upgrades require the owner cookie plus matching token.
  • Approval hooks fail open if the local daemon is unavailable.
  • Linux without Secret Service stores the SQLite master key in an unencrypted 0600 fallback file; see docs/security.md#at-rest-state.
  • The local OS user account remains trusted.

Branding

Onibi is not affiliated with the Ghostty terminal emulator project. Onibi uses the xterm-ghostty terminfo and a Ghostty-inspired color theme; the name and any perceived resemblance are coincidental / homage. Usage boundaries live in docs/branding.md.

License

Apache-2.0.

Directories

Path Synopsis
clients
onibi-notify command
Command onibi-notify is the client invoked by agent and shell hooks.
Command onibi-notify is the client invoked by agent and shell hooks.
cmd
gen-readme command
onibi command
Command onibi is the entry point.
Command onibi is the entry point.
internal
adapters
Package adapters discovers and installs coding-agent integrations.
Package adapters discovers and installs coding-agent integrations.
adapters/amp
Package amp implements the Amp plugin adapter.
Package amp implements the Amp plugin adapter.
adapters/claude
Package claude implements the Claude Code adapter: Stop hook (turn complete), PreToolUse hook (blocking approval with updatedInput), plus settings.json edit/install with guarded block.
Package claude implements the Claude Code adapter: Stop hook (turn complete), PreToolUse hook (blocking approval with updatedInput), plus settings.json edit/install with guarded block.
adapters/codex
Package codex implements the Codex CLI adapter.
Package codex implements the Codex CLI adapter.
adapters/copilot
Package copilot implements the GitHub Copilot CLI hook adapter.
Package copilot implements the GitHub Copilot CLI hook adapter.
adapters/gemini
Package gemini implements the Gemini CLI hook adapter.
Package gemini implements the Gemini CLI hook adapter.
adapters/goose
Package goose implements the Goose adapter.
Package goose implements the Goose adapter.
adapters/opencode
Package opencode implements the OpenCode adapter via the TS plugin API: tool.execute.before and lifecycle events.
Package opencode implements the OpenCode adapter via the TS plugin API: tool.execute.before and lifecycle events.
adapters/pi
Package pi implements the Pi Coding Agent extension adapter.
Package pi implements the Pi Coding Agent extension adapter.
adapters/shell
Package shell installs opt-in shell hooks for command-done notifications: zsh precmd/preexec, bash PROMPT_COMMAND, fish fish_postexec.
Package shell installs opt-in shell hooks for command-done notifications: zsh precmd/preexec, bash PROMPT_COMMAND, fish fish_postexec.
approval
Package approval implements the blocking-approval protocol: request, decide, edit, cancel, expire.
Package approval implements the blocking-approval protocol: request, decide, edit, cancel, expire.
capability
Package capability defines the supported v1 product surface.
Package capability defines the supported v1 product surface.
cli
Package cli wires cobra subcommands.
Package cli wires cobra subcommands.
config
Package config resolves platform paths and validates config.yaml.
Package config resolves platform paths and validates config.yaml.
daemon
Package daemon owns the long-running lifecycle: signal handling, session registry, event bus, debounce.
Package daemon owns the long-running lifecycle: signal handling, session registry, event bus, debounce.
e2e
fleet
Package fleet defines the versioned personal-fleet boundary shared by a hub, enrolled hosts, and the phone cockpit.
Package fleet defines the versioned personal-fleet boundary shared by a hub, enrolled hosts, and the phone cockpit.
intake
Package intake serves the local Unix-domain socket that adapter hooks and the onibi-notify client write JSON events to.
Package intake serves the local Unix-domain socket that adapter hooks and the onibi-notify client write JSON events to.
irc
logging
Package logging configures log/slog with redaction middleware for loaded secret strings.
Package logging configures log/slog with redaction middleware for loaded secret strings.
pty
Package pty hosts coding agents under pseudo-terminals via creack/pty.
Package pty hosts coding agents under pseudo-terminals via creack/pty.
render
Package render emits PTY-buffer snapshots as text or PNG.
Package render emits PTY-buffer snapshots as text or PNG.
secrets
Package secrets stores Onibi credentials in the OS keystore via 99designs/keyring (macOS Keychain, Linux Secret Service, Windows Credential Manager).
Package secrets stores Onibi credentials in the OS keystore via 99designs/keyring (macOS Keychain, Linux Secret Service, Windows Credential Manager).
service
Package service generates and installs the OS auto-start unit: launchd LaunchAgent on macOS (~/Library/LaunchAgents/sh.onibi.daemon.plist), or systemd user unit on Linux (~/.config/systemd/user/onibi.service).
Package service generates and installs the OS auto-start unit: launchd LaunchAgent on macOS (~/Library/LaunchAgents/sh.onibi.daemon.plist), or systemd user unit on Linux (~/.config/systemd/user/onibi.service).
setup
Package setup manages single-use web pairing tokens and QR rendering.
Package setup manages single-use web pairing tokens and QR rendering.
sms
store
Package store wraps modernc.org/sqlite (pure-Go, no cgo).
Package store wraps modernc.org/sqlite (pure-Go, no cgo).
tmux
Package tmux is the optional --attach-tmux backend.
Package tmux is the optional --attach-tmux backend.
web
Package web serves the local HTTPS cockpit and WebSocket endpoints.
Package web serves the local HTTPS cockpit and WebSocket endpoints.
scripts
ptyrun command
websmoke command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL