### Run Example Scripts Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/development/setup/local-setup.mdx Executes a sample script to verify the installation. ```bash uv run examples/simple.py ``` -------------------------------- ### Start local development environment Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Use Docker Compose to start the backend and PostgreSQL, then start the frontend locally. ```bash # Start backend + PostgreSQL (frontend runs locally) docker-compose -f docker-compose.dev.yml up --build # In a separate terminal, start the frontend cd frontend && npm install && npm run dev ``` -------------------------------- ### Install OpenBrowser from Source Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart.mdx Clone the repository and install in editable mode. ```bash git clone https://github.com/billy-enrizky/openbrowser-ai.git cd openbrowser-ai uv pip install -e ".[agent]" ``` -------------------------------- ### Install Required Packages Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/examples/integrations/slack/README.md Install the necessary Python dependencies to run the Slack integration example. ```sh pip install fastapi uvicorn slack_sdk ``` -------------------------------- ### Quick Reference Guide Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart_llm.mdx A markdown-formatted reference containing installation commands, basic usage patterns, and a list of supported LLM classes. ```markdown # OpenBrowser Quick Reference ## Installation pip install openbrowser-ai ## Basic Usage from openbrowser import Agent, Browser, ChatGoogle agent = Agent( task="Your task here", llm=ChatGoogle(), # or ChatOpenAI(), ChatAnthropic() ) await agent.run() ## Key Classes - Agent: Main automation agent - Browser: Browser instance wrapper - BrowserSession: Low-level browser control - BrowserProfile: Browser configuration ## Supported LLMs - ChatGoogle (Gemini) - ChatOpenAI (GPT-4) - ChatAnthropic (Claude) - ChatGroq, ChatOllama, ChatAWSBedrock, ChatAzureOpenAI ``` -------------------------------- ### Quick Install for OpenCode Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Use this command to fetch installation instructions directly within the OpenCode environment. ```text Fetch and follow instructions from https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/refs/heads/main/.opencode/INSTALL.md ``` -------------------------------- ### Install openbrowser-ai Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/plugin/skills/deep-research/SKILL.md Installation commands for different operating systems. ```bash # macOS / Linux curl -fsSL https://openbrowser.me/install.sh | sh # Windows PowerShell irm https://openbrowser.me/install.ps1 | iex ``` -------------------------------- ### Install OpenBrowser via uv Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart.mdx Recommended installation method using uv for dependency management. ```bash uv pip install "openbrowser-ai[agent]" ``` ```bash uv venv --python 3.12 source .venv/bin/activate uv pip install "openbrowser-ai[agent]" ``` -------------------------------- ### Install via PowerShell Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Use this command for quick installation on Windows systems. ```powershell irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex ``` -------------------------------- ### Install OpenLIT and OpenBrowser Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/development/monitoring/openlit.mdx Install the necessary packages via pip. ```bash pip install openlit openbrowser ``` -------------------------------- ### Install openbrowser-ai Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/examples/apps/ad-use.mdx Install the required package with screenshot functionality. ```bash pip install -U openbrowser-ai ``` -------------------------------- ### Clone and Install Dependencies Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/development/setup/local-setup.mdx Initializes the project repository and installs necessary dependencies using uv or pip. ```bash git clone https://github.com/billy-enrizky/openbrowser-ai cd openbrowser-ai uv sync --all-extras --dev # or pip install -U git+https://github.com/billy-enrizky/openbrowser-ai.git ``` -------------------------------- ### Install OpenBrowser Environment Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Commands to set up the Python environment and install necessary dependencies. ```bash pip install uv uv venv --python 3.12 ``` ```bash source .venv/bin/activate # On Windows use `.venv\Scripts\activate` ``` ```bash uv pip install openbrowser-ai uvx openbrowser-ai install ``` -------------------------------- ### Quick Install for Codex Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Use this command to fetch installation instructions directly within the Codex environment. ```text Fetch and follow instructions from https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/refs/heads/main/.codex/INSTALL.md ``` -------------------------------- ### Install via Shell Script Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Use these commands for quick installation on macOS or Linux systems. ```bash curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh ``` ```bash curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh -s -- --local ``` -------------------------------- ### Install openbrowser-ai Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/plugin/skills/form-filling/SKILL.md Installation commands for Unix-based systems and Windows PowerShell. ```bash # macOS/Linux curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh # Windows (PowerShell) irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex ``` -------------------------------- ### Install Backend Dependencies Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/backend/README.md Commands to install project dependencies and configure the environment. ```bash # Install dependencies cd backend uv pip install -e . # Install openbrowser from local path uv pip install -e /path/to/openbrowser-ai # Copy environment file cp env.example .env # Edit .env with your API keys ``` -------------------------------- ### Install Optional Dependencies Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Install specific provider or feature-based dependencies. ```bash pip install openbrowser-ai[agent] # LLM agent support (langgraph, langchain, litellm) pip install openbrowser-ai[all] # All LLM providers pip install openbrowser-ai[anthropic] # Anthropic Claude pip install openbrowser-ai[groq] # Groq pip install openbrowser-ai[ollama] # Ollama (local models) pip install openbrowser-ai[aws] # AWS Bedrock pip install openbrowser-ai[azure] # Azure OpenAI pip install openbrowser-ai[video] # Video recording support ``` -------------------------------- ### Install browser dependencies Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Commands to set up the required browser environment. ```bash uvx openbrowser-ai install # or playwright install chromium ``` -------------------------------- ### Install OpenBrowser AI via pip Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Standard installation command for the core library. ```bash pip install openbrowser-ai ``` -------------------------------- ### Install OpenBrowser AI with optional dependencies Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Commands for installing specific LLM providers or video recording support. ```bash # Install with all LLM providers pip install openbrowser-ai[all] # Install specific providers pip install openbrowser-ai[anthropic] # Anthropic Claude pip install openbrowser-ai[groq] # Groq pip install openbrowser-ai[ollama] # Ollama (local models) pip install openbrowser-ai[aws] # AWS Bedrock pip install openbrowser-ai[azure] # Azure OpenAI # Install with video recording support pip install openbrowser-ai[video] ``` -------------------------------- ### Clone Repository Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/examples/apps/ad-use.mdx Clone the repository and navigate to the ad-use example directory. ```bash git clone https://github.com/billy-enrizky/openbrowser-ai.git cd openbrowser/examples/apps/ad-use ``` -------------------------------- ### Install OpenBrowser via pip Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart.mdx Standard installation using pip, with optional agent support. ```bash pip install openbrowser-ai ``` ```bash pip install "openbrowser-ai[agent]" ``` -------------------------------- ### Clone Repository Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/examples/apps/news-use.mdx Clone the repository and navigate to the news-use example directory. ```bash git clone https://github.com/billy-enrizky/openbrowser-ai.git cd openbrowser/examples/apps/news-use ``` -------------------------------- ### Start MCP Server Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/customize/integrations/mcp-server.mdx Run the MCP server in stdio mode using uvx. ```bash uvx openbrowser-ai --mcp ``` -------------------------------- ### Start full stack environment Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Build and run the backend, frontend, and PostgreSQL services together. ```bash # Start all services (backend + frontend + PostgreSQL) docker-compose up --build ``` -------------------------------- ### CLI Usage Commands Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Common CLI commands for running automation tasks, installing browser dependencies, and starting the MCP server. ```bash # Run a browser automation task uvx openbrowser-ai -p "Search for Python tutorials on Google" # Install browser uvx openbrowser-ai install # Run MCP server uvx openbrowser-ai[mcp] --mcp ``` -------------------------------- ### Execute OpenBrowser-AI CLI Commands Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Commands for running automation tasks, managing the persistent browser daemon, installing browser dependencies, and starting the MCP server. ```bash # Run a browser automation task with an LLM agent uvx openbrowser-ai -p "Search for Python tutorials on Google" # Execute code directly via persistent daemon uvx openbrowser-ai -c "await navigate('https://example.com')" uvx openbrowser-ai -c "print(await evaluate('document.title'))" # Daemon management uvx openbrowser-ai daemon start # Start daemon (auto-starts on first -c call) uvx openbrowser-ai daemon stop # Stop daemon and browser uvx openbrowser-ai daemon status # Show daemon info uvx openbrowser-ai daemon restart # Restart daemon # Install browser uvx openbrowser-ai install # Run MCP server uvx openbrowser-ai --mcp ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/development/setup/local-setup.mdx Sets up the local environment configuration by copying the example file. ```bash # Copy the example environment file cp .env.example .env # set logging level # OPENBROWSER_LOGGING_LEVEL=debug ``` -------------------------------- ### Initialize and run an agent Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/customize/agent/basics.mdx Basic setup for an agent instance with a task and LLM, followed by the asynchronous execution method. ```python from openbrowser import Agent, ChatBrowserUse agent = Agent( task="Search for latest news about AI", llm=ChatBrowserUse(), ) async def main(): history = await agent.run(max_steps=100) ``` -------------------------------- ### Verify or Install openbrowser-ai Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/plugin/skills/web-scraping/SKILL.md Check if the tool is installed or run the appropriate installation script for your operating system. ```bash openbrowser-ai --help ``` ```bash # macOS/Linux curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh # Windows (PowerShell) irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex ``` -------------------------------- ### Initialize Vibetest Environment Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/examples/apps/vibetest-use.mdx Commands to clone the repository, set up a virtual environment, and install the necessary browser runtime. ```bash # 1. Clone repo git clone https://github.com/billy-enrizky/vibecheck.git cd vibecheck # 2. Create & activate env uv venv --python 3.11 source .venv/bin/activate # 3. Install project uv pip install -e . # 4. Install browser runtime once uvx openbrowser-ai install ``` -------------------------------- ### GET /api/v1/projects/{project_id} Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/backend/README.md Get details for a specific project. ```APIDOC ## GET /api/v1/projects/{project_id} ### Description Get details for a specific project. ### Method GET ### Endpoint /api/v1/projects/{project_id} ### Parameters #### Path Parameters - **project_id** (string) - Required - The unique identifier of the project. ``` -------------------------------- ### Initialize Environment File Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart.mdx Create a .env file to store API keys. ```bash touch .env ``` -------------------------------- ### GET /api/v1/tasks/{task_id} Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/backend/README.md Get details for a specific task. ```APIDOC ## GET /api/v1/tasks/{task_id} ### Description Get details for a specific task. ### Method GET ### Endpoint /api/v1/tasks/{task_id} ### Parameters #### Path Parameters - **task_id** (string) - Required - The unique identifier of the task. ``` -------------------------------- ### Orchestrator pre-step setup Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/plugin/skills/deep-research/SKILL.md Initializes the partial directory and clears stale files before dispatching sub-agents. ```bash openbrowser-ai -c - <<'EOF' import os PROJECT_ROOT = "" partial_dir = os.path.join(PROJECT_ROOT, "local_docs", "research", "_partial") os.makedirs(partial_dir, exist_ok=True) # Wipe stale partials from prior runs of the same query for f in os.listdir(partial_dir): if f.startswith("agent-") and f.endswith(".json"): os.remove(os.path.join(partial_dir, f)) print(f"partial dir ready: {partial_dir}") EOF ``` -------------------------------- ### Initialize Browser and Agent Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/customize/actor/basics.mdx Demonstrates setting up the browser session, performing precise element interactions, and executing AI-driven tasks. ```python from openbrowser import Browser, Agent from openbrowser.llm.openai import ChatOpenAI async def main(): llm = ChatOpenAI(api_key="your-api-key") browser = Browser() await browser.start() # 1. Actor: Precise navigation and element interactions page = await browser.new_page("https://github.com/login") email_input = await page.must_get_element_by_prompt("username field", llm=llm) await email_input.fill("your-username") # 2. Agent: AI-driven complex tasks agent = Agent(browser=browser, llm=llm) await agent.run("Complete login and navigate to my repositories") await browser.stop() ``` -------------------------------- ### Configure different LLM providers Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Examples of initializing agents with OpenAI, Anthropic, and Google Gemini models. ```python from openbrowser import Agent, ChatOpenAI, ChatAnthropic, ChatGoogle # OpenAI agent = Agent(task="...", llm=ChatOpenAI(model="gpt-4o")) # Anthropic agent = Agent(task="...", llm=ChatAnthropic(model="claude-sonnet-4-0")) # Google Gemini agent = Agent(task="...", llm=ChatGoogle(model="gemini-2.0-flash")) ``` -------------------------------- ### Install OpenBrowser via Homebrew Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart.mdx Install OpenBrowser into a Homebrew-managed virtualenv. ```bash brew tap billy-enrizky/openbrowser brew install openbrowser-ai ``` -------------------------------- ### Install OCI dependencies Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/src/openbrowser/llm/oci_raw/README.md Install the required OCI Python SDK package. ```bash pip install oci ``` -------------------------------- ### Perform Initial Login Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/examples/apps/msg-use.mdx Run the login script to authenticate with WhatsApp Web via QR code. ```bash python login.py ``` -------------------------------- ### Clone and Navigate to Repository Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/examples/apps/msg-use.mdx Clone the repository and enter the application directory. ```bash git clone https://github.com/billy-enrizky/openbrowser-ai.git cd openbrowser/examples/apps/msg-use ``` -------------------------------- ### Install OpenBrowser via pipx Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/quickstart.mdx Install into an isolated environment with global command access. ```bash pipx install openbrowser-ai ``` -------------------------------- ### Install OpenBrowser Plugin Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/plugin/README.md Commands to add the marketplace and install the OpenBrowser plugin into Claude Code. ```bash # Add the OpenBrowser marketplace (one-time) claude plugin marketplace add billy-enrizky/openbrowser-ai # Install the plugin claude plugin install openbrowser@openbrowser-ai ``` -------------------------------- ### Run a basic agent task Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Example of initializing an agent with a task and a Google LLM provider. ```python import asyncio from openbrowser import Agent, ChatGoogle async def main(): agent = Agent( task="Go to google.com and search for 'Python tutorials'", llm=ChatGoogle(), ) result = await agent.run() print(f"Result: {result}") asyncio.run(main()) ``` -------------------------------- ### Manual Install for OpenCode Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/README.md Manually clone the repository and symlink the plugin and skills for OpenCode integration. ```bash # Clone the repository git clone https://github.com/billy-enrizky/openbrowser-ai.git ~/.config/opencode/openbrowser # Create directories mkdir -p ~/.config/opencode/plugins ~/.config/opencode/skills # Symlink plugin and skills ln -s ~/.config/opencode/openbrowser/.opencode/plugins/openbrowser.js ~/.config/opencode/plugins/openbrowser.js ln -s ~/.config/opencode/openbrowser/plugin/skills ~/.config/opencode/skills/openbrowser # Restart OpenCode ``` -------------------------------- ### Install n8n community node Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/docs/development/n8n-integration.mdx Command to install the OpenBrowser node in a self-hosted n8n environment. ```bash npm install n8n-nodes-openbrowser ``` -------------------------------- ### Agent Initialization with LLM Providers Source: https://github.com/billy-enrizky/openbrowser-ai/blob/main/stress-tests/llms-full.txt Examples of how to initialize the Agent class with different supported LLM provider classes. ```APIDOC ## SDK Usage: Initializing Agents with Models ### Description To use OpenBrowser, initialize an Agent with a specific LLM provider class (e.g., ChatGoogle, ChatOpenAI, ChatAnthropic, ChatAzureOpenAI, ChatAWSBedrock). Each provider requires specific environment variables for authentication. ### Supported Providers - **Google Gemini**: Use `ChatGoogle` with `GOOGLE_API_KEY`. - **OpenAI**: Use `ChatOpenAI` with `OPENAI_API_KEY`. - **Anthropic**: Use `ChatAnthropic` with `ANTHROPIC_API_KEY`. - **Azure OpenAI**: Use `ChatAzureOpenAI` with `AZURE_OPENAI_ENDPOINT` and `AZURE_OPENAI_API_KEY`. - **AWS Bedrock**: Use `ChatAWSBedrock` or `ChatAnthropicBedrock` with AWS credentials. ### Example (OpenAI) ```python from openbrowser import Agent, ChatOpenAI llm = ChatOpenAI(model="o3") agent = Agent(task="Your task here", llm=llm) ``` ### Example (AWS Bedrock) ```python from openbrowser import Agent, ChatAWSBedrock llm = ChatAWSBedrock( model="anthropic.claude-3-5-sonnet-20240620-v1:0", aws_region="us-east-1" ) agent = Agent(task="Your task here", llm=llm) ``` ```