refs / sputnik
Modern PHP TaskRunner with class-based tasks, Nette DI, and template engine
Requires
- php: ^8.3
- nette/di: ^3.2
- nette/neon: ^3.4
- 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
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.0
- dev-fix/redact-across-escape-codes
- dev-feat/colour-through-the-pipe
- dev-feat/completion-and-quiet
- dev-fix/context-persists-after-listeners
- dev-feat/passthrough-tasks
- dev-feat/project-dir-anchor
- dev-fix/diagnostics-off-stdout
- dev-fix/working-dir-becomes-the-cwd
- dev-fix/shadow-notice-not-a-warning
- dev-fix/reserved-names-do-not-kill-the-cli
- dev-fix/missing-variables-are-errors
- dev-feat/env-dynamic
- dev-fix/context-variables-namespace
- dev-fix/validate-secrets-schema
- dev-feat/exec-cwd
- dev-feat/init-scaffold-on-main
- dev-docs/pre-0.2-drift
- dev-ci/harden-release
- dev-feat/init-scaffold
- dev-refactor/php-83-features-on-main
- dev-build/require-php-83
- dev-refactor/php-83-features
- dev-docs/claude-md
- dev-feat/output-channel-on-main
- dev-feature/argv-exec
- dev-feature/output-channel
- dev-docs/changelog-and-release-process
- dev-chore/dependabot-config
- dev-feature/secret-masking
- dev-ci/release-gate-and-pr-triggers
- dev-chore/gitignore-cleanup
- dev-feature/shared-template-renderer
This package is auto-updated.
Last update: 2026-09-23 05:23:36 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->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)
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
Secrets are variables Sputnik refuses to print. Declare one under variables.secrets and every value it takes is replaced with *** at the display boundary -- echoed commands, streamed output, log lines. Secrets
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