在 Laravel Cloud 中使用
安装
在 Settings > Deployments > Build commands 中添加以下内容并部署。/var/www/.local/bin/copilot,请在 Custom environment variables 中设置以下内容。
COPILOT_GITHUB_TOKEN 可以使用 GH_TOKEN 或 GITHUB_TOKEN 等 Copilot CLI 支持的认证方式。
如果使用默认的 stdio 模式,仅这一步安装就足够了。
以 TCP 模式运行
在 App cluster > Background processes > Custom worker 中设置/var/www/.local/bin/copilot --headless --port 12345。
它会作为后台进程持续运行,并在部署时自动重启。
端口号可以任意。
在 Custom environment variables 中设置 COPILOT_URL。
注意事项
- 低价服务器容易内存不足。
- 默认的 HTTP 超时是 20 秒。失败较多时请延长到最多 60 秒。
最新信息请参考 GitHub 仓库。