# Scotty

An SSH task runner from Spatie that lets you define deployment scripts as plain bash functions and run them on remote servers with real-time output. Spiritual successor to Laravel Envoy, rebuilt from scratch.

**How it works:** you write a `Scotty.sh` file with annotated bash functions. Each function is a task, annotations specify which server to run on. Scotty parses the file, SSHs into the server, and streams output back with step counters and timing.

```bash
#!/usr/bin/env scotty
# @servers remote=deployer@your-server.com
# @task on:remote
deploy() {
    cd /var/www/my-app
    git pull origin main
    php artisan migrate --force
}
```

```sh
scotty run deploy
```

**What makes it nice:**
- Plain bash syntax (not Blade templates) — you get real shell highlighting and full bash compatibility
- Real-time display: task name, step counter, elapsed time, current command
- Summary table after completion showing timing per step
- Press `p` to pause mid-deploy, verify on the server, then resume or cancel
- `--pretend` mode shows commands without executing
- `--summary` mode hides output, shows only results
- `scotty doctor` validates file parsing, SSH connectivity, and remote tool availability
- Reads existing `Envoy.blade.php` files for backward compatibility

**Limitations:** PHP-based, so requires PHP runtime. Focused on the Laravel/PHP deployment world, though the bash task format works for anything.

**Repo:** https://github.com/spatie/scotty — 162 stars.
