-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-cli.bat
More file actions
59 lines (49 loc) · 1.5 KB
/
start-cli.bat
File metadata and controls
59 lines (49 loc) · 1.5 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
@echo off
setlocal
cd /d "%~dp0"
REM ?????
REM 1. ????????????????? CMD ?????????????
REM 2. ???????????????????? activate?
REM 3. ?????? Python ??/????????? CLI ??????????
REM 4. ??????????? example.config.json ????? .codingclaw\config.json?
REM 5. ?????? CLI??????????? Python ???
set "VENV_PY=.venv\Scripts\python.exe"
set "DEFAULT_HOME=.codingclaw"
set "DEFAULT_CONFIG=%DEFAULT_HOME%\config.json"
if not exist "%VENV_PY%" (
echo [setup] Creating virtual environment...
python -m venv .venv
if errorlevel 1 (
echo [error] Failed to create .venv. Make sure Python is installed and on PATH.
exit /b 1
)
)
echo [setup] Upgrading pip...
"%VENV_PY%" -m pip install --upgrade pip >nul
if errorlevel 1 (
echo [error] Failed to upgrade pip inside .venv.
exit /b 1
)
echo [setup] Installing project dependencies...
"%VENV_PY%" -m pip install -e .
if errorlevel 1 (
echo [error] Failed to install project in editable mode.
exit /b 1
)
if not exist "%DEFAULT_HOME%" (
echo [setup] Creating local data directory...
mkdir "%DEFAULT_HOME%"
)
if not exist "%DEFAULT_CONFIG%" (
echo [setup] Creating default config from example.config.json...
copy /Y "example.config.json" "%DEFAULT_CONFIG%" >nul
)
if "%CODINGCLAW_API_KEY%"=="" (
echo [hint] CODINGCLAW_API_KEY is not set. Configure it in your environment or edit %DEFAULT_CONFIG% if the provider requires it.
)
echo [run] Starting CodingClaw CLI...
"%VENV_PY%" -m app.interfaces.cli.main %*
set "EXIT_CODE=%ERRORLEVEL%"
echo.
pause
exit /b %EXIT_CODE%