Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Make install command work without CLI dependencies

ShawnPana1ca130754546
diff --git a/browser_use/cli.py b/browser_use/cli.py
index 1a2a19587..9cc75775d 100644
--- a/browser_use/cli.py
+++ b/browser_use/cli.py
@@ -11,6 +11,23 @@ if '--mcp' in sys.argv:
os.environ['BROWSER_USE_SETUP_LOGGING'] = 'false'
logging.disable(logging.CRITICAL)
+# Special case: install command doesn't need CLI dependencies
+if len(sys.argv) > 1 and sys.argv[1] == 'install':
+ import subprocess
+
+ print('📦 Installing Chromium browser + system dependencies...')
+ print('⏳ This may take a few minutes...\n')
+
+ result = subprocess.run(['uvx', 'playwright', 'install', 'chromium', '--with-deps', '--no-shell'])
+
+ if result.returncode == 0:
+ print('\n✅ Installation complete!')
+ print('🚀 Ready to use! Run: uvx browser-use')
+ else:
+ print('\n❌ Installation failed')
+ sys.exit(1)
+ sys.exit(0)
+
import asyncio
import json
import logging