File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ classifiers = [
39
39
Homepage = " https://github.com/browserbase/sdk-python"
40
40
Repository = " https://github.com/browserbase/sdk-python"
41
41
42
-
42
+ [project .scripts ]
43
+ browserbase = " browserbase.cli:main"
43
44
44
45
[tool .rye ]
45
46
managed = true
Original file line number Diff line number Diff line change
1
+ import sys
2
+ import subprocess
3
+ from typing import List , Optional
4
+
5
+
6
+ def main (args : Optional [List [str ]] = None ) -> int :
7
+ if args is None :
8
+ args = sys .argv [1 :]
9
+
10
+ if not args :
11
+ print ("Usage: browserbase <command>" )
12
+ return 1
13
+
14
+ # Execute the command
15
+ try :
16
+ result = subprocess .run (args , check = True )
17
+ return result .returncode
18
+ except subprocess .CalledProcessError as e :
19
+ print (f"Command failed with exit code { e .returncode } " )
20
+ return e .returncode
21
+ except FileNotFoundError :
22
+ print (f"Command not found: { args [0 ]} " )
23
+ return 127
24
+
25
+
26
+ if __name__ == "__main__" :
27
+ sys .exit (main ())
You can’t perform that action at this time.
0 commit comments