Harnesses

Agent-native apps run inside a harness — a host environment that provides the AI agent and displays the app UI side by side.

CLI Harness (Local)

  • Open source, ships with @agent-native/harness-cli
  • Runs locally — xterm.js terminal on the left, your app iframe on the right
  • Supports multiple AI coding CLIs — switch between them from the settings panel
  • Auto-installs missing CLIs on first use
  • Per-CLI launch flags and settings, persisted to localStorage
  • Auto-detects when the agent finishes generating and notifies the app
  • Best for: solo development, local testing, open-source projects

Quick start:

# In your agent-native monorepo
pnpm dev:harness

Supported CLIs

CLICommandKey Flags
Claude Codeclaude--dangerously-skip-permissions, --resume, --verbose
Codexcodex--full-auto, --quiet
Gemini CLIgemini--sandbox
OpenCodeopencode

Switch between CLIs at any time from the settings panel. The harness restarts the terminal with the selected CLI and loads its saved launch options.

Cloud Harness

  • Deploy to any cloud infrastructure
  • Real-time collaboration — multiple users can watch/interact simultaneously
  • Visual editing capabilities alongside the AI agent
  • Parallel agent execution for faster iteration
  • Best for: teams, production deployments, visual editing, real-time collaboration

Feature Comparison

FeatureCLI HarnessCloud Harness
Local developmentYesYes
Cloud/remoteNoYes
Multi-CLI supportYes (4 CLIs)Yes
Real-time collaborationNoYes
Visual editingNoYes
Parallel agentsNoYes
Agent chat bridgeYesYes
File watcher (SSE)YesYes
Script systemYesYes
Open sourceYesNo

How It Works

Both harnesses support the same core agent-native protocol:

  1. postMessage bridge — app sends builder.submitChat messages up to the harness
  2. Chat running events — harness sends builder.fusion.chatRunning events down to the app
  3. File watching — SSE endpoint keeps UI in sync when the agent modifies files
  4. Script systempnpm script <name> dispatches to callable scripts

Your app code is identical regardless of which harness or CLI you use.