- How do I install revolution/laravel-copilot-sdk in a Laravel app?
- Install it with Composer: composer require revolution/laravel-copilot-sdk. The service provider and Copilot facade are registered through package auto-discovery, so no manual wiring is needed in a standard Laravel app. Publish the configuration to config/copilot.php and set your credentials and SDK options there or through environment variables.
- Which PHP and Laravel versions does this Copilot SDK package support?
- The package does not publish a documented PHP and Laravel support matrix, and there is no CI matrix you can inspect to verify compatibility. Treat version support as unverified and test it against your exact PHP and Laravel versions in your own pipeline before adopting it. Pin the package version and read diffs on upgrade, since patch releases have added significant public API.
- Do I need a locally running copilot --headless process for this package to work?
- Yes. The wrapper speaks JSON-RPC 2.0 to a locally running copilot --headless process over stdio or TCP, so your application host effectively becomes a process supervisor for a Node-based third-party CLI. That brings hard prerequisites: the CLI in every runtime image, a GitHub identity with a Copilot seat, and outbound network access. PHP-FPM manages long-lived child processes poorly by default, so plan a process model that can start, supervise, and restart the CLI.
- How do I test code that uses the Copilot client?
- Use Copilot::fake() to swap in a test double so your tests never touch the real CLI. Because the package registers container bindings and supports dependency injection, you can also mock the client in isolation and assert the calls your code makes. Keep fakes for feature-level workflows and mocks where you need to verify specific interactions.
- What changed in 1.0.22 and what is reverse-RPC handling?
- Version 1.0.22 adds exit-plan and auto-mode reverse-RPC handling, permission prompt context with user-prompt blocking, and LLM inference request handling. Practically, the integration is no longer one-way: your application must also serve RPC callbacks the agent makes mid-turn, answering permission prompts, supplying plan decisions, and blocking on user input. Budget for a small callback server and treat this as bidirectional control-plane work rather than a simple client wrapper.
- How do I configure credentials and SDK options for the Copilot client?
- Publish config/copilot.php and set credentials and SDK options there, using environment overrides for per-environment values. The package provides a fluent, configurable client plus a copilot() helper and facade, so you can build a configured instance without boilerplate. Keep secrets in environment variables rather than committing them to configuration files.
- Is this package safe to run in production?
- Risk is high: it has a small user base, a single maintainer, and an undocumented support matrix. Version 1.0.22 also added Agent Plugin installation, extension launch support, and session shell and skill RPCs, which widen what a misconfigured or prompt-injected agent can do on your infrastructure. Pin an exact version, read release diffs, and make an explicit trust and sandboxing decision before enabling those capabilities.
- What is the default permission policy and how do I change it?
- The default permission_approve value is 'deny-all', which is the safe choice but often confusing when prompts unexpectedly fail. Permission granularity can be tuned through folder trust and permission location settings, and the newer permission prompt context lets your host answer prompts mid-turn. Change the default deliberately and document the decision for your team.
- Does the package keep up with upstream Copilot SDK changes?
- Yes. Automated sync pull requests from a bot plus a large batch of upstream-parity ports show the wrapper actively follows the upstream SDK instead of drifting from it, which reduces protocol drift risk. What that does not guarantee is semver discipline in this package's own releases, since patch-level bumps have shipped substantial new API. Combine the upstream tracking with pinned versions and changelog review.
- How should I handle Copilot responses and errors in Laravel?
- The package returns Laravel-friendly response objects and wraps errors so you can catch and handle them predictably instead of parsing raw protocol output. Wrap calls in try and catch blocks and inspect the response for the payload you need. Because the agent can call back mid-turn, treat permission and user-prompt failures as their own case rather than folding them into a generic error handler.