- Add UTM params to all cloud-bound links across README, CLI, and error messages
- Rewrite README Open Source vs Cloud section: position cloud browsers as
recommended pairing for OSS users, remove separate Use Both section
- Rewrite error messages for use_cloud=True and ChatBrowserUse() to clearly
state what is wrong and what to do next
- Add missing URLs: invalid API key now links to key page, insufficient
credits now links to billing page
- Add cloud browser nudge on captcha detection (logger.warning)
- Add cloud browser nudge on local browser launch failure
Replace the multi-session server (server.py, SessionRegistry, portalocker locking,
PID files, orphan detection) with a minimal daemon (daemon.py) that holds one
BrowserSession in memory. Socket file existence = alive. Auto-exits when browser
dies via CDP watchdog.
-2277 lines, +142 lines across 20 files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Introduced a utility function `create_task_with_error_handling` to manage asyncio tasks with proper exception logging and suppression options.
- Updated multiple components, including `SessionManager`, `BrowserSession`, and various watchdogs, to utilize the new error handling mechanism for background tasks.
- Enhanced overall robustness of asynchronous operations by ensuring exceptions are logged and handled appropriately, improving maintainability and debugging capabilities.
- Replaced instances of `agent_focus` with `agent_focus_target_id` across various components to ensure consistent target management.
- Enhanced error handling and logging in `Watchdog` classes to reflect the new target ID approach.
- Improved session retrieval methods to streamline interactions with the `SessionManager`, ensuring better performance and reliability.
- Add click to core dependencies (moved from [cli] optional deps)
- Create standalone browser_use/init_cmd.py with template generation logic
- Add early check in cli.py to redirect 'init' subcommand to init_cmd.py
- This allows 'uvx browser-use init' to work without installing textual/rich
Users can now run template generation with minimal dependencies:
uvx browser-use init # Interactive template selection
uvx browser-use init -t default # Generate default template
uvx browser-use init --list # List available templates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds `uvx browser-use init` command to generate starter template files,
making it easier for users to get started with browser-use.
Changes:
- Add `init` subcommand with three template options:
- quickstart: Minimal setup using ChatBrowserUse
- advanced: All configuration options with defaults
- tools: Custom action examples
- Templates support both CLI syntax:
- `uvx browser-use init --template <name>`
- `uvx browser-use --template <name>` (shorthand)
- Add interactive mode when no template specified
- Include template files in package build
- All templates use async patterns with Browser(use_cloud=False)
Usage:
uvx browser-use init --template quickstart
uvx browser-use --template advanced --output my_script.py
uvx browser-use init --list
- Updated `run_auth_command` to provide detailed authentication status updates and debug information during the authentication process.
- Introduced a new `UpdateAgentSessionEvent` class to facilitate session updates.
- Enhanced `CloudSync` to allow all events during the authentication flow and to show direct links for authenticated users.
- Improved error handling and user messaging for authentication failures.
- Updated documentation to clarify cloud sync settings and authentication instructions.
- Updated `run_auth_command` to check authentication status before proceeding, providing immediate feedback for already authenticated users.
- Introduced new task events for both authenticated and unauthenticated states to improve user experience during the authentication process.
- Modified the `main` function to include a dedicated `auth` command for easier access to cloud authentication.
- Updated documentation to reflect changes in the authentication process and usage instructions.
- Refactored `run_auth_command` to establish a session context using a minimal sync service before authentication.
- Introduced `allow_session_events_for_auth` flag in `CloudSync` to permit session events during the authentication process.
- Updated tests to verify that session events are sent correctly before full authentication, ensuring proper event handling based on authentication status.
- Added `run_auth_command` to handle user authentication via the CLI, allowing users to authenticate with Browser Use Cloud.
- Updated `main` function to trigger authentication when the `--auth` option is used.
- Introduced `authenticate_cloud_sync` method in `CloudSync` to facilitate authentication after task completion.
- Modified `DeviceAuthClient` to handle empty agent session IDs gracefully.
- Updated documentation to include instructions for cloud authentication setup and usage.
- Enhanced tests to verify authentication flow and event handling based on authentication status.