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 executing scripted tasks on remote servers. Define tasks in a Scotty.sh file (bash with annotations), run them with clear output, and use it as a drop-in, Envoy-compatible alternative for deploys and ops.

View on GitHub
Deep Wiki
Context7

A beautiful SSH task runner

Frequently asked questions about Scotty
How do I migrate from Laravel Envoy to Scotty without rewriting all my scripts?
Scotty is a drop-in replacement for Envoy. Your existing `@servers`, `@task`, and `@macro` annotations will work identically. Simply rename your `envoy.php` to `Scotty.sh` and update the shebang to `#!/usr/bin/env scotty`. Scotty supports all Envoy’s core syntax, so most scripts require zero changes.
Can Scotty handle Laravel-specific tasks like running `php artisan` commands on remote servers?
Yes, Scotty executes any SSH-accessible command, including `php artisan` tasks. Define them in your `Scotty.sh` file using `@task` annotations, and Scotty will run them on your remote servers with clear output. For example, `@task on:remote clearCache() { php artisan cache:clear }` works seamlessly.
What Laravel versions does Scotty support, and does it require Laravel-specific dependencies?
Scotty is framework-agnostic and works with any Laravel version (5.5+ recommended) or non-Laravel PHP apps. It has no Laravel dependencies—only SSH access to your servers. However, it integrates with Laravel’s `.env` variables via `@env` annotations (e.g., `@env APP_URL=${APP_URL}`) for dynamic configurations.
How do I secure SSH credentials for Scotty in CI/CD pipelines like GitHub Actions?
Use SSH agent forwarding or deploy keys. In GitHub Actions, add your private key to `secrets` and configure `GITHUB_SSH_KEY` in your workflow. Scotty respects your `~/.ssh/config` or environment variables for host definitions. Never hardcode credentials in `Scotty.sh`—use `@servers` with SSH config paths or dynamic variables.
Does Scotty support parallel task execution or conditional logic in Bash scripts?
Scotty runs tasks sequentially by default, but you can use Bash’s native parallelism (e.g., `&` or `xargs`) inside `@task` functions. For complex conditionals, leverage Bash’s `if-else` or `case` statements. Scotty doesn’t enforce a DSL, so you retain full Bash flexibility—though advanced logic may require custom scripting outside Scotty’s annotations.
How can I debug failed Scotty tasks or capture logs for auditing?
Use `scotty run --verbose` to see detailed SSH output. For auditing, redirect stdout to a file (e.g., `scotty run deploy > deploy.log`) or pipe output to a logging service. Scotty doesn’t persist state, so integrate with tools like Laravel Horizon or custom scripts to archive logs or track task history.
What are the alternatives to Scotty for Laravel deployments, and why choose Scotty?
Alternatives include Laravel Envoy (legacy), Deployer (PHP-based), or custom SSH scripts. Scotty stands out for its Envoy-compatible syntax, Bash simplicity, and clear output. Unlike Deployer, it avoids PHP dependencies, and unlike raw SSH, it handles connections and error formatting automatically. It’s ideal for teams already using Envoy or needing a lightweight, annotation-driven solution.
Can Scotty manage multi-server deployments with different environments (e.g., staging vs. production)?
Yes, define multiple `@servers` groups in `Scotty.sh` and target them with `@task on:group`. For environment-specific logic, use `@env` annotations to inject `.env` variables or conditionally include tasks. Example: `@servers staging=staging@example.com production=prod@example.com` with `@task on:production` for prod-only steps.
How do I test Scotty tasks locally before deploying to production?
Scotty doesn’t mock SSH, but you can test tasks in a staging environment or use Docker to simulate remote servers. For unit testing, extract Bash logic into functions and test them in isolation. Use `scotty run --dry-run` (if supported) to validate syntax, or manually verify `Scotty.sh` in a controlled environment before production.
What’s the performance impact of using Scotty for large-scale deployments with many servers?
Scotty’s performance depends on SSH latency and server load. For parallel execution, use Bash’s `&` or external tools like GNU Parallel. Scotty itself adds minimal overhead—it’s optimized for clarity over speed. Test with your server count in staging, and consider batching tasks if SSH connections become a bottleneck.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport