How google-gemini/computer-use-preview works
Computer Use Preview is a CLI-driven browser agent: a user supplies a task, the agent asks Gemini for computer-use actions, dispatches those actions to a selected browser backend, and sends the resulting page state back into the interaction. Playwright provides local browser control; Browserbase reuses its computer behavior over a remotely hosted browser session. The excerpts show the CLI wiring, agent/model interaction, and backend calls; finer-grained behavior inside the unsampled agent loop is not expanded here.
Main entry points: main.py Agent CLI · playwright.py Playwright browser · agent.py Agent loop · browserbase.py Browserbase backend
Components 9
Task entry
- Agent CLI
main.py
Agent runtime
- Agent loop
agent.py
Browser environments
- Computer interface
computers/computer.py - Playwright browser
computers/playwright/playwright.py - Browserbase backend
computers/browserbase/browserbase.py
Other components
- Task user
- Gemini API
- Browserbase service
- Web page
Connections 10
- Task user → Agent CLI: submits task
README.md - Agent CLI → Agent loop: starts agent
main.py - Agent CLI → Playwright browser: selects backend
main.py - Agent CLI → Browserbase backend: selects backend
main.py - Agent loop → Gemini API: requests actions
agent.py - Agent loop → Computer interface: dispatches actions
agent.py - Playwright browser → Computer interface: implements controls
computers/playwright/playwright.py - Browserbase backend → Playwright browser: inherits controls
computers/browserbase/browserbase.py - Playwright browser → Web page: controls browser
computers/playwright/playwright.py - Browserbase backend → Browserbase service: creates session
computers/browserbase/browserbase.py