{"id":15029197,"url":"https://github.com/rreynaldo/baby","last_synced_at":"2026-03-16T21:32:35.868Z","repository":{"id":57047543,"uuid":"361922890","full_name":"rreynaldo/baby","owner":"rreynaldo","description":"Commander CLI micro-framework based on Symfony Console","archived":false,"fork":false,"pushed_at":"2021-05-25T04:52:04.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T21:48:42.695Z","etag":null,"topics":["cli","console","framework","microframework","php7","scheduler","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rreynaldo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-26T23:38:13.000Z","updated_at":"2022-08-11T16:58:12.000Z","dependencies_parsed_at":"2022-08-23T19:00:23.099Z","dependency_job_id":null,"html_url":"https://github.com/rreynaldo/baby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rreynaldo%2Fbaby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rreynaldo%2Fbaby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rreynaldo%2Fbaby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rreynaldo%2Fbaby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rreynaldo","download_url":"https://codeload.github.com/rreynaldo/baby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338571,"owners_count":20275530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","console","framework","microframework","php7","scheduler","symfony"],"created_at":"2024-09-24T20:09:56.512Z","updated_at":"2025-12-28T01:29:13.931Z","avatar_url":"https://github.com/rreynaldo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Baby: Commander CLI micro-framework based on Symfony Console (commands, schedules)\n\n[![Baby Logo](https://raw.githubusercontent.com/rreynaldo/baby/main/logo.png)](https://github.com/rreynaldo/baby)\n\n## Install\n\n\u003e composer require rreynaldo/baby\n\n## Script Usage (Similar to Silly): Commander\n\n```php\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\n$app = new Baby\\Application();\n$app-\u003ecommand('hello [name] [--yell]', function ($name, $yell, OutputInterface $output) {\n      if ($name) {\n          $text = 'Hello, '.$name;\n      } else {\n          $text = 'Hello';\n      }\n  \n      if ($yell) {\n          $text = strtoupper($text);\n      }\n  \n      $output-\u003ewriteln($text);\n  });\n$app-\u003erun();\n```\n\n## Running\n\nRunning the application is the same as running any other Symfony Console application:\n\n```bash\n$ php app.php hello\n$ php app.php hello john --yell\n$ php app.php hello --yell john\n```\n\n### Project Usage (Recommended user Baby Skeleton):\n\n```php\n\n\u003c?php\nuse App\\Commands\\AppTestCommand;\nuse App\\Schedules\\AppTestSchedule;\nuse Baby\\Application;\n\nrequire_once __DIR__ . '/vendor/autoload.php'; \ninclude_once(__DIR__ . '/app/config.php'); //Define Main config\n\n// Use Dependency injection (php/di)\n$container = new DI\\Container(); \n\n//Create APP\n$app = new Application($APP_NAME, $APP_VERSION); \n\n// User container\n$app-\u003euseContainer($container);  \n\n//Register Schedules (Schedules)\n$app-\u003eschedule(new AppTestSchedule($container));\n\n//Register commands (Standar Symfony Commands in your project)\n$app-\u003eadd(new AppTestCommand($container));\n\n //run App\n $app-\u003erun();\n```\n\n\n## Commands\n\n```php\n\n\u003c?php\n\nnamespace App\\Commands;\n\nuse Psr\\Container\\ContainerInterface;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\nclass AppTestCommand extends Command\n{\n  protected static $defaultName = 'app:test:command';\n  protected ContainerInterface $container;\n\n  /**\n   * AppTestCommand constructor.\n   */\n  public function __construct(ContainerInterface $container)\n  {\n    parent::__construct();\n    $this-\u003econtainer = $container;\n  }\n\n  protected function execute(InputInterface $input, OutputInterface $output): int\n  {\n    return Command::SUCCESS;\n  }\n}\n\n```\n\n## Schedules\n\n```php\n\u003c?php\n\nnamespace App\\Schedules;\n\nuse Baby\\Task\\AbstractScheduledTask;\nuse Baby\\Task\\Schedule;\nuse Psr\\Container\\ContainerInterface;\n\nclass AppTestSchedule extends AbstractScheduledTask\n{\n  protected ContainerInterface $container;\n\n  /**\n   * AppTestSchedule constructor.\n   */\n  public function __construct(ContainerInterface $container)\n  {\n    parent::__construct();\n    $this-\u003econtainer = $container;\n  }\n\n  protected function initialize(Schedule $schedule)\n  {\n    $schedule-\u003eeveryMinutes(1);\n  }\n\n  public function run()\n  {\n    print_r(\"everyMinutes\");\n  }\n}\n```\n\n## Available Commands\n\n```bash\nUsage:\n  command [options] [arguments]\n\nOptions:\n  -h, --help            Display help for the given command. When no command is given display help for the list command\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nAvailable commands:\n  help                  Display help for a command\n  list                  List commands\n app\n  app:test:command\n baby\n  baby:schedule-run     Run due tasks\n  baby:scheduler-list   List the existing schedules\n  baby:scheduler-start  Starts command scheduler\n  baby:scheduler-stop   Stops command scheduler\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frreynaldo%2Fbaby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frreynaldo%2Fbaby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frreynaldo%2Fbaby/lists"}