feat: rewrite setup as interactive post-install command

Six steps: home dir, config.json, Chromium, profile-use, cloudflared,
validation + config display. Interactive prompts for downloads (steps
3-5), --yes for CI. Idempotent — skips what's already installed.
This commit is contained in:
ShawnPana
2026-04-01 15:36:47 -07:00
parent 2e7dff8aa6
commit d60dd24cdf
2 changed files with 201 additions and 191 deletions

View File

@@ -1192,15 +1192,9 @@ def main() -> int:
if args.command == 'setup':
from browser_use.skill_cli.commands import setup
loop = asyncio.get_event_loop()
result = loop.run_until_complete(
setup.handle(
'setup',
{
'yes': getattr(args, 'yes', False),
'json': args.json,
},
)
result = setup.handle(
yes=getattr(args, 'yes', False),
json_output=args.json,
)
if args.json:
@@ -1208,10 +1202,6 @@ def main() -> int:
elif 'error' in result:
print(f'Error: {result["error"]}', file=sys.stderr)
return 1
else:
if result.get('status') == 'success':
print('\n✓ Setup complete!')
print('Next: browser-use open https://example.com')
return 0
# Handle doctor command