This document outlines the development setup and conventions for contributing to Skipper.
Skipper is a PHP CLI tool built with Symfony components:
symfony/console- Manages CLI commands and interactionssymfony/process- Handles system process executionsrc/- Contains the main source codebin/skipper- Main executable
Commands are organized following the Symfony Console component patterns:
- Each command extends
BaseCommandwhich provides utility functions - Commands are registered in
CliApplicationclass - Commands follow a namespace structure (e.g.
proxy:certs,proxy:reload)
Example of a new command:
namespace Tiknil\Skipper\Command;
class ExampleCommand extends BaseCommand
{
protected static $defaultName = 'example:command';
protected function configure()
{
$this->setDescription('Example command description');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
// Command logic here
return Command::SUCCESS;
}
}System commands are executed using the ShellCommand utility class which provides:
- Safe process execution with error handling
- Environment variable management
- Docker compose command wrapping
- Output streaming
Example usage:
use Tiknil\Skipper\Utility\ShellCommand;
ShellCommand::create()->run(['ls', '-ls']);
// Hide command outputs
ShellCommand::create()->showOutput(false)->run(['ls', '-ls']);
// Runs in tty mode
ShellCommand::create()->useTty(true)->run(['ls', '-ls']);
// Use shell integration
ShellCommand::create()->useShellIntegration(true)->run(['cat', 'file.txt', '>', 'other-file.txt']);- Clone the repository
- Install dependencies:
composer install- Link for local development:
# Add to your global composer.json
{
"repositories": [
{
"type": "path",
"url": "/path/to/skipper"
}
]
}# Install locally
composer global require tiknil/skipper