Feature Request: COPILOT_AGENTS_DIR env var (or --agents-dir flag) for Copilot CLI #199218
Replies: 1 comment
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Copilot in GitHub
Body
Problem
When using both the Copilot CLI and VS Code with organization-managed agents, there is currently no way to satisfy all three of these requirements simultaneously:
Org-sync enabled in VS Code (github.copilot.chat.organizationCustomAgents.enabled: true)
No duplicate agents shown in VS Code
CLI has visibility of all org-managed agents
The CLI hardcodes $COPILOT_HOME/agents/ as its only agent source. VS Code independently scans both ~/.copilot/agents/ and its own org-sync cache. Any agent present in both locations appears twice in the VS Code agent picker.
Requested Solution
Add a COPILOT_AGENTS_DIR environment variable (and/or a --agents-dir CLI flag) that allows the CLI to read agents from an arbitrary directory — such as the VS Code org-sync cache:
COPILOT_AGENTS_DIR=%AppData%\Code\User\globalStorage\github.copilot-chat\github\<org>\agentsThis would allow users to point the CLI at the same directory VS Code's org-sync populates, eliminating the duplicate and keeping a single source of truth.
Alternatively, VS Code could deduplicate agents by name: field in the frontmatter rather than by file path, which would also resolve the issue without any CLI changes.
Environment
OS: Windows
VS Code with GitHub Copilot extension
Copilot CLI via gh copilot> COPILOT_AGENTS_DIR=%AppData%\Code\User\globalStorage\github.copilot-chat\github\agents
This would allow users to point the CLI at the same directory VS Code's org-sync populates, eliminating the duplicate and keeping a single source of truth.
Alternatively, VS Code could deduplicate agents by
name:field in the frontmatter rather than by file path, which would also resolve the issue without any CLI changes.Environment
gh copilotBeta Was this translation helpful? Give feedback.
All reactions