{"id":33974926,"url":"https://github.com/phpnomad/symfony-console-integration","last_synced_at":"2026-05-31T02:31:26.079Z","repository":{"id":288330806,"uuid":"967680005","full_name":"phpnomad/symfony-console-integration","owner":"phpnomad","description":"Symfony Console integration for building nomadic CLI commands in PHPNomad","archived":false,"fork":false,"pushed_at":"2026-05-26T17:34:35.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-26T19:18:15.958Z","etag":null,"topics":["cli","console","framework","integration","php","phpnomad","platform-agnostic","symfony"],"latest_commit_sha":null,"homepage":"https://phpnomad.com","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/phpnomad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-16T20:39:23.000Z","updated_at":"2026-05-26T17:34:51.000Z","dependencies_parsed_at":"2025-04-17T08:51:04.685Z","dependency_job_id":"d789d86d-1356-4e36-9501-a4c5630f51e1","html_url":"https://github.com/phpnomad/symfony-console-integration","commit_stats":null,"previous_names":["phpnomad/symfony-console-integration"],"tags_count":5,"template":false,"template_full_name":"phpnomad/repository-template","purl":"pkg:github/phpnomad/symfony-console-integration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Fsymfony-console-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Fsymfony-console-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Fsymfony-console-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Fsymfony-console-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpnomad","download_url":"https://codeload.github.com/phpnomad/symfony-console-integration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Fsymfony-console-integration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33717415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","integration","php","phpnomad","platform-agnostic","symfony"],"created_at":"2025-12-13T01:56:56.202Z","updated_at":"2026-05-31T02:31:26.073Z","avatar_url":"https://github.com/phpnomad.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpnomad/symfony-console-integration\n\n[![Latest Version](https://img.shields.io/packagist/v/phpnomad/symfony-console-integration.svg)](https://packagist.org/packages/phpnomad/symfony-console-integration)\n[![Total Downloads](https://img.shields.io/packagist/dt/phpnomad/symfony-console-integration.svg)](https://packagist.org/packages/phpnomad/symfony-console-integration)\n[![PHP Version](https://img.shields.io/packagist/php-v/phpnomad/symfony-console-integration.svg)](https://packagist.org/packages/phpnomad/symfony-console-integration)\n[![License](https://img.shields.io/packagist/l/phpnomad/symfony-console-integration.svg)](https://packagist.org/packages/phpnomad/symfony-console-integration)\n\nIntegrates [Symfony Console](https://symfony.com/doc/current/components/console.html) with PHPNomad's console abstraction. Your commands implement `phpnomad/console`'s `Command` interface and declare their arguments through PHPNomad's signature syntax. This package parses those signatures, registers the commands with a Symfony `Application`, and runs `handle()` through any declared middleware and interceptors. Your command classes never reference Symfony directly.\n\n## Installation\n\n```bash\ncomposer require phpnomad/symfony-console-integration\n```\n\n## What This Provides\n\n- `ConsoleStrategy` parses a PHPNomad signature into Symfony `InputArgument` and `InputOption` definitions, wraps the command in an anonymous Symfony `Command` subclass, and runs `handle()` through any `HasMiddleware` and `HasInterceptors` hooks. `ConsoleException` failures are logged via `LoggerStrategy` and surfaced through `OutputStrategy::error()` with exit code 1.\n- `ConsoleOutputStrategy` maps `writeln`, `info`, `success`, `warning`, `error`, `newline`, and `table` onto a Symfony `OutputInterface` with blue, green, yellow, and red formatter styles.\n- `Input` wraps a Symfony `InputInterface` behind PHPNomad's `Input` contract, with an override map so middleware can mutate values without touching the Symfony request.\n- `Initializer` is a `phpnomad/loader` initializer that binds the strategies to their PHPNomad interfaces and provides a singleton Symfony `OutputInterface` (a `ConsoleOutput` with the default formatter).\n\n## Requirements\n\n- `phpnomad/console`, the contract this package implements\n- `symfony/console` ^7.2, the library this package bridges\n- `phpnomad/logger` for exception logging inside the command wrapper\n- `phpnomad/utils` and `phpnomad/loader` for bootstrapping\n\n## Usage\n\nBind a Symfony `Application` into your container, pass this package's `Initializer` to your `Bootstrapper` alongside any initializer that declares commands via `HasCommands`, then call `run()` on the resolved `ConsoleStrategy`:\n\n```php\n\u003c?php\n\nuse MyApp\\Commands\\CommandsInitializer;\nuse PHPNomad\\Console\\Interfaces\\ConsoleStrategy;\nuse PHPNomad\\Loader\\Bootstrapper;\nuse PHPNomad\\Symfony\\Component\\Console\\Initializer as SymfonyConsoleInitializer;\nuse Symfony\\Component\\Console\\Application;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\n$container = require __DIR__ . '/../bootstrap/container.php';\n\n$container-\u003ebindSingletonFromFactory(\n    Application::class,\n    fn() =\u003e new Application('MyApp CLI')\n);\n\n$bootstrapper = new Bootstrapper(\n    $container,\n    new SymfonyConsoleInitializer(),\n    new CommandsInitializer()\n);\n\n$bootstrapper-\u003eload();\n\n$container-\u003eget(ConsoleStrategy::class)-\u003erun();\n```\n\n`CommandsInitializer` is any class implementing `HasCommands`. Its `getCommands()` returns an array of command class names, and the loader registers each one automatically. Each command class implements `Command`, with `getSignature()` returning a string like `widget:create {name:The widget name} {--force}` and `handle(Input $input)` running the work.\n\n## Documentation\n\nPHPNomad documentation lives at [phpnomad.com](https://phpnomad.com). For the underlying library, see the [Symfony Console documentation](https://symfony.com/doc/current/components/console.html).\n\n## License\n\nLicensed under the [MIT License](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Fsymfony-console-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpnomad%2Fsymfony-console-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Fsymfony-console-integration/lists"}