A bash-based adapter that translates Laravel Sail commands to work with Spin. Includes smart project detection and conflict-free alias management.
- Smart Project Detection: Automatically detects Spin projects by checking for
.infrastructure/directory - Command Translation: Maps all Laravel Sail commands to their Spin equivalents
- Alias Management: Safely switches between Laravel Sail and Spin without conflicts
- Zero Configuration: Works out of the box with any Spin project
curl -fsSL https://raw.githubusercontent.com/rodrigofs/sail-spin-adapter/main/install.sh | bashAfter installation:
sail-manager activate # Use Spin adapter# Navigate to any project and auto-detect:
cd ~/projects/my-spin-project
sail-manager auto # Automatically activates Spin adapter
sail up -d # Uses Spin commands
cd ~/projects/my-laravel-project
sail-manager auto # Automatically switches to Laravel Sail
sail up -d # Uses Laravel SailThe adapter automatically detects project type:
Spin Projects (detected by):
.infrastructure/directory
Laravel Sail Projects (detected by):
vendor/bin/sailfilelaravel.testin docker-compose files
sail-manager auto # Auto-detect and switch (recommended)
sail-manager status # Check current mode and project type
sail-manager activate # Force Spin adapter
sail-manager deactivate # Force Laravel Sail
sail-manager update # Update adapterThe manager works by switching shell aliases:
- Laravel Sail:
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)' - Spin Adapter:
alias sail='~/.sail-spin-adapter/sail-spin'
The adapter script translates Sail commands to Spin equivalents automatically.
sail up -d # Start containers
sail down # Stop containers
sail ps # List containers
sail logs # View logssail art migrate # Run migrations
sail art make:controller # Create controller
sail composer install # Install PHP dependencies
sail tinker # Laravel tinker
sail test # Run tests
sail php -v # Check PHP versionsail npm run dev # Start Vite dev server
sail npm install # Install Node packages
sail yarn add pkg # Add package with Yarnsail mysql # Connect to MySQL
sail postgres # Connect to PostgreSQL
sail redis # Redis CLIsail bash # Access PHP container
sail exec php bash # Custom exec commandsThe adapter translates commands automatically:
| Laravel Sail Command | Spin Equivalent |
|---|---|
sail up -d |
spin up -d |
sail art migrate |
spin exec php php artisan migrate |
sail composer install |
spin exec php composer install |
sail npm run dev |
spin run node npm run dev |
sail mysql |
spin exec mysql mysql -u root -p |
sail bash |
spin exec php bash |
- Spin: Must be installed and available in PATH
- curl: For installation and updates
- bash: Shell environment
sudo rm /usr/local/bin/sail-manager
rm -rf ~/.sail-spin-adapter
# Remove aliases from shell profile manually⭐ Give us a star if this project helped you!