{"id":42824378,"url":"https://github.com/invokable/laravel-copilot-sdk","last_synced_at":"2026-04-25T03:28:01.254Z","repository":{"id":334154957,"uuid":"1138641735","full_name":"invokable/laravel-copilot-sdk","owner":"invokable","description":"Laravel version of GitHub Copilot SDK","archived":false,"fork":false,"pushed_at":"2026-04-25T01:36:36.000Z","size":1378,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-25T02:40:43.750Z","etag":null,"topics":["copilot-cli","copilot-sdk","laravel"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/revolution/laravel-copilot-sdk","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/invokable.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["invokable"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2026-01-20T23:48:31.000Z","updated_at":"2026-04-25T01:12:39.000Z","dependencies_parsed_at":"2026-03-10T01:02:55.045Z","dependency_job_id":null,"html_url":"https://github.com/invokable/laravel-copilot-sdk","commit_stats":null,"previous_names":["invokable/laravel-copilot-sdk"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/invokable/laravel-copilot-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-copilot-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-copilot-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-copilot-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-copilot-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invokable","download_url":"https://codeload.github.com/invokable/laravel-copilot-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-copilot-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32248765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T03:17:44.950Z","status":"ssl_error","status_checked_at":"2026-04-25T03:16:45.208Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["copilot-cli","copilot-sdk","laravel"],"created_at":"2026-01-30T08:21:08.602Z","updated_at":"2026-04-25T03:28:01.202Z","avatar_url":"https://github.com/invokable.png","language":"PHP","funding_links":["https://github.com/sponsors/invokable"],"categories":[],"sub_categories":[],"readme":"# GitHub Copilot SDK for Laravel\n\n[![tests](https://github.com/invokable/laravel-copilot-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/invokable/laravel-copilot-sdk/actions/workflows/tests.yml)\n[![Maintainability](https://qlty.sh/badges/ef9130cf-a953-4d14-ac02-9eafb4c40a0c/maintainability.svg)](https://qlty.sh/gh/invokable/projects/laravel-copilot-sdk)\n[![Code Coverage](https://qlty.sh/badges/ef9130cf-a953-4d14-ac02-9eafb4c40a0c/coverage.svg)](https://qlty.sh/gh/invokable/projects/laravel-copilot-sdk)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/invokable/laravel-copilot-sdk)\n\nThis package is Laravel version of [GitHub Copilot SDK](https://github.com/github/copilot-sdk), which allows you to interact with GitHub Copilot CLI programmatically from your Laravel applications.\n\n\u003e [!NOTE]\n\u003e This is the Community SDK.\n\n## Requirements\n\n- PHP \u003e= 8.4\n- Laravel \u003e= 12.x\n- [Copilot CLI](https://github.com/github/copilot-cli) Latest version\n\n## Installation\n\n```shell\ncomposer require revolution/laravel-copilot-sdk\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eOptional operation\u003c/summary\u003e\n\n### .env (Optional)\n\n```dotenv\nCOPILOT_CLI_PATH=copilot\n```\n\n### TCP Mode (Optional)\n\nInstead of starting a new CLI process for each request, you can connect to an existing Copilot CLI server running in TCP mode. This is useful for:\n\n- Laravel Forge/Cloud deployments with background process management\n- Sharing a single CLI instance across multiple Laravel processes\n- Better performance with persistent connections\n\nStart the Copilot CLI server:\n\n```shell\ncopilot --headless --port 12345\n```\n\nConfigure your `.env`:\n\n```dotenv\nCOPILOT_URL=127.0.0.1:12345\n```\n\nWhen `COPILOT_URL` is set, the SDK will connect to the existing server instead of starting a new CLI process.\n\n### Publish config (Optional)\n\n```shell\nphp artisan vendor:publish --tag=copilot-config\n```\n\n### Uninstall\n```shell\ncomposer remove revolution/laravel-copilot-sdk\n```\n\n\u003c/details\u003e\n\n## Getting Started\n\n[Getting Started Guide](./docs/getting-started.md)\n\n## Usage\n\nWe provide a high-level API that uses a Laravel Facade on top of a layer that replicates the official SDK.\n\nThis should be sufficient for general use.\n\nArtisan commands, controllers, jobs... the SDK can be used anywhere in Laravel where you can invoke the Copilot CLI.\n\n### Run single prompt\n\n```php\nuse Revolution\\Copilot\\Facades\\Copilot;\n\n$response = Copilot::run(prompt: 'Tell me something about Laravel.');\ndump($response-\u003econtent());\n```\n\n### Multiple prompts in a single session\n\n```php\nuse Revolution\\Copilot\\Contracts\\CopilotSession;\nuse Revolution\\Copilot\\Facades\\Copilot;\n\n$content = Copilot::start(function (CopilotSession $session) {\n    dump('Starting Copilot session: '.$session-\u003eid());\n\n    $response = $session-\u003esendAndWait(prompt: 'Tell me something about PHP.');\n    dump($response-\u003econtent());\n\n    $response = $session-\u003esendAndWait(prompt: 'Tell me something about Laravel.');\n    dump($response-\u003econtent());\n\n    return $response-\u003econtent();\n});\n\ndump($content);\n```\n\n### `copilot()` helper\n\nAlternatively, you can use the `copilot()` helper function.\n\n```php\n// Don't forget to import the function\nuse function Revolution\\Copilot\\copilot;\n\n// If you specify a prompt as a string, it is the same as Copilot::run(). \n$response = copilot('Tell me something about Laravel.');\n\n// If you pass a closure, it is the same as Copilot::start().\ncopilot(function (CopilotSession $session) {\n    $response = $session-\u003esendAndWait(prompt: 'Tell me something about PHP.');\n});\n\n// If you don't pass anything, it's the same as Facade.\ndump(copilot()-\u003eclient()-\u003eping());\n```\n\nFor more than simple use, use the Copilot Facade above.\n\n## Testing\n\nProvide Laravel way testing support with `Copilot::fake()`.\n\n### Copilot::fake()\n\n`Copilot::fake()` is a mock for features used from the Copilot Facade. Other features are not mocked.\n\n```php\nuse Revolution\\Copilot\\Facades\\Copilot;\n\nCopilot::fake('2');\n\n$response = Copilot::run(prompt: '1 + 1');\n\n// Pest\nexpect($response-\u003econtent())-\u003etoBe('2');\n// PHPUnit\n$this-\u003eassertEquals('2', $response-\u003econtent());\n```\n\nWhen calling multiple times with Copilot::start()\n\n```php\nuse Revolution\\Copilot\\Facades\\Copilot;\nuse Revolution\\Copilot\\Contracts\\CopilotSession;\n\nCopilot::fake([\n    '*' =\u003e Copilot::sequence()\n            -\u003epush(Copilot::response('2'))\n            -\u003epush(Copilot::response('4')),\n]);\n\nCopilot::start(function (CopilotSession $session) use (\u0026$response1, \u0026$response2) {\n    $response1 = $session-\u003esendAndWait(prompt: '1 + 1');\n    $response2 = $session-\u003esendAndWait(prompt: '2 + 2');\n});\n\nexpect($response1-\u003econtent())-\u003etoBe('2');\n```\n\n### Assertions\n\nAssert that a specific prompt was called.\n\n```php\nCopilot::assertPrompt('1 + *');\n```\n\nAssert that a prompt was not called.\n\n```php\nCopilot::assertNotPrompt('1 + *');\n```\n\nAssert the number of prompts called.\n\n```php\nCopilot::assertPromptCount(3);\n```\n\nAssert that no prompts were called.\n\n```php\nCopilot::assertNothingSent();\n```\n\n### Prevent stray requests\n\nPrevent all JSON-RPC requests. If called, an exception `Revolution\\Copilot\\Exceptions\\StrayRequestException` is thrown.\n\n```php\nCopilot::preventStrayRequests();\n```\n\nWhen you want to allow only some commands.\n\n```php\nCopilot::preventStrayRequests(allow: ['ping']);\n```\n\nStop prevention.\n\n```php\nCopilot::preventStrayRequests(false);\n```\n\nOnly JSON-RPC requests are prevented, so starting a client is not prevented.\n\n## Documentation\n\nMost of the English documentation is included in the official SDK, so we won't provide much here. README and [Getting Started Guide](./docs/getting-started.md) are provided in English.\n\nOnly Japanese documentation is available in [docs/jp](./docs/jp). **Ask Copilot!!**\n\n## Our other packages\n- [laravel-boost-copilot-cli](https://github.com/invokable/laravel-boost-copilot-cli)\n- [laravel-boost-phpstorm-copilot](https://github.com/invokable/laravel-boost-phpstorm-copilot)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvokable%2Flaravel-copilot-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvokable%2Flaravel-copilot-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvokable%2Flaravel-copilot-sdk/lists"}