github / github/copilot-cli

`copilot plugin install` from GitHub repo does not discover `.github/plugin/plugin.json` — skills and agents unavailable

未關閉
#2,390 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:agents area:installation area:plugins
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

## Describe the bug

When installing a plugin directly from a GitHub repository using `copilot plugin install /`, the CLI downloads the full repository but sets `cache_path` in `~/.copilot/config.json` to the repository root. The plugin loader then looks for `plugin.json` at the root of `cache_path`, but for repo-based plugins the plugin definition lives in `.github/plugin/plugin.json`.

As a result, skills and agents defined by the plugin are never loaded and do not appear in the available skills list.

**Root Cause Analysis:**

Comparing a working marketplace plugin (`dotnet`) with the direct install:

| | Marketplace plugin (dotnet) | Direct repo install (winapp-cli) |
|---|---|---|
| `cache_path` | `installed-plugins/awesome-copilot/dotnet` | `installed-plugins/_direct/microsoft--WinAppCli` |
| `plugin.json` location | `/plugin.json` ✅ | `/.github/plugin/plugin.json` ❌ |
| Skills loaded | Yes | No |

The marketplace plugin has a flattened structure with `plugin.json` at root. The direct repo install preserves the full repo structure where `plugin.json` lives in `.github/plugin/`.

## Affected version

1.0.12

## Steps to reproduce the behavior

1. Install a plugin from a GitHub repo: `copilot plugin install microsoft/WinAppCli`
2. Start a new Copilot CLI session
3. Check available skills (e.g. ask the agent to list skills, or check the system prompt)
4. Observe: winapp-cli skills and agents are **not listed**
5. Inspect `~/.copilot/config.json` — `cache_path` points to repo root, not `.github/plugin/`

## Expected behavior

The plugin loader should discover `plugin.json` inside `.github/plugin/` for plugins installed from GitHub repositories. Skills and agents defined in the plugin should be available after installation.

## Additional context

- OS: Windows 11
- Terminal: Windows Terminal
- Shell: PowerShell

**Workaround:** Manually edit `~/.copilot/config.json` and append `/.github/plugin` to the `cache_path`:
```json
"cache_path": "...\\microsoft--WinAppCli\\.github\\plugin"
```
After restarting the CLI, skills and agents are correctly discovered.

**Suggested fix:** When installing a plugin from a GitHub repo, the CLI should either:
1. Set `cache_path` to the `.github/plugin/` subdirectory if `plugin.json` exists there, or
2. Have the plugin loader check `.github/plugin/plugin.json` as a fallback when `plugin.json` is not found at the `cache_path` root

**Related issues in this repo:**
- #1296 — Mentions `owner/repo:path/to/plugin` install syntax which could serve as a workaround
- #2286 — Another plugin install issue on Windows (symlinks)
- #1855 — Plugin skills not available after sessionStart hook install (different root cause, same symptom)

## Cross-repo notice

This issue has also been filed as microsoft/WinAppCli#365 since it affects the recommended install instructions in that repo's README. It is unclear whether the fix should be in the Copilot CLI (plugin loader not checking `.github/plugin/`), in the plugin repo (restructuring or adding a root-level `plugin.json`), or in both. Filing on both repos so the respective maintainers can determine the best course of action.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。