Skip to main content

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

ArgumentDescription
--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

ArgumentDefaultDescription
--max-iterations <num>20Maximum exploration loop iterations
--step-delay <ms>500Wait time between steps (milliseconds)
--stall-check-interval <num>3Check for stall every N iterations
--history-window <num>10Number of recent steps to pass to AI
--max-failures <num>3Consecutive failures before aborting exploration
--headless <bool>trueSet to false to show the browser window
--no-snapshot-filterfalseDisable snapshot filtering (pass full DOM to AI)

Context & secrets

ArgumentDefaultDescription
--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

ArgumentDefaultDescription
--screenshots <dir>-Directory to save screenshots
--video <dir>-Directory for video recording output

AI model

ArgumentDefaultDescription
--model <id>claude-sonnet-4-6AI model ID
--model-provider <provider>anthropicAI 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:
ArgumentDescription
--enable-multi-modelEnable 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

ArgumentDefaultDescription
--locale <code>enUI and AI prompt language: en or ja
--stealthfalseEnable 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:
{
  "email": "[email protected]",
  "password": "s3cret!"
}

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

VariableDescription
AI_MODEL_IDDefault for --model
AI_MODEL_PROVIDERDefault for --model-provider
AGENTIC_BROWSER_LOCALEDefault for --locale (en or ja)
AGENTIC_BROWSER_API_KEYDefault 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.