Usage
Options
All options from the default command are supported:Choose which agent to use:
claude, codex, or ampCustom display name for the dashboard
API key for authentication
Resume an existing session
Custom relay WebSocket URLDefaults:
- Production:
wss://relay.omnara.com/agent - Local dev:
ws://localhost:8080/agent
Omnara API server URL
Agent Flag Compatibility: All agent-specific CLI flags are passed through to the underlying agent:
- Claude Code:
--continue,--permission-mode,--allowed-tools,--dangerously-skip-permissions, etc. - Codex: Any Codex-specific flags
- Amp: Any Amp-specific flags
Examples
Examples of agent flags:
- Claude Code:
--continue,--permission-mode,--allowed-tools,--disallowed-tools,--dangerously-skip-permissions - Codex: Any Codex-specific configuration flags
- Amp: Any Amp-specific configuration flags
What is WebSocket Relay?
The relay system streams your terminal I/O in real-time to the Omnara dashboard, enabling:- Live Terminal Viewing: See exactly what’s happening in the terminal from web/mobile
- Remote Input: Type messages from the dashboard that appear in the terminal
- Session Sharing: Share terminal sessions with teammates
- Multi-device Access: Monitor from phone, control from laptop
How It Works
1
Agent Registration
CLI registers the agent instance with Omnara API
2
WebSocket Connection
Connects to relay server at configured URL with API key authentication
3
PTY Creation
Creates a pseudo-terminal (PTY) and launches the agent
4
Bidirectional Streaming
Streams terminal I/O over WebSocket:
- Terminal → Dashboard: Real-time output display
- Dashboard → Terminal: User input from web/mobile
5
Session Persistence
Terminal history buffered and replayed when viewing from new devices
Relay vs Local-Only
- With Relay (terminal)
- Without Relay (--no-relay)
- ✓ Real-time terminal streaming
- ✓ Dashboard shows live terminal output
- ✓ Input from web/mobile
- ✓ Session sharing
- ✓ Multi-device monitoring
- ✓ Message API active
Terminal Frame Protocol
The relay uses a binary frame protocol for efficient streaming:| Frame Type | ID | Purpose |
|---|---|---|
| OUTPUT | 0 | Terminal output to dashboard |
| INPUT | 1 | User input from dashboard |
| RESIZE | 2 | Window resize events |
| METADATA | 3 | Agent metadata (type, name) |
Special Features
History Replay
When you open the dashboard:- Buffered terminal history is replayed
- Special handling for Codex (strips clear screen sequences)
- Seamless catch-up to current state
Resize Handling
Terminal resizes are handled intelligently:- Debouncing: Waits 500ms before applying resize
- Gradual Resizing: Step-by-step changes for large differences
- Cursor Tracking: Detects and adjusts cursor position reports
Reconnection
If the WebSocket connection drops:- Automatic reconnection every 5 seconds
- Session persists across reconnections
- No data loss during disconnection
Relay Server Architecture
The relay server (relay.omnara.com):
- Runs independently from API server
- Handles WebSocket connections
- Buffers terminal history
- Routes messages between terminal and dashboard clients
- Supports multiple simultaneous viewers
Security
Authentication
WebSocket connections authenticated via:X-API-KeyheaderAuthorization: Bearer {token}header- WebSocket subprotocol:
omnara-key.{key}oromnara-supabase.{token}
Encryption
- Production: WSS (WebSocket Secure) over TLS
- All terminal data encrypted in transit
- No terminal data stored long-term (only buffered in memory)
Access Control
- Only authenticated users can view their own sessions
- Session ownership validated on join
- No cross-user session access
Use Cases
Remote Monitoring
Monitor agent progress from your phone while away from desk
Pair Programming
Share terminal session with teammate for collaboration
Debugging
Review terminal history to debug agent behavior
Multi-device Workflow
Start on laptop, monitor from phone, resume on desktop
Troubleshooting
Relay connection fails
Relay connection fails
Check:
- Network/firewall allows WebSocket connections
- API key is valid:
omnara --auth - Relay URL is correct
Terminal not appearing in dashboard
Terminal not appearing in dashboard
Causes:
- Using
--no-relayflag - WebSocket connection dropped
- Dashboard not refreshed
- Ensure not using
--no-relay - Check logs:
~/.omnara/<agent>_wrapper/<session-id>.log - Refresh dashboard
Input from dashboard not working
Input from dashboard not working
Causes:
- One-way connection only
- Agent has exited or crashed
- Relay server issues
- Check agent is still running in terminal
- Try restarting the session
- Check relay server status