spatie/scotty
Scotty is a beautiful SSH task runner. Define tasks in a Scotty.sh file (bash with annotations) and run them on remote servers over SSH with clear, readable output. Compatible with Laravel Envoy, so you can use it as a drop-in replacement.
@macro deploy pullCode runComposer) aligns well with Laravel’s Artisan task chaining and service provider bootstrapping, enabling seamless integration into existing Laravel workflows.envoy:run with scotty run deploy in artisan commands or CI scripts.homestead/valet provisioning or forge server tasks.~/.ssh/config) for complex auth (e.g., jump hosts, key-based auth).vendor/ directory.~/.ssh/config) for multi-server setups.scotty doctor for validation).source) for dynamic paths.--continue flag or wrap Scotty calls in CI scripts with set +e.scotty run deploy > deploy.log) or use --pretend for dry runs.scotty doctor be integrated into pre-deploy checks?logs/deploy.log or a third-party tool like Sentry)?envoy:run with Scotty for SSH-based deployments (e.g., scotty run deploy in artisan or CI).@servers annotations.scotty run deploy --branch=${{ github.ref_name }}).deploy.sh script to Scotty.sh.scotty --pretend to validate scripts before live runs.scotty run instead of raw SSH.@macro deploy instead of @setup).artisan command (e.g., php artisan scotty:run) to wrap Scotty calls.composer install and php artisan cache:clear in a Scotty.sh file.scotty doctor to validate SSH connectivity.scotty tasks to list available macros.scotty run deploy --branch=main (with --continue for CI).scotty run verify (custom macro).scotty run rollback if needed.Scotty.sh files live in the repo, ensuring team alignment.vendor/ bloat.~/.ssh/config) if used.Scotty.sh template for new projects (e.g., Laravel starter kits).@option, @macro, @task).scotty --pretend to simulate runs without side effects.@servers annotation supports parallel task execution (e.g., deploy to multiple web servers).@servers web-1=..., web-2=... with @task on:web-1,web-2.& in Bash).scotty run deploy to admins).| Failure Type | Impact | Mitigation |
|---|---|---|
| SSH Connection Failure | Deployments blocked | Use scotty doctor in pre-deploy checks. |
| Task Failure | Partial deployments | Use --continue in |
How can I help you explore Laravel packages today?