rreynaldo / baby-cli
Baby Starter Project
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rreynaldo/baby-cli
Requires
- monolog/monolog: ^2.2
- php-di/php-di: ^6.3
- rreynaldo/baby: dev-main
This package is auto-updated.
Last update: 2025-10-09 05:30:38 UTC
README
Install
composer create-project rreynaldo/baby-cli:dev-main my_project_name
Create your first Command in folder src/Commands
<?php
namespace App\Commands;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\OutputInterface;
class AppTestCommand extends Command
{
protected static $defaultName = 'app:test:command';
protected ContainerInterface $container;
/**
* AppTestCommand constructor.
*/
public function __construct(ContainerInterface $container)
{
parent::__construct();
$this->container = $container;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->container->get('console-logger')->info('Running');
return Command::SUCCESS;
}
}
Create your first Scheluder in folder src/Schedules
<?php
namespace App\Commands;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\OutputInterface;
class AppTestCommand extends Command
{
protected static $defaultName = 'app:test:command';
protected ContainerInterface $container;
/**
* AppTestCommand constructor.
*/
public function __construct(ContainerInterface $container)
{
parent::__construct();
$this->container = $container;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->container->get('console-logger')->info('Running');
return Command::SUCCESS;
}
}