CLI Usage¶
The Tusk CLI provides commands for scaffolding and running applications.
Commands¶
init - Create New Project¶
php tusk.phar init <name> [--type=api|micro]
Arguments:
- name - Project name (required)
Options:
- --type - Project type: api (default) or micro
Example:
php tusk.phar init my-api
cd my-api
composer install
run - Run Application¶
php tusk.phar run <file>
Arguments:
- file - Entry point file (e.g., public/index.php)
Example:
php tusk.phar run public/index.php
Server starts on http://localhost:8080
Building the PHAR¶
To build tusk.phar from source:
cd tusk-framework
php -d phar.readonly=0 tusk-framework/scripts/build_cli.php
Output: build/tusk.phar
Development Workflow¶
- Scaffold:
tusk init my-app - Develop: Edit controllers, services
- Test:
tusk run public/index.php - Deploy: Use Docker Compose or native server
Tips¶
- Use
--type=microfor microservice projects (includes health checks) - The generated
docker-compose.ymlincludes MySQL by default - Edit
composer.jsonto add dependencies