-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
83 lines (75 loc) · 2.55 KB
/
Copy pathcli.py
File metadata and controls
83 lines (75 loc) · 2.55 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"""Single CLI gateway for all StarShell agents.
Usage:
python cli.py --agent bash
python cli.py --agent bash --domain gitlab --no-docs --no-skills
python cli.py --agent mcp --domain servicenow
python cli.py --agent playwright --domain erpnext
python cli.py --agent bash --model bedrock/us.anthropic.claude-sonnet-4-5-v1
"""
import argparse
import asyncio
from starshell.model import DEFAULT_MODEL_ID
from starshell.agents.api_call import main as api_call_main
from starshell.agents.bash import main as bash_main
from starshell.agents.mas import main as mas_main
from starshell.agents.mcp import main as mcp_main
from starshell.agents.playwright import main as playwright_main
def main():
parser = argparse.ArgumentParser(
prog="starshell",
description="StarShell — interactive agent for ServiceNow, GitLab, and ERPNext",
)
parser.add_argument(
"--agent",
choices=["bash", "mcp", "playwright", "mas", "hybrid", "api_call"],
default="bash",
help="Agent type to launch (default: bash)",
)
parser.add_argument(
"--domain",
choices=["servicenow", "gitlab", "erpnext"],
default="servicenow",
help="Target domain (default: servicenow)",
)
parser.add_argument(
"--model",
default=None,
help=f"LiteLLM model ID (default: {DEFAULT_MODEL_ID})",
)
parser.add_argument(
"--no-docs",
action="store_true",
help="Omit docs section from prompt (bash only)",
)
parser.add_argument(
"--no-skills",
action="store_true",
help="Omit skills section from prompt (bash only)",
)
args = parser.parse_args()
if args.agent == "bash":
asyncio.run(
bash_main(
domain=args.domain,
include_docs=not args.no_docs,
include_skills=not args.no_skills,
model_id=args.model,
)
)
elif args.agent == "mcp":
asyncio.run(mcp_main(domain=args.domain, model_id=args.model))
elif args.agent == "playwright":
asyncio.run(playwright_main(domain=args.domain, model_id=args.model))
elif args.agent == "mas":
asyncio.run(
mas_main(
domain=args.domain,
include_docs=not args.no_docs,
include_skills=not args.no_skills,
model_id=args.model,
)
)
elif args.agent == "api_call":
asyncio.run(api_call_main(domain=args.domain, model_id=args.model))
if __name__ == "__main__":
main()