> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Boost Custom Agent for PhpStorm with GitHub Copilot

> 面向 PhpStorm 的 GitHub Copilot 插件，为 Laravel Boost 增加自定义 agent 的包。支持 macOS/Windows/Linux/WSL。

## 包概览

[revolution/laravel-boost-phpstorm-copilot](https://github.com/invokable/laravel-boost-phpstorm-copilot) 是 Laravel Boost 的扩展包，用于为 **PhpStorm 的 GitHub Copilot 插件** 增加自定义 agent。

它会在 `php artisan boost:install` 的 AI agent 选项中新增 `PhpStorm with GitHub Copilot`。

<Warning>
  `PhpStorm` 是给 `PhpStorm Junie` 用的选项。请务必选择 `PhpStorm with GitHub Copilot`。
</Warning>

## 环境要求

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

## 安装

```shell theme={null}
composer require revolution/laravel-boost-phpstorm-copilot --dev
```

## 用法

<Steps>
  <Step title="运行 Boost 的安装命令">
    ```shell theme={null}
    php artisan boost:install
    ```
  </Step>

  <Step title="选择所需功能">
    从 `AI Guidelines` / `Agent Skills` / `Boost MCP Server Configuration` 中选择所需功能。
  </Step>

  <Step title="在 AI agent 中选择 PhpStorm with GitHub Copilot">
    在 `Which AI agents would you like to configure?` 中选择 `PhpStorm with GitHub Copilot`。
  </Step>
</Steps>

## MCP 配置文件的位置

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

## 重要：切换项目时需要重新执行

在 PhpStorm + GitHub Copilot 插件中，MCP 配置**不是按项目保存**，而是保存在**系统全局**。
配置文件中会写入 Laravel 项目的**绝对路径**，因此每次切换项目都需要重新生成。

```shell theme={null}
php artisan boost:install --guidelines --skills --mcp --no-interaction
```

<Info>
  Boost 1.8 之后的 `boost:update` 不会更新 MCP 配置文件。
</Info>

## 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](https://github.com/invokable/laravel-boost-copilot-cli)。

## 相关链接

* [laravel-boost-phpstorm-copilot (GitHub)](https://github.com/invokable/laravel-boost-phpstorm-copilot)
* [Laravel Boost (GitHub)](https://github.com/laravel/boost)
* [GitHub Copilot plugin for PhpStorm](https://plugins.jetbrains.com/plugin/17718-github-copilot)


## Related topics

- [Laravel Boost Custom Agent for GitHub Copilot CLI](/zh/packages/laravel-boost-copilot-cli.md)
- [创建 Boost 的自定义 Agent](/zh/advanced/boost-custom-agent.md)
- [Skills](/zh/packages/laravel-copilot-sdk/skills.md)
- [自定义代理](/zh/packages/laravel-copilot-sdk/custom-agents.md)
- [认证 - GitHub Copilot SDK for Laravel](/zh/packages/laravel-copilot-sdk/auth.md)
