Quick Start¶
Initialize a project¶
This creates:
.sputnik.dist.neon-- your project configurationsputnik/ExampleTask.php-- a sample task to get started
Run the example task¶
Sputnik 0.1.0 │ .sputnik.dist.neon │ local
▸ example · An example task to get you started
Hello, World!
✓ Done (0.00s)
Greeted World
Create your own task¶
Create a PHP file in your task directory (default: sputnik/):
<?php
declare(strict_types=1);
use Sputnik\Attribute\Task;
use Sputnik\Task\TaskContext;
use Sputnik\Task\TaskInterface;
use Sputnik\Task\TaskResult;
#[Task(
name: 'greet',
description: 'Say hello',
)]
final class GreetTask implements TaskInterface
{
public function __invoke(TaskContext $ctx): TaskResult
{
$ctx->shellRaw('echo "Hello from Sputnik!"');
return TaskResult::success();
}
}
Run it:
Next steps¶
- Configuration Reference -- configure contexts, variables, templates
- Writing Tasks -- options, arguments, shell execution, sub-tasks
- Variables -- dynamic variables, runtime overrides
- Templates -- file templating with variable substitution
- Recipes -- practical examples for common use cases
- CLI Reference -- all commands and flags