Skip to content

Sputnik

A PHP TaskRunner for project automation. Class-based tasks, context switching, environment-aware execution.


Sputnik runs tasks defined as PHP classes. Each task is a single class with attributes -- no YAML actions, no function dumps, no DSL. You write normal PHP, Sputnik handles discovery, CLI, contexts, and shell routing.

#[Task(name: 'deploy', description: 'Deploy the application', environment: 'container')]
final class DeployTask implements TaskInterface
{
    public function __invoke(TaskContext $ctx): TaskResult
    {
        $ctx->shell('rsync -avz ./dist/ {{ deployPath }}/');
        $ctx->shellRaw('php artisan migrate --force');

        return TaskResult::success();
    }
}

Get started

  • :material-download: Installation -- PHAR download or Composer
  • :material-rocket-launch: Quick Start -- init a project, run your first task
  • :material-book-open-variant: Recipes -- practical patterns for common use cases
  • :material-console: CLI Reference -- all commands and flags

Key concepts

Tasks are PHP classes with #[Task] attributes. Options, arguments, and shell execution are built in.

Contexts let you define named configurations -- different variables, different behavior. Switch with one command, no code changes.

Templates render files like .env with {{ variable }} syntax. Re-rendered automatically on context switch.

Environments route commands transparently between host and container. A task marked environment: 'container' is automatically wrapped with your Docker executor.

Release Notes

Changes are documented in GitHub Releases.