Development Guide
This guide helps you contribute to Laravel Dev CLI or extend it for your needs.
Project Structure
laravel-dev-cli/
├── bin/
│ └── laravel-dev # CLI entry point
├── src/
│ ├── Console/
│ │ ├── Application.php # Symfony Console app
│ │ └── Commands/ # CLI commands
│ ├── Services/ # Business logic
│ ├── Domain/ # Domain models
│ └── Support/ # Utilities
├── tests/ # Test suite
└── pages/ # VitePress documentationDevelopment Setup
Requirements
- PHP 8.2+
- Composer
- Node.js 18+ (for documentation)
- Pest PHP (testing framework)
Installation
Clone the repository:
bash
git clone https://github.com/x-multibyte/laravel-dev-cli.git
cd laravel-dev-cli
composer installRunning Tests
Run the full test suite:
bash
composer testRun specific test files:
bash
./vendor/bin/pest tests/Unit/Console/ApplicationTest.phpBuilding Documentation
Build the documentation site:
bash
cd pages
npm install
npm run buildPreview documentation locally:
bash
npm run devArchitecture
Console Layer
Built on Symfony Console, provides the CLI interface:
Application.php: Main application entry pointCommands/: Individual command implementations
Service Layer
Business logic and external integrations:
PresetService: Manages preset operationsSkillInstaller: Handles AI agent skill installationAIDetector: Detects installed AI platformsDocsService: Documentation query handling
Domain Layer
Core business models:
Preset: Laravel preset representationAIPlatform: AI platform metadataLaravelVersion: Version compatibility
Support Layer
Utility classes:
Filesystem: File operationsHttpClient: HTTP requests
Adding Commands
Create a new command:
bash
php bin/console make:command MyCommandRegister in src/Console/Application.php:
php
$app->add(new MyCommand());Adding Presets
Create a new preset configuration:
- Add to
resources/presets/ - Follow the preset schema
- Update
PresetServiceto include it
Adding AI Platform Support
- Create platform detector in
AIDetector - Add skill installer logic in
SkillInstaller - Update
AIPlatformdomain model - Add tests for the new platform
Coding Standards
- Follow PSR-12 coding standard
- Use type hints for all methods
- Write tests for new features
- Update documentation for user-facing changes
Submitting Changes
- Fork the repository
- Create a feature branch
- Make your changes
- Add/update tests
- Submit a pull request
License
By contributing, you agree that your contributions will be licensed under the MIT License.