-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_cli.bat
More file actions
88 lines (76 loc) · 2.35 KB
/
Copy pathrun_cli.bat
File metadata and controls
88 lines (76 loc) · 2.35 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
84
85
86
87
88
@echo off
setlocal
cd /d "%~dp0"
set "PYTHONPATH=%CD%\src"
set "AGENT_BACKEND=cli"
set "PYTHON_EXE=C:\Users\yixin\AppData\Local\Programs\Python\Python313\python.exe"
set "FAST_FLAG="
set "DOCTOR_FLAG="
set "DOCTOR_LIVE_FLAG="
set "DOCTOR_OUTPUT_FLAG="
set "BENCHMARK_FLAG="
set "BENCHMARK_OUTPUT_FLAG="
set "SESSION_DIR_FLAG="
if /I "%~1"=="--fast" (
set "FAST_FLAG=--fast"
shift
)
if /I "%~1"=="--doctor" (
set "DOCTOR_FLAG=--doctor"
shift
)
if /I "%~1"=="--benchmark" (
set "BENCHMARK_FLAG=--benchmark"
shift
)
if /I "%~1"=="--live" (
set "DOCTOR_LIVE_FLAG=--doctor-live"
shift
)
if /I "%~1"=="--output" (
if "%~2"=="" (
echo Error: --output requires a file path.
exit /b 1
)
if defined DOCTOR_FLAG (
set "DOCTOR_OUTPUT_FLAG=--doctor-output \"%~2\""
) else if defined BENCHMARK_FLAG (
set "BENCHMARK_OUTPUT_FLAG=--benchmark-output \"%~2\""
) else (
echo Error: --output is only supported with --doctor or --benchmark in this wrapper.
exit /b 1
)
shift
shift
)
if /I "%~1"=="--session-dir" (
if "%~2"=="" (
echo Error: --session-dir requires a directory path.
exit /b 1
)
set "SESSION_DIR_FLAG=--session-dir \"%~2\""
shift
shift
)
if defined DOCTOR_FLAG (
"%PYTHON_EXE%" -m agent_system %DOCTOR_FLAG% %DOCTOR_LIVE_FLAG% %DOCTOR_OUTPUT_FLAG%
exit /b %ERRORLEVEL%
)
if defined BENCHMARK_FLAG (
"%PYTHON_EXE%" -m agent_system %BENCHMARK_FLAG% %BENCHMARK_OUTPUT_FLAG%
exit /b %ERRORLEVEL%
)
if "%~1"=="" (
echo Usage: run_cli.bat [--fast] "your task here"
echo Usage: run_cli.bat [--fast] [--session-dir sessions] "your task here"
echo Usage: run_cli.bat --doctor [--live] [--output report.md^|report.json]
echo Usage: run_cli.bat --benchmark [--output report.md^|report.json]
echo Example: run_cli.bat "Build a command-line todo app with unit tests"
echo Example: run_cli.bat --session-dir sessions "Build a command-line todo app with unit tests"
echo Example: run_cli.bat --fast "Write a minimal Python project for an Obsidian-style knowledge-base ingester"
echo Example: run_cli.bat --doctor --live --output reports\doctor.md
echo Example: run_cli.bat --benchmark --output reports\benchmarks.md
exit /b 1
)
"%PYTHON_EXE%" -m agent_system %FAST_FLAG% %SESSION_DIR_FLAG% --task %*
endlocal