* feat(frontend): add live browser panel * chore: format with prettier [skip ci] * feat: preserve and auto-open browser previews * fix: retry browser preview after session updates * fix: wait for browser view before preview navigation * fix: reopen preview after session switches * fix: preserve browser views across session switches * chore: format with prettier [skip ci] * feat: add `ao preview` command to drive the session browser panel Replaces the browser panel's auto-detect with an explicit, session-scoped command. `ao preview [url]` runs inside a session (derives the target from AO_SESSION_ID; rejects when unset or when the session is unknown): - with a url, opens it verbatim (file://, http, https; no sanitization for now) - with no url, autodetects index.html in the workspace as before The resolved target is persisted as a new `previewUrl` session field and fans out over the existing CDC /events stream (the sessions update trigger now fires on preview_url and carries previewUrl in its payload). The desktop browser panel reflects session.previewUrl: it opens, switches the center pane to the browser, and navigates, re-navigating only when the target changes. ponytail: file:// preview targets are accepted unsanitized; agent-trusted for now. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(cli): document the `ao preview` command Add `ao preview` to the CLI command tables in README.md and docs/cli/README.md, noting it resolves its session from AO_SESSION_ID and its no-arg autodetect vs explicit-URL behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: format with prettier [skip ci] * fix(frontend): reveal `ao preview` in the inspector Browser tab, not the center pane `ao preview` set session.previewUrl, and SessionView surfaced it by popping the browser into the center pane, replacing the terminal. Reveal it in the inspector rail's Browser tab instead (opening the rail if it is collapsed); the manual pop-out button still expands it to the center. Lifts the inspector's active tab to an optional controlled prop so SessionView can drive it, and adds a regression test asserting the center pane keeps the terminal while the rail switches to Browser. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: instruct agents to `ao preview` when showing frontend changes Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Vaibhaav <user@example.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Harshit Singh Bhandari <dev@theharshitsingh.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| README.md | ||
README.md
AO CLI
The ao CLI is a thin Go/Cobra client for the local Agent Orchestrator daemon.
It starts, discovers, inspects, and stops the daemon through the loopback HTTP
surface and the running.json handshake. It must not open SQLite directly or
call runtime, workspace, tracker, or agent adapters in-process.
Current commands
Every product command resolves to a daemon HTTP route. Run ao <command> --help for the authoritative flag shape.
Daemon control
| Command | Purpose |
|---|---|
ao start |
Start the daemon in the background and wait for /readyz. |
ao stop |
Gracefully stop the daemon via loopback POST /shutdown after verifying daemon identity. |
ao status / --json |
Report daemon state from running.json, process liveness, /healthz, and /readyz. |
ao doctor / --json |
Check config, data directory, DB-file presence, daemon state, git, and optional zellij. |
ao completion <shell> |
Generate completions for bash, zsh, fish, or powershell. |
ao version / ao --version |
Print build metadata. |
ao daemon |
Hidden internal daemon entrypoint used by ao start. |
Product commands
| Command | Daemon route |
|---|---|
ao project add |
POST /api/v1/projects |
ao project ls |
GET /api/v1/projects |
ao project get <id> |
GET /api/v1/projects/{id} |
ao project set-config <id> |
PUT /api/v1/projects/{id}/config |
ao project rm <id> |
DELETE /api/v1/projects/{id} |
ao spawn |
POST /api/v1/sessions |
ao session ls |
GET /api/v1/sessions |
ao session get <id> |
GET /api/v1/sessions/{id} |
ao session kill <id> |
POST /api/v1/sessions/{id}/kill |
ao session restore <id> |
POST /api/v1/sessions/{id}/restore |
ao session rename <id> <name> |
PATCH /api/v1/sessions/{id} |
ao session cleanup |
POST /api/v1/sessions/cleanup |
ao session claim-pr <id> <pr-ref> |
POST /api/v1/sessions/{id}/pr/claim |
ao orchestrator ls |
GET /api/v1/orchestrators |
ao send |
POST /api/v1/sessions/{id}/send |
ao preview [url] |
POST /api/v1/sessions/{id}/preview |
ao hooks <agent> <event> |
POST /api/v1/sessions/{id}/activity (hidden) |
ao preview resolves its session from the AO_SESSION_ID environment variable
(it is meant to run inside a session), not a flag. With no argument it
autodetects an index.html in the session workspace; with a URL argument it
opens that URL verbatim (file://, http, https).
go run . in backend/ remains a compatibility wrapper around the daemon.
PR and review actions (merge, resolve-comments, review execute/send) are
HTTP-only today and driven by the frontend; there are no ao pr / ao review
commands yet.
Configuration
The CLI and daemon share the same environment-driven config:
| Var | Default | Purpose |
|---|---|---|
AO_PORT |
3001 |
Loopback daemon port. |
AO_RUN_FILE |
~/.ao/running.json |
PID/port handshake. |
AO_DATA_DIR |
~/.ao/data |
SQLite data directory. |
AO_REQUEST_TIMEOUT |
60s |
REST request timeout. |
AO_SHUTDOWN_TIMEOUT |
10s |
Graceful shutdown cap. |
The daemon always binds 127.0.0.1.
Manual smoke test
cd backend
go build -o /tmp/ao ./cmd/ao
tmp=$(mktemp -d)
export AO_RUN_FILE="$tmp/running.json"
export AO_DATA_DIR="$tmp/data"
export AO_PORT=3037
/tmp/ao status --json
/tmp/ao doctor
/tmp/ao start
/tmp/ao status --json
/tmp/ao stop
/tmp/ao status --json
rm -rf "$tmp"
Adding new commands
Add a product command only when a daemon HTTP route owns the corresponding
mutation/read; the CLI must call that route rather than reimplementing daemon
behavior. Commands not yet exposed but with backend routes in place include
ao events ... (over the CDC/SSE endpoint) and CLI parity for PR/review
actions.
Do not port old in-process TypeScript CLI behavior that mixed command handling
with storage and runtime implementation details.