Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Scotty Laravel Package

spatie/scotty

Scotty is a beautiful SSH task runner for running scripted tasks on remote servers. Define tasks and macros in a simple Scotty.sh (bash + annotations), then run them with clear output. Fully compatible with Laravel Envoy as a drop-in replacement.

View on GitHub
Deep Wiki
Context7

A beautiful SSH task runner

Frequently asked questions about Scotty
Can Scotty replace Laravel Envoy in my existing project with zero code changes?
Yes, Scotty is fully compatible with Laravel Envoy’s annotation syntax (@servers, @task, @macro). Your existing Envoy scripts will work unchanged in Scotty.sh files. Simply rename your recipes and update the runner command from `envoy run` to `scotty run`.
How do I install Scotty in a Laravel project without bloating dependencies?
Scotty ships as a standalone PHAR file—no Composer package required. Download it once with `curl -L https://github.com/spatie/scotty/releases/latest/download/scotty -o scotty`, make it executable (`chmod +x scotty`), and place it in your project root. For global use, install via `composer global require spatie/scotty`.
What Laravel versions does Scotty support, and does it require Laravel-specific code?
Scotty is Laravel-agnostic and works with any PHP project. It’s designed as a drop-in replacement for Envoy, which is Laravel-native, so it integrates seamlessly with Laravel’s Artisan commands, Composer scripts, and CI/CD pipelines. No Laravel-specific code is needed in your Scotty.sh files.
How do I handle SSH key permissions or connection issues when running Scotty in CI?
Scotty relies on your existing SSH configuration (~/.ssh/config). For CI, ensure SSH keys are added as secrets and configured in your CI tool (e.g., GitHub Actions uses `ssh-agent`). Test connections with `scotty doctor` locally before deploying. Use environment variables for dynamic server options if needed.
Can Scotty run tasks in parallel across multiple servers, or is it sequential?
Scotty executes tasks sequentially by default, but you can define macros to group dependent tasks. For parallelism, use the `--parallel` flag (e.g., `scotty run --parallel deploy`). Note that this requires SSH access to all servers from your deployment machine, and output may interleave unless tasks are idempotent.
What’s the difference between Scotty.sh and the deprecated Blade format for Envoy?
Scotty.sh uses plain Bash syntax with annotation comments (e.g., `# @task`), while Envoy’s Blade format mixes PHP and Blade templates. Scotty.sh is more maintainable for SSH tasks, as it avoids PHP dependencies and runs natively on remote servers. Migrate legacy Blade scripts by rewriting them in Bash with Scotty’s annotations.
How do I debug Scotty tasks before running them in production?
Use the `--pretend` flag to simulate task execution without making changes (e.g., `scotty run --pretend deploy`). Scotty also provides detailed output for each step, including errors. For complex setups, test locally with `scotty doctor` to validate SSH and Bash compatibility.
Can Scotty integrate with Laravel Forge or other server management tools?
Yes, Scotty works alongside Laravel Forge or other tools since it uses SSH under the hood. Forge’s server details (IPs, SSH keys) can be referenced in your `~/.ssh/config` or passed dynamically via environment variables. Scotty doesn’t replace Forge but automates repetitive SSH tasks like deployments or maintenance.
What alternatives to Scotty exist for Laravel SSH automation, and why choose Scotty?
Alternatives include Laravel Envoy (deprecated), Deployer (PHP-based), or custom Bash scripts. Scotty stands out for its Envoy-compatible syntax, minimal setup (no Composer dependencies), and focus on readability with clear output. It’s ideal for teams already using Envoy or needing a lightweight, annotation-driven solution.
How do I secure Scotty in production, especially when handling sensitive tasks like database migrations?
Scotty inherits SSH security—ensure keys are restricted to specific IPs and users. For sensitive tasks, use environment variables for dynamic inputs (e.g., `scotty run --env=production deploy`) and avoid hardcoding secrets in Scotty.sh files. Combine with Laravel’s `.env` for additional security layers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai