refs / sputnik
Modern PHP TaskRunner with class-based tasks, Nette DI, and template engine
Requires
- php: ^8.2
- nette/di: ^3.2
- nette/neon: ^3.4
- nette/utils: ^4.0
- psr/container: ^2.0
- psr/log: ^3.0
- symfony/console: ^7.0
- symfony/event-dispatcher: ^7.0
- symfony/process: ^7.0
Requires (Dev)
- dg/bypass-finals: ^1.9
- friendsofphp/php-cs-fixer: ^3.94
- humbug/box: ^4.7
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.3
- symfony/var-dumper: ^7.0
This package is auto-updated.
Last update: 2026-04-08 05:26:06 UTC
README
A PHP TaskRunner for project automation. Class-based tasks, context switching, environment-aware execution.
What it does
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(); } }
$ php sputnik.phar deploy
Sputnik 0.1.0 │ .sputnik.dist.neon │ prod
▸ deploy · Deploy the application
> rsync -avz ./dist/ /var/www/app/
> php artisan migrate --force
✓ Done (1.24s)
Install
PHAR (recommended)
curl -Lo sputnik.phar https://github.com/refsz/sputnik/releases/latest/download/sputnik.phar chmod +x sputnik.phar php sputnik.phar init
Verify the download:
curl -Lo sputnik.phar.sha256 https://github.com/refsz/sputnik/releases/latest/download/sputnik.phar.sha256 sha256sum -c sputnik.phar.sha256
For IDE autocompletion you can additionally install via Composer: composer require --dev refs/sputnik. See Installation for details.
Key concepts
Tasks are PHP classes with #[Task] attributes. Options, arguments, and shell execution are built in. Writing Tasks
Contexts let you define named configurations -- different variables, different behavior. Switch with one command, no code changes. Contexts
Templates render files like .env with {{ variable }} syntax. Re-rendered automatically on context switch. Templates
Environments route commands transparently between host and container. A task marked environment: 'container' is automatically wrapped with your Docker executor. Environments
Links
- Documentation -- full docs, recipes, CLI reference
- Releases -- release notes and downloads
- Contributing -- development setup
- Security -- reporting vulnerabilities
- License -- MIT