{"id":21174642,"url":"https://github.com/llm-agents-php/agent-symfony-console","last_synced_at":"2026-01-28T05:58:48.317Z","repository":{"id":255443501,"uuid":"852052559","full_name":"llm-agents-php/agent-symfony-console","owner":"llm-agents-php","description":"Simple agent that can handle Symfony Console commands based on user input","archived":false,"fork":false,"pushed_at":"2024-09-07T08:48:41.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T07:18:11.371Z","etag":null,"topics":[],"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/llm-agents-php.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-04T06:27:01.000Z","updated_at":"2024-09-07T08:48:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f63baa8e-a6ed-4814-9d70-09df46f6b8ac","html_url":"https://github.com/llm-agents-php/agent-symfony-console","commit_stats":null,"previous_names":["llm-agents-php/agent-symfony-console"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/llm-agents-php/agent-symfony-console","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fagent-symfony-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fagent-symfony-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fagent-symfony-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fagent-symfony-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llm-agents-php","download_url":"https://codeload.github.com/llm-agents-php/agent-symfony-console/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fagent-symfony-console/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264503949,"owners_count":23618762,"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":[],"created_at":"2024-11-20T16:55:30.684Z","updated_at":"2026-01-28T05:58:48.263Z","avatar_url":"https://github.com/llm-agents-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony Console Agent 🎭\n\n[![PHP](https://img.shields.io/packagist/php-v/llm-agents/agent-symfony-console.svg?style=flat-square)](https://packagist.org/packages/llm-agents/agent-symfony-console)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/llm-agents/agent-symfony-console.svg?style=flat-square)](https://packagist.org/packages/llm-agents/agent-symfony-console)\n[![Total Downloads](https://img.shields.io/packagist/dt/llm-agents/agent-symfony-console.svg?style=flat-square)](https://packagist.org/packages/llm-agents/agent-symfony-console)\n\nWelcome to the Symfony Console Agent, your new bestie for turning natural language into command-line magic. This nifty\nagent understands your human babble and translates it into console commands. It's like having a super-smart CLI\nassistant right at your fingertips!\n\n### What's the deal? 🤔\n\nEver wished you could just tell your console what to do in plain English? Well, now you can! This agent takes your\ncasual requests and figures out which Symfony command to run. It's perfect for devs who are new to a project, can't\nremember exact command syntax, or just feeling a bit lazy (we've all been there).\n\n**Here's a short video to show you how it works:**\n\n[![Symfony Console Agent Demo](https://github.com/user-attachments/assets/e3a0efd6-486f-48d6-a90a-5595efa9fc45)](https://youtu.be/Tlu6PyL3Ur4)\n\n### Requirements 📋\n\n- PHP 8.3 or higher (we're living in the future, baby!)\n- Symfony Console component\n- A sense of humor (optional, but highly recommended)\n\n### Installation\n\nFirst, make sure you've got Composer installed. Then, run this command to add the Symfony Console Agent to your project:\n\n```bash\ncomposer require llm-agents/agent-symfony-console\n```\n\n### Setup in Spiral Framework\n\n1. Open up your `app/src/Application/Kernel.php` file.\n2. Add the bootloader like this:\n   ```php\n   public function defineBootloaders(): array\n   {\n       return [\n           // ... other bootloaders ...\n           \\LLM\\Agents\\Agent\\SymfonyConsole\\Integrations\\Spiral\\SymfonyConsoleBootloader::class,\n       ];\n   }\n   ```\n\nAnd that's it! Your Spiral app is now ready to use the agent.\n\n### Laravel\n\nFor Laravel, there's a service provider you can use:\n\n```php\n// bootstrap/providers.php\nreturn [\n    // ... other providers ...\n    LLM\\Agents\\Agent\\SymfonyConsole\\Integrations\\Laravel\\SymfonyConsoleServiceProvider::class,\n];\n```\n\n## Usage\n\nTo start using the Symfony Console Agent, you'll need to implement the\n`LLM\\Agents\\Agent\\SymfonyConsole\\CommandManagerInterface`. interface. This interface is responsible for fetching command\nhelp, listing available commands, and executing commands.\n\n**Here's an example of how you might use it in a Laravel application:**\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace LLM\\Agents\\Agent\\SymfonyConsole\\Integrations\\Laravel;\n\nuse Illuminate\\Contracts\\Console\\Kernel;\nuse LLM\\Agents\\Agent\\SymfonyConsole\\CommandManagerInterface;\nuse Symfony\\Component\\Console\\Output\\BufferedOutput;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\nfinal readonly class ArtisanCommandManager implements CommandManagerInterface\n{\n    public function __construct(\n        private Kernel $application,\n        private array $enabledNamespaces = [\n            'make:',\n            'db:',\n            'migrate',\n            'route:list',\n        ],\n    ) {}\n\n    public function getCommandHelp(string $command): string\n    {\n        $output = new BufferedOutput();\n        $this-\u003eapplication-\u003ecall($command, ['--help' =\u003e true], $output);\n\n        return $output-\u003efetch();\n    }\n\n    public function getCommands(): array\n    {\n        $commands = $this-\u003eapplication-\u003eall();\n\n        $availableCommands = [];\n        foreach ($this-\u003eenabledNamespaces as $namespace) {\n            foreach ($commands as $name =\u003e $command) {\n                if (\\str_starts_with($name, $namespace)) {\n                    $availableCommands[$name] = $command;\n                }\n            }\n        }\n\n        return $availableCommands;\n    }\n\n    public function call(\\Stringable|string $command, array $parameters = [], ?OutputInterface $output = null): int\n    {\n        return $this-\u003eapplication-\u003ecall($command, $parameters, $output);\n    }\n}\n```\n\n## Class diagram\n\n```mermaid\nclassDiagram\n    class SymfonyConsoleAgent {\n        +NAME: string\n        +create(frameworkName: string): self\n        -addMetadata(SolutionMetadata): void\n        -addAssociation(Solution): void\n    }\n    class AgentAggregate {\n        \u003c\u003cinterface\u003e\u003e\n        +getKey(): string\n        +getName(): string\n        +getDescription(): string\n        +getInstruction(): string\n        +getTools(): array\n        +getAgents(): array\n        +getModel(): Model\n        +getMemory(): array\n        +getPrompts(): array\n        +getConfiguration(): array\n    }\n    class GetCommandsListTool {\n        +NAME: string\n        -application: CommandManagerInterface\n        +__construct(CommandManagerInterface)\n        +execute(input: object): string\n    }\n    class GetCommandDetailsTool {\n        +NAME: string\n        -application: CommandManagerInterface\n        +__construct(CommandManagerInterface)\n        +execute(input: object): string\n    }\n    class ExecuteCommandTool {\n        +NAME: string\n        -application: CommandManagerInterface\n        +__construct(CommandManagerInterface)\n        +execute(input: object): string\n    }\n    class ReadFileTool {\n        +NAME: string\n        -basePath: string\n        +__construct(string)\n        +execute(input: object): string\n    }\n    class WriteFileTool {\n        +NAME: string\n        -basePath: string\n        +__construct(string)\n        +execute(input: object): string\n    }\n    class CommandManagerInterface {\n        \u003c\u003cinterface\u003e\u003e\n        +getCommandHelp(command: string): string\n        +getCommands(): array\n        +call(command: string, parameters: array, output: OutputInterface): int\n    }\n    class Tool {\n        \u003c\u003cabstract\u003e\u003e\n        +getName(): string\n        +getDescription(): string\n        +getInputSchema(): string\n        +getLanguage(): ToolLanguage\n        +execute(input: object): string|Stringable\n    }\n    class ToolInterface {\n        \u003c\u003cinterface\u003e\u003e\n        +getName(): string\n        +getDescription(): string\n        +getInputSchema(): string\n        +getLanguage(): ToolLanguage\n        +execute(input: object): string|Stringable\n    }\n    class SymfonyConsoleAgentFactory {\n        -frameworkName: string\n        +__construct(frameworkName: string)\n        +create(): AgentInterface\n    }\n    class AgentFactoryInterface {\n        \u003c\u003cinterface\u003e\u003e\n        +create(): AgentInterface\n    }\n    class GetCommandsListInput {\n        +namespace: string\n    }\n    class GetCommandDetailsInput {\n        +command: string\n    }\n    class ExecuteCommandInput {\n        +command: string\n        +arguments: array\n        +options: array\n    }\n    class ReadFileInput {\n        +path: string\n    }\n    class WriteFileInput {\n        +path: string\n        +content: string\n    }\n\n    SymfonyConsoleAgent --|\u003e AgentAggregate\n    SymfonyConsoleAgent ..\u003e GetCommandsListTool\n    SymfonyConsoleAgent ..\u003e GetCommandDetailsTool\n    SymfonyConsoleAgent ..\u003e ExecuteCommandTool\n    SymfonyConsoleAgent ..\u003e ReadFileTool\n    SymfonyConsoleAgent ..\u003e WriteFileTool\n    GetCommandsListTool --|\u003e Tool\n    GetCommandDetailsTool --|\u003e Tool\n    ExecuteCommandTool --|\u003e Tool\n    ReadFileTool --|\u003e Tool\n    WriteFileTool --|\u003e Tool\n    Tool ..|\u003e ToolInterface\n    GetCommandsListTool ..\u003e CommandManagerInterface\n    GetCommandDetailsTool ..\u003e CommandManagerInterface\n    ExecuteCommandTool ..\u003e CommandManagerInterface\n    SymfonyConsoleAgentFactory ..|\u003e AgentFactoryInterface\n    SymfonyConsoleAgentFactory ..\u003e SymfonyConsoleAgent\n    GetCommandsListTool ..\u003e GetCommandsListInput\n    GetCommandDetailsTool ..\u003e GetCommandDetailsInput\n    ExecuteCommandTool ..\u003e ExecuteCommandInput\n    ReadFileTool ..\u003e ReadFileInput\n    WriteFileTool ..\u003e WriteFileInput\n```\n\n## Want to help out? 🤝\n\nWe love contributions! If you've got ideas to make this agent even cooler, here's how you can chip in:\n\n1. Fork the repo\n2. Make your changes\n3. Create a new Pull Request\n\nJust make sure your code is clean, well-commented, and follows PSR-12 coding standards.\n\n## License 📄\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nThat's all, folks! If you've got any questions or run into any trouble, don't hesitate to open an issue.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllm-agents-php%2Fagent-symfony-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllm-agents-php%2Fagent-symfony-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllm-agents-php%2Fagent-symfony-console/lists"}