-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha0
More file actions
executable file
·40 lines (34 loc) · 982 Bytes
/
a0
File metadata and controls
executable file
·40 lines (34 loc) · 982 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
#!/bin/bash
# Agent Zero CLI - Terminal UI / CLI for Agent Zero
# Usage: a0 [--cli] [options]
# Entry points:
# main_new.py (TUI - default)
# cli.py (CLI - with --cli flag)
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"
# Clean Python cache
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
find . -name "*.pyc" -delete 2>/dev/null
# Determine entry point based on --cli flag
ENTRY_POINT="main_new.py"
for arg in "$@"; do
if [ "$arg" = "--cli" ] || [ "$arg" = "-c" ]; then
ENTRY_POINT="cli.py"
break
fi
done
# Remove --cli from args before passing to Python
ARGS=()
for arg in "$@"; do
if [ "$arg" != "--cli" ] && [ "$arg" != "-c" ]; then
ARGS+=("$arg")
fi
done
# Use venv if available
if [ -x "venv/bin/python" ]; then
exec venv/bin/python "$ENTRY_POINT" "${ARGS[@]}"
elif [ -x "venv/bin/python3" ]; then
exec venv/bin/python3 "$ENTRY_POINT" "${ARGS[@]}"
else
exec python3 "$ENTRY_POINT" "${ARGS[@]}"
fi