* chat

* docs

* fmt
This commit is contained in:
Chris Tate
2026-04-06 09:21:11 -05:00
committed by GitHub
parent 317e6869b6
commit 131f229971
10 changed files with 655 additions and 15 deletions
+20 -1
View File
@@ -130,6 +130,8 @@ agent-browser stream status # Show runtime streaming state and bound p
agent-browser stream disable # Stop runtime WebSocket streaming
agent-browser close # Close browser (aliases: quit, exit)
agent-browser close --all # Close all active sessions
agent-browser chat "<instruction>" # AI chat: natural language browser control (single-shot)
agent-browser chat # AI chat: interactive REPL mode
```
### Get Info
@@ -626,6 +628,9 @@ This is useful for multimodal AI models that can reason about visual layout, unl
| `--confirm-interactive` | Interactive confirmation prompts; auto-denies if stdin is not a TTY (or `AGENT_BROWSER_CONFIRM_INTERACTIVE` env) |
| `--engine <name>` | Browser engine: `chrome` (default), `lightpanda` (or `AGENT_BROWSER_ENGINE` env) |
| `--no-auto-dialog` | Disable automatic dismissal of `alert`/`beforeunload` dialogs (or `AGENT_BROWSER_NO_AUTO_DIALOG` env) |
| `--model <name>` | AI model for chat command (or `AI_GATEWAY_MODEL` env) |
| `-v`, `--verbose` | Show tool commands and their raw output (chat) |
| `-q`, `--quiet` | Show only AI text responses, hide tool calls (chat) |
| `--config <path>` | Use a custom config file (or `AGENT_BROWSER_CONFIG` env) |
| `--debug` | Debug output |
@@ -659,7 +664,7 @@ The dashboard displays:
### AI Chat
The dashboard includes an optional AI chat panel powered by the Vercel AI Gateway. Set these environment variables to enable it:
The dashboard includes an optional AI chat panel powered by the Vercel AI Gateway. The same functionality is available directly from the CLI via the `chat` command. Set these environment variables to enable AI chat:
```bash
export AI_GATEWAY_API_KEY=gw_your_key_here
@@ -667,6 +672,20 @@ export AI_GATEWAY_MODEL=anthropic/claude-sonnet-4.6 # optional, this i
export AI_GATEWAY_URL=https://ai-gateway.vercel.sh # optional, this is the default
```
**CLI usage:**
```bash
agent-browser chat "open google.com and search for cats" # Single-shot
agent-browser chat # Interactive REPL
agent-browser -q chat "summarize this page" # Quiet mode (text only)
agent-browser -v chat "fill in the login form" # Verbose (show command output)
agent-browser --model openai/gpt-4o chat "take a screenshot" # Override model
```
The `chat` command translates natural language instructions into agent-browser commands, executes them, and streams the AI response. In interactive mode, type `quit` to exit. Use `--json` for structured output suitable for agent consumption.
**Dashboard usage:**
The Chat tab is always visible in the dashboard. When `AI_GATEWAY_API_KEY` is set, the Rust server proxies requests to the gateway and streams responses back using the Vercel AI SDK's UI Message Stream protocol. Without the key, sending a message shows an error inline.
## Configuration