跳转到主要内容

包概览

revolution/laravel-boost-phpstorm-copilot 是 Laravel Boost 的扩展包,用于为 PhpStorm 的 GitHub Copilot 插件 增加自定义 agent。 它会在 php artisan boost:install 的 AI agent 选项中新增 PhpStorm with GitHub Copilot
PhpStorm 是给 PhpStorm Junie 用的选项。请务必选择 PhpStorm with GitHub Copilot

环境要求

  • PHP 8.3 及以上
  • Laravel 12 及以上
  • Laravel Boost 2.0 及以上
  • PhpStorm 已安装 GitHub Copilot 插件

安装

composer require revolution/laravel-boost-phpstorm-copilot --dev

用法

1

运行 Boost 的安装命令

php artisan boost:install
2

选择所需功能

AI Guidelines / Agent Skills / Boost MCP Server Configuration 中选择所需功能。
3

在 AI agent 中选择 PhpStorm with GitHub Copilot

Which AI agents would you like to configure? 中选择 PhpStorm with GitHub Copilot

MCP 配置文件的位置

OS路径
macOS, Linux~/.config/github-copilot/intellij/mcp.json
Windows%LOCALAPPDATA%\github-copilot\intellij\mcp.json

重要:切换项目时需要重新执行

在 PhpStorm + GitHub Copilot 插件中,MCP 配置不是按项目保存,而是保存在系统全局。 配置文件中会写入 Laravel 项目的绝对路径,因此每次切换项目都需要重新生成。
php artisan boost:install --guidelines --skills --mcp --no-interaction
Boost 1.8 之后的 boost:update 不会更新 MCP 配置文件。

WSL 支持

本包支持 PhpStorm 运行在 Windows 端、PHP 运行在 WSL 端 的组合。

前置条件

  • 需要 wslu
  • 未安装时可通过 sudo apt install wslu 安装

工作原理

  • 通过 WSL_DISTRO_NAME 检测 WSL 环境
  • 通过 wslvar LOCALAPPDATA 获取 Windows 端的 AppData 路径
  • 通过 PowerShell 写入 %LOCALAPPDATA%\github-copilot\intellij\mcp.json

注意事项

在 WSL 内以远程开发方式使用 PhpStorm 不在支持范围内。这种情况下请手动配置 MCP 文件。

不支持 Testbench 以及替代方案

本包不支持在 Testbench 中使用。 如果你在包开发中使用 Testbench,请改用 laravel-boost-copilot-cli

相关链接

最后修改于 2026年7月13日