Skip to content

PHP task automation with actual structure

Sputnik

A PHP TaskRunner that lets you define project automation as clean, testable PHP classes. No YAML, no DSL -- just normal code with attributes.

Define tasks with options, arguments, and shell execution. Switch contexts for different environments. Route commands transparently between host and container. Distribute as a single PHAR file.

Get Started Installation GitHub

PHAR-first Context-aware Container routing PHP 8.3+

$ php sputnik.phar deploy

๐Ÿ›ฐ  Sputnik v0.2.0 โ”‚ .sputnik.dist.neon โ”‚ prod

โ–ธ deploy ยท Deploy the application

  > rsync -avz ./dist/ /var/www/
  > php artisan migrate --force
โœ“ Done (1.24s)
  • Normal PHP


    Tasks are plain PHP classes. No YAML workflow language, no custom mini-language, no "magic function dump".

  • Project state built in


    Contexts, variables, templates, listeners, and runtime state are part of the model instead of ad-hoc shell conventions.

  • CLI that matches real work


    Designed for project builds, deploys, Docker workflows, context switching, and repeatable local automation.

#[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->exec(['php', 'artisan', 'migrate', '--force']);

        return TaskResult::success();
    }
}
$ php sputnik.phar deploy

๐Ÿ›ฐ  Sputnik v0.2.0 โ”‚ .sputnik.dist.neon โ”‚ prod

โ–ธ deploy ยท Deploy the application

  > rsync -avz ./dist/ /var/www/app/
  > php artisan migrate --force
โœ“ Done (1.24s)

Why teams pick Sputnik

  • Tasks


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

    Writing Tasks

  • Contexts


    Named configurations with variable overrides. Switch with one command, no code changes.

    Contexts

  • Templates


    Render files with {{ variable }} syntax. Re-rendered automatically on context switch.

    Templates

  • Secrets


    Variables Sputnik refuses to print. Masked in echoed commands, streamed output and log lines.

    Secrets

  • Environments


    Transparent command routing between host and container via configurable executor.

    Environments

Start here

  • Quick Start


    Initialize a project and run your first task in under a minute.

    Quick Start

  • Recipes


    Practical patterns for builds, deploys, Docker, templates, and more.

    Recipes

  • CLI Reference


    All commands, flags, and reserved names.

    CLI Reference

  • Releases


    Release notes and PHAR downloads.

    GitHub Releases

Fits best when

  • You want structure, not scripts everywhere


    Shell snippets still exist, but they live inside typed PHP tasks with explicit options, arguments, and metadata.

  • You switch between dev, staging, and production a lot


    Contexts and template regeneration make environment changes explicit instead of buried in copied commands.

  • You need one distributable binary


    PHAR distribution keeps execution simple for teams and CI while Composer remains optional for editor support.