File size: 5,287 Bytes
4aaae80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
@echo off
REM HearthNet App Manager - Windows Batch Menu
REM This script provides a menu to start, stop, configure, and manage the HearthNet app

setlocal enabledelayedexpansion
cls
title HearthNet App Manager

:main_menu
cls
echo.
echo ╔════════════════════════════════════════════════════════════════════╗
echo β•‘                   HearthNet App Manager (Windows)                  β•‘
echo β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
echo.
echo 1. Start HearthNet (CLI Mode)
echo 2. Start HearthNet (Gradio Web UI)
echo 3. Start Multi-Node Demo (2 nodes)
echo 4. Stop HearthNet (All instances)
echo.
echo 5. Install Dependencies
echo 6. Install Dev Dependencies
echo 7. Configure Settings
echo.
echo 8. Run Quality Checks
echo 9. Run Tests
echo A. Generate Screenshots
echo.
echo B. Open Logs
echo C. Open Documentation
echo.
echo 0. Exit
echo.
set /p choice="Select an option (0-C): "

if "%choice%"=="1" goto start_cli
if "%choice%"=="2" goto start_gradio
if "%choice%"=="3" goto start_demo
if "%choice%"=="4" goto stop_app
if "%choice%"=="5" goto install_deps
if "%choice%"=="6" goto install_dev
if "%choice%"=="7" goto configure
if "%choice%"=="8" goto quality_check
if "%choice%"=="9" goto run_tests
if "%choice%"=="A" goto gen_screenshots
if "%choice%"=="B" goto open_logs
if "%choice%"=="C" goto open_docs
if "%choice%"=="0" goto end
if "%choice%"=="a" goto gen_screenshots
if "%choice%"=="b" goto open_logs
if "%choice%"=="c" goto open_docs

echo.
echo ❌ Invalid option. Please try again.
timeout /t 2 /nobreak
goto main_menu

:start_cli
cls
echo.
echo πŸš€ Starting HearthNet (CLI Mode)...
echo.
python -m hearthnet.cli run
goto pause_and_menu

:start_gradio
cls
echo.
echo πŸš€ Starting HearthNet (Gradio Web UI)...
echo Opening http://localhost:7860 in your browser...
echo.
timeout /t 2 /nobreak
start http://localhost:7860 2>nul
python app.py
goto pause_and_menu

:start_demo
cls
echo.
echo πŸš€ Starting Multi-Node Demo (2 nodes)...
echo.
python scripts\demo_two_nodes.py
goto pause_and_menu

:stop_app
cls
echo.
echo πŸ›‘ Stopping HearthNet processes...
taskkill /F /IM python.exe /T 2>nul
if %errorlevel%==0 (
    echo βœ… HearthNet processes stopped.
) else (
    echo ℹ️  No HearthNet processes running.
)
timeout /t 2 /nobreak
goto main_menu

:install_deps
cls
echo.
echo πŸ“¦ Installing dependencies...
echo.
pip install -e .
if %errorlevel%==0 (
    echo.
    echo βœ… Dependencies installed successfully!
) else (
    echo.
    echo ❌ Failed to install dependencies.
)
timeout /t 3 /nobreak
goto main_menu

:install_dev
cls
echo.
echo πŸ“¦ Installing dev dependencies...
echo.
pip install -r requirements-dev.txt
if %errorlevel%==0 (
    echo.
    echo βœ… Dev dependencies installed successfully!
) else (
    echo.
    echo ❌ Failed to install dev dependencies.
)
timeout /t 3 /nobreak
goto main_menu

:configure
cls
echo.
echo βš™οΈ  Configuration Options
echo.
echo 1. Edit .env file
echo 2. Edit pyproject.toml
echo 3. View current config
echo 4. Reset to defaults
echo.
set /p config_choice="Select an option (1-4): "

if "%config_choice%"=="1" (
    if exist ".env" (
        notepad .env
    ) else (
        echo. > .env
        echo ℹ️  Created .env file. Please add your configuration.
        timeout /t 2 /nobreak
        notepad .env
    )
)
if "%config_choice%"=="2" notepad pyproject.toml
if "%config_choice%"=="3" type pyproject.toml | more
if "%config_choice%"=="4" (
    echo ℹ️  Resetting to defaults would require re-cloning the repo.
    timeout /t 2 /nobreak
)

goto main_menu

:quality_check
cls
echo.
echo πŸ” Running Quality Checks...
echo.
python scripts\check_quality.py
echo.
timeout /t 3 /nobreak
goto main_menu

:run_tests
cls
echo.
echo πŸ§ͺ Running Tests...
echo.
set /p test_choice="Run (1) All tests or (2) Specific test? "
if "%test_choice%"=="1" (
    pytest tests/ -v
) else if "%test_choice%"=="2" (
    echo.
    echo Available tests:
    dir /B tests\test_*.py
    echo.
    set /p test_file="Enter test file (e.g., test_e2e_user_stories.py): "
    pytest tests\!test_file! -v
)
echo.
timeout /t 3 /nobreak
goto main_menu

:gen_screenshots
cls
echo.
echo πŸ“Έ Generating Screenshots...
echo.
python scripts\gen_screenshots.py
if %errorlevel%==0 (
    echo.
    echo βœ… Screenshots generated!
    echo πŸ“ Location: docs\screenshots\
) else (
    echo.
    echo ⚠️  Screenshot generation completed with warnings.
)
timeout /t 3 /nobreak
goto main_menu

:open_logs
cls
echo.
echo πŸ“‹ Opening Logs...
echo.
if exist "logs" (
    explorer logs
) else (
    echo ℹ️  No logs directory found.
    timeout /t 2 /nobreak
)
goto main_menu

:open_docs
cls
echo.
echo πŸ“š Opening Documentation...
echo.
set /p doc_choice="Open (1) README or (2) HOWTO? "
if "%doc_choice%"=="1" start notepad README.md
if "%doc_choice%"=="2" start notepad docs\HOWTO.md
timeout /t 1 /nobreak
goto main_menu

:pause_and_menu
echo.
pause
goto main_menu

:end
cls
echo.
echo πŸ‘‹ Goodbye!
echo.
endlocal
exit /b 0