@@ -21,11 +21,13 @@ A production-ready Raw PHP REST API Starter Kit with JWT authentication, user ma
2121- ✅ ** PHPUnit Testing** - Comprehensive test suite
2222- ✅ ** API Documentation** - Complete endpoint docs
2323- ✅ ** Debug Bar** - Development debugging toolbar with performance monitoring
24+ - ✅ ** CLI Support** - Command-line interface for development tasks
2425
2526## 📁 Project Structure
2627
2728```
2829├── app/
30+ │ ├── cli/ # CLI commands and console
2931│ ├── config/ # Configuration files
3032│ ├── controllers/ # Request handlers
3133│ ├── core/ # Core framework classes
@@ -38,6 +40,7 @@ A production-ready Raw PHP REST API Starter Kit with JWT authentication, user ma
3840│ ├── routes/ # Route definitions
3941│ ├── services/ # Business logic
4042│ └── tests/ # Test files
43+ ├── console # CLI entry point
4144├── bootstrap/ # Application bootstrap
4245├── docs/ # API documentation
4346├── public/ # Web server document root
@@ -78,22 +81,25 @@ php migrate.php fresh # Creates database, runs migrations and seeders
7881
7982#### Migration Commands
8083``` bash
81- # Run migrations only
82- php migrate.php migrate
84+ # Using CLI (recommended)
85+ php console migrate
86+ php console migrate seed
87+ php console migrate rollback
88+ php console migrate fresh
8389
84- # Run seeders only
90+ # Or legacy commands
91+ php migrate.php migrate
8592php migrate.php seed
86-
87- # Rollback all migrations
8893php migrate.php rollback
89-
90- # Fresh migration (rollback + migrate + seed)
9194php migrate.php fresh
9295```
9396
9497### 4. Start Development Server
9598``` bash
96- # PHP Built-in Server
99+ # Using CLI command (recommended)
100+ php console serve
101+
102+ # Or PHP Built-in Server
97103php -S localhost:8000 -t public
98104
99105# Or with Docker
@@ -253,6 +259,55 @@ timer_stop('api_call');
253259### Test Debug Bar
254260Visit ` http://localhost:8000/welcome ` to see the debug bar in action.
255261
262+ ## 💻 CLI Support
263+
264+ The framework includes a powerful command-line interface for development tasks.
265+
266+ ### Available Commands
267+
268+ ``` bash
269+ # Start development server
270+ php console serve [host] [port]
271+
272+ # Database migrations
273+ php console migrate [fresh| rollback| seed]
274+
275+ # Run tests
276+ php console test [specific-test-file]
277+
278+ # Cache management
279+ php console cache clear
280+
281+ # Generate files
282+ php console make controller ControllerName
283+ php console make model ModelName
284+
285+ # Show help
286+ php console help
287+ ```
288+
289+ ### Usage Examples
290+
291+ ``` bash
292+ # Start server on custom host/port
293+ php console serve localhost 8080
294+
295+ # Fresh migration with seeders
296+ php console migrate fresh
297+
298+ # Generate a new controller
299+ php console make controller ProductController
300+
301+ # Generate a new model
302+ php console make model Product
303+
304+ # Run specific test
305+ php console test app/tests/Unit/UserTest.php
306+
307+ # Clear application cache
308+ php console cache clear
309+ ```
310+
256311## 🧪 Testing
257312
258313``` bash
0 commit comments