{"id":21174647,"url":"https://github.com/llm-agents-php/cli-chat","last_synced_at":"2026-02-26T02:43:21.270Z","repository":{"id":255436981,"uuid":"849752765","full_name":"llm-agents-php/cli-chat","owner":"llm-agents-php","description":"A simple CLI chat application SDK","archived":false,"fork":false,"pushed_at":"2024-09-07T09:40:15.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T18:57:23.734Z","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-08-30T07:16:28.000Z","updated_at":"2024-09-07T09:40:03.000Z","dependencies_parsed_at":"2024-11-20T16:55:39.907Z","dependency_job_id":"aca97b5c-32a1-457c-911a-c468a0dc6445","html_url":"https://github.com/llm-agents-php/cli-chat","commit_stats":null,"previous_names":["llm-agents-php/cli-chat"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/llm-agents-php/cli-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fcli-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fcli-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fcli-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fcli-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llm-agents-php","download_url":"https://codeload.github.com/llm-agents-php/cli-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llm-agents-php%2Fcli-chat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29848634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"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":[],"created_at":"2024-11-20T16:55:31.980Z","updated_at":"2026-02-26T02:43:21.236Z","avatar_url":"https://github.com/llm-agents-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Agents CLI Chat\n\nThis cool package gives you a CLI chat interface to chat with LLM agents. It's built on top of Symfony Console, so you\nknow it's gonna be smooth sailing.\n\n## What's this all about?\n\n- Start chat sessions with different agents\n- Send messages and get responses\n- Handle tool calls and their results\n- Display chat history\n\nIt's perfect for testing your agents or building CLI-based chatbots.\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require llm-agents/cli-chat\n```\n\n## Configuration\n\nThis package doesn't require much configuration. The main things you'll need to set up are:\n\n- An implementation of `LLM\\Agents\\Chat\\ChatServiceInterface`\n- An implementation of `LLM\\Agents\\Chat\\ChatHistoryRepositoryInterface`\n- An implementation of `LLM\\Agents\\Chat\\SessionInterface`\n- Your agent registry\n- Your tool registry\n\n## Usage\n\nTo use this package, you need to create two console commands in your application:\n\n- A command to start a chat session\n- A command to display chat history\n\nHere's how you can set these up using Spiral framework:\n\n\u003e **Note:** You can use any framework or library that supports Symfony Console commands.\n\n### Chat Session Command\n\nThis command starts a new chat session:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Endpoint\\Console;\n\nuse LLM\\Agents\\Agent\\AgentRegistryInterface;\nuse LLM\\Agents\\Chat\\ChatHistoryRepositoryInterface;\nuse LLM\\Agents\\Chat\\ChatServiceInterface;\nuse LLM\\Agents\\Chat\\Console\\ChatSession;\nuse LLM\\Agents\\Tool\\ToolRegistryInterface;\nuse Ramsey\\Uuid\\Uuid;\nuse Spiral\\Console\\Attribute\\AsCommand;\nuse Spiral\\Console\\Command;\nuse Spiral\\Console\\Console;\nuse Symfony\\Component\\Console\\Cursor;\n\n#[AsCommand(\n    name: 'chat',\n    description: 'Chat session'\n)]\nfinal class ChatCommand extends Command\n{\n    public function __invoke(\n        AgentRegistryInterface $agents,\n        ChatServiceInterface $chat,\n        Console $console,\n        ChatHistoryRepositoryInterface $chatHistory,\n        ToolRegistryInterface $tools,\n    ): int {\n        $cursor = new Cursor($this-\u003eoutput);\n        $cursor-\u003eclearScreen();\n        $console-\u003erun(command: 'agent:list', output: $this-\u003eoutput);\n\n        $chat = new ChatSession(\n            input: $this-\u003einput,\n            output: $this-\u003eoutput,\n            agents: $agents,\n            chat: $chat,\n            chatHistory: $chatHistory,\n            tools: $tools,\n        );\n\n        $chat-\u003erun(accountUuid: Uuid::fromString('00000000-0000-0000-0000-000000000000'));\n\n        return self::SUCCESS;\n    }\n}\n```\n\n### Chat History Command\n\nThis command displays the chat history for a specific session:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Endpoint\\Console;\n\nuse LLM\\Agents\\Chat\\ChatHistoryRepositoryInterface;\nuse LLM\\Agents\\Chat\\ChatServiceInterface;\nuse LLM\\Agents\\Chat\\Console\\ChatHistory;\nuse Ramsey\\Uuid\\Uuid;\nuse Spiral\\Console\\Attribute\\Argument;\nuse Spiral\\Console\\Attribute\\AsCommand;\nuse Spiral\\Console\\Command;\n\n#[AsCommand(\n    name: 'chat:session',\n    description: 'Chat session'\n)]\nfinal class ChatWindowCommand extends Command\n{\n    #[Argument(name: 'session_uuid')]\n    public string $sessionUuid;\n\n    public function __invoke(\n        ChatHistoryRepositoryInterface $chatHistory,\n        ChatServiceInterface $chatService,\n    ): int {\n        $chatWindow = new ChatHistory(\n            input: $this-\u003einput,\n            output: $this-\u003eoutput,\n            chatHistory: $chatHistory,\n            chat: $chatService,\n        );\n\n        $chatWindow-\u003erun(Uuid::fromString($this-\u003esessionUuid));\n\n        return self::SUCCESS;\n    }\n}\n```\n\nTo use these commands, you'll need to register them with your application's console kernel or command loader, depending\non your framework.\n\n## Class Diagram\n\nHere's a quick look at how everything fits together:\n\n```mermaid\nclassDiagram\n    class ChatServiceInterface {\n        +getSession(UuidInterface) SessionInterface\n        +updateSession(SessionInterface) void\n        +startSession(UuidInterface, string) UuidInterface\n        +ask(UuidInterface, string|Stringable) UuidInterface\n        +closeSession(UuidInterface) void\n    }\n    class SessionInterface {\n        +getUuid() UuidInterface\n        +getAgentName() string\n        +updateHistory(array) void\n        +isFinished() bool\n    }\n    class ChatHistoryRepositoryInterface {\n        +clear(UuidInterface) void\n        +getMessages(UuidInterface) iterable\n        +addMessage(UuidInterface, object) void\n    }\n    class ChatSession {\n        -io: ChatStyle\n        -cursor: Cursor\n        +run(UuidInterface, string) void\n    }\n    class ChatHistory {\n        -io: ChatStyle\n        +run(UuidInterface) void\n    }\n    class StreamChunkCallback {\n        +__invoke(?string, bool, ?string) void\n    }\n    ChatServiceInterface -- SessionInterface\n    ChatSession -- ChatServiceInterface\n    ChatSession -- ChatHistoryRepositoryInterface\n    ChatHistory -- ChatHistoryRepositoryInterface\n    ChatHistory -- ChatServiceInterface\n```\n\n## Contributing\n\nWe'd love your help to make this package even better! Here's how you can contribute:\n\n1. Fork the repository\n2. Write some awesome code\n3. Create a new Pull Request\n\nPlease make sure your code follows PSR-12 coding standards and include tests for any new features.\n\n## License\n\nThis package is open-sourced software licensed under the MIT license. Feel free to use it, modify it, and share it!\n\n---\n\nThat's all, folks! If you have any questions or run into any issues, don't hesitate to open an issue on GitHub.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllm-agents-php%2Fcli-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllm-agents-php%2Fcli-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllm-agents-php%2Fcli-chat/lists"}