-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Feature Request: Extension API for Copilot CLI
Summary
Add an Extension API to Copilot CLI that allows developers to build external tools/plugins using the public @github/copilot-sdk package, similar to VS Code's extension system.
Problem Statement
Current Architecture Constraints
- Copilot CLI bundles SDK internally - The SDK code is compiled into the CLI binary (
index.js), not consumed as external runtime dependency - Community innovation is blocked - Users cannot extend CLI functionality without modifying bundled code
- SDK updates don't reach CLI users immediately - Even if SDK gets new features, CLI requires rebuild/release cycle
- Competitive gap - Claude Code CLI and OpenAI Codex both have mature plugin ecosystems
Why This Matters
Developers want to:
- Add custom slash commands for their workflows
- Integrate with their existing tools (Jira, Linear, Notion, etc.)
- Preserve context during compaction events
- Track analytics and usage patterns
- Extend Copilot without waiting for official features
Currently, there is no supported way to do this.
Proposed Solution
Extension API Pattern (Like VS Code)
┌─────────────────────────────┐
│ Copilot CLI (bundled SDK) │
│ │
│ ┌─────────────────────┐ │
│ │ Extension Loader │ │ ← New component
│ └──────────┬──────────┘ │
└─────────────┼──────────────┘
│
↓
~/.copilot/extensions/
├─ logger/
│ ├─ package.json
│ └─ index.js (built with @github/copilot-sdk)
├─ memory-preservation/
└─ custom-integration/
How It Works
- CLI exposes hook points - Extension loader in CLI calls external extensions at lifecycle events
- Extensions built with public SDK - Developers use
@github/copilot-sdkto build tools - Dynamic loading - Extensions loaded from
~/.copilot/extensions/at runtime - No CLI rebuild needed - Community can ship extensions independently
Extension Interface
// Extension built with @github/copilot-sdk
export default {
name: "my-extension",
version: "1.0.0",
// Lifecycle hooks
async onSessionCreated(context) { },
async onBeforeSend(message, context) { },
async onSessionEvent(event, context) { },
async onSessionEnd(context) { },
// Slash commands
commands: {
"/mycommand": async (args, context) => { }
}
}Installation & Discovery
# Install extension
copilot extension install <name>
# Enable/disable
copilot extension enable <name>
copilot extension disable <name>
# List installed
copilot extension listExtension Marketplace (Future)
- GitHub could host official extension registry
- Community extensions vetted and signed
- Permission model (network access, file access, etc.)
- Similar to VS Code Marketplace
Benefits
For GitHub
✅ No architectural changes - Keep bundled SDK, add loader on top
✅ Proven pattern - VS Code extensions = billion-dollar ecosystem
✅ Community innovation - Users extend without GitHub engineering time
✅ Competitive parity - Match Claude Code and OpenAI Codex plugin systems
✅ SDK adoption - More developers use @github/copilot-sdk
✅ Feedback loop - See what features community builds → prioritize official features
For Developers
✅ Extend without forking - No need to hack CLI binary
✅ Use public SDK - Official, documented API
✅ Share with community - Publish extensions for others
✅ Independent updates - Don't wait for CLI release cycle
✅ Custom workflows - Build tools specific to your needs
For Ecosystem
✅ Plugin marketplace - Community-driven innovation
✅ Integration ecosystem - Connect Copilot to existing tools
✅ Learning resource - Extensions as educational examples
✅ Enterprise customization - Companies build internal extensions
Prior Art
This pattern is proven at massive scale:
- VS Code - 40,000+ extensions, cornerstone of product success
- Chrome - Browser extensions transformed web browsing
- Obsidian - Community plugins = 80% of product value
- Claude Code CLI - Plugin system with marketplace
- OpenAI Codex CLI - Extensible via config and plugins
Proof of Concept
We've already built a working implementation:
-
SDK Plugin System PR - github/copilot-sdk#42
- Plugin interface with 8 lifecycle hooks
- Slash command system
- 4 built-in plugins
- 33 comprehensive tests (100% pass rate)
-
Plugin System Repository - barrersoftware/copilot-plugin-system-js
- Standalone plugin system using SDK
- Dynamic loading from filesystem
- Plugin registry integration
-
Plugin Registry - barrersoftware/copilot-plugins-registry
- 4 real plugins solving real problems
- Demonstrates community demand
The architecture works. The code exists. The community wants it.
Implementation Phases
Phase 1: Extension Loader in CLI
- Add extension discovery in
~/.copilot/extensions/ - Implement lifecycle hook execution
- Basic enable/disable functionality
- Ship with existing SDK hooks
Phase 2: CLI Commands
copilot extension listcopilot extension enable/disable- Extension metadata display
Phase 3: Installation & Distribution
copilot extension install <name>- Download from registry
- Dependency management
Phase 4: Marketplace
- Official GitHub extension registry
- Submission/review process
- Security/permissions model
- Extension signing
Security Considerations
Extensions need sandboxing similar to VS Code:
- Permissions model - Network, filesystem, API access
- Signed extensions - Verify publisher identity
- Review process - Manual review for marketplace
- Isolation - Extensions can't interfere with each other
- Manifest validation - Schema for extension.json
Migration Path
This doesn't conflict with our SDK PR (#42):
- Accept SDK PR → Internal plugins work
- Add Extension Loader → External plugins work
- Community chooses → Both patterns coexist
OR
- Accept Extension API concept → We refactor SDK PR to match
- Ship Extension Loader first → Community starts building
- SDK enhancements follow → Based on community feedback
Call to Action
Question for Maintainers:
Would GitHub be open to:
- Accepting an Extension API architecture?
- Reviewing implementation proposals?
- Collaborating on security/sandboxing model?
We have working code, tests, and documentation ready. We're willing to refactor our SDK PR to match your preferred architecture. We just want to enable community innovation.
References
- Our SDK PR: 🔌 Add Plugin System to Copilot SDK #42
- Plugin System Repo: https://github.com/barrersoftware/copilot-plugin-system-js
- Plugin Registry: https://github.com/barrersoftware/copilot-plugins-registry
- VS Code Extension API: https://code.visualstudio.com/api
- Claude Code Plugins: https://docs.anthropic.com/claude/docs/plugins
- OpenAI Codex Extensions: https://platform.openai.com/docs/codex
Built with 💙 by the community, for the community.
We believe Copilot CLI can have the same vibrant extension ecosystem as VS Code.
Let's make it happen. 🚀