Synopsis
npx @basemachina/agentic-browser-cli generate -- \
--url <url> \
--goal <goal> \
--output <path> \
[options]
AI opens a browser, explores the target web app to accomplish the given goal, records each action, reviews the steps, and outputs a clean YAML runbook.
Required arguments
| Argument | Description |
|---|
--url <url> | Starting URL to begin exploration |
--goal <goal> | Goal to accomplish (natural language description) |
--output <path> | Output path for the generated YAML runbook |
Optional arguments
Exploration
| Argument | Default | Description |
|---|
--max-iterations <num> | 20 | Maximum exploration loop iterations |
--step-delay <ms> | 500 | Wait time between steps (milliseconds) |
--stall-check-interval <num> | 3 | Check for stall every N iterations |
--history-window <num> | 10 | Number of recent steps to pass to AI |
--max-failures <num> | 3 | Consecutive failures before aborting exploration |
--headless <bool> | true | Set to false to show the browser window |
--no-snapshot-filter | false | Disable snapshot filtering (pass full DOM to AI) |
Context & secrets
| Argument | Default | Description |
|---|
--context <path> | - | Path to a supplemental context markdown file |
--secrets <path> | - | Path to secrets JSON file ({"key": "value"} format, all values treated as sensitive) |
Output & debugging
| Argument | Default | Description |
|---|
--screenshots <dir> | - | Directory to save screenshots |
--video <dir> | - | Directory for video recording output |
AI model
| Argument | Default | Description |
|---|
--model <id> | claude-sonnet-4-6 | AI model ID |
--model-provider <provider> | anthropic | AI provider: anthropic, openai, openai-compatible, google, azure, bedrock, vertex |
--model-base-url <url> | - | Base URL for OpenAI-compatible endpoints |
Per-purpose model overrides
Use different models for different tasks to optimize cost and quality:
| Argument | Description |
|---|
--enable-multi-model | Enable multi-model routing |
--model-selector <id> | Model for selector resolution |
--model-extraction <id> | Model for data extraction |
--model-exploration <id> | Model for exploration loop |
--model-exploration-light <id> | Lightweight model for exploration |
--model-review <id> | Model for review and repair suggestions |
--model-fallback <id> | Model for Agent Fallback |
Advanced
| Argument | Default | Description |
|---|
--locale <code> | en | UI and AI prompt language: en or ja |
--stealth | false | Enable stealth mode (bot detection evasion) |
--proxy <url> | - | Proxy URL (e.g., http://user:pass@host:port) |
--skill <names> | - | Comma-separated skill plugin names (e.g., google-sheets) |
--api-key <key> | - | API key for Pro/Team/Business/Enterprise features |
--stealth and --proxy require Pro plan or higher. --skill requires Pro plan or higher.
Examples
Basic generation
npx @basemachina/agentic-browser-cli generate -- \
--url "https://app.example.com/login" \
--goal "Log in with email and password, then navigate to the settings page" \
--output ./login-settings.yaml \
--context ./context.md \
--secrets ./secrets.json \
--model "claude-sonnet-4-6" \
--model-provider anthropic
Instead of passing --model and --model-provider on every command, you can set defaults via environment variables:export AI_MODEL_ID="claude-sonnet-4-6"
export AI_MODEL_PROVIDER="anthropic"
See environment variables for the full list.
With browser visible
npx @basemachina/agentic-browser-cli generate -- \
--url "https://staging.example.com" \
--goal "Create a new project named 'Test Project'" \
--output ./create-project.yaml \
--headless false
With context file
Provide additional context to help AI understand your app:
npx @basemachina/agentic-browser-cli generate -- \
--url "https://app.example.com" \
--goal "Export the monthly report as CSV" \
--output ./export-report.yaml \
--context ./app-guide.md
With secrets
npx @basemachina/agentic-browser-cli generate -- \
--url "https://app.example.com/login" \
--goal "Log in and view the dashboard" \
--output ./login.yaml \
--secrets ./secrets.json
Where secrets.json:
Using OpenAI
export OPENAI_API_KEY="sk-..."
npx @basemachina/agentic-browser-cli generate -- \
--url "https://app.example.com" \
--goal "Fill out the contact form" \
--output ./contact-form.yaml \
--model "gpt-4o" \
--model-provider openai
With screenshots and video
npx @basemachina/agentic-browser-cli generate -- \
--url "https://app.example.com" \
--goal "Complete the onboarding flow" \
--output ./onboarding.yaml \
--screenshots ./screenshots \
--video ./videos
Environment variables
| Variable | Description |
|---|
AI_MODEL_ID | Default for --model |
AI_MODEL_PROVIDER | Default for --model-provider |
AGENTIC_BROWSER_LOCALE | Default for --locale (en or ja) |
AGENTIC_BROWSER_API_KEY | Default for --api-key |
Output
The command outputs a YAML runbook file at the specified --output path. The runbook contains:
goal — The original goal
url — The starting URL
variables — Extracted variables (if any)
steps — Ordered list of actions with selectors, values, and descriptions
See the quickstart for a sample output.