forked from browser-use/browser-harness
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
44 lines (35 loc) · 883 Bytes
/
run.py
File metadata and controls
44 lines (35 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import sys
from admin import (
ensure_daemon,
list_cloud_profiles,
list_local_profiles,
restart_daemon,
start_remote_daemon,
stop_remote_daemon,
sync_local_profile,
)
from helpers import *
HELP = """Browser Harness
Read SKILL.md for the default workflow and examples.
Typical usage:
uv run bh <<'PY'
ensure_real_tab()
print(page_info())
PY
Helpers are pre-imported. The daemon auto-starts and connects to the running browser.
"""
def main():
if len(sys.argv) > 1 and sys.argv[1] in {"-h", "--help"}:
print(HELP)
return
if sys.stdin.isatty():
sys.exit(
"browser-harness reads Python from stdin. Use:\n"
" browser-harness <<'PY'\n"
" print(page_info())\n"
" PY"
)
ensure_daemon()
exec(sys.stdin.read())
if __name__ == "__main__":
main()