Skip to content

Feature Request: Extension API for Community Plugins #1017

@ssfdre38

Description

@ssfdre38

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

  1. Copilot CLI bundles SDK internally - The SDK code is compiled into the CLI binary (index.js), not consumed as external runtime dependency
  2. Community innovation is blocked - Users cannot extend CLI functionality without modifying bundled code
  3. SDK updates don't reach CLI users immediately - Even if SDK gets new features, CLI requires rebuild/release cycle
  4. 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

  1. CLI exposes hook points - Extension loader in CLI calls external extensions at lifecycle events
  2. Extensions built with public SDK - Developers use @github/copilot-sdk to build tools
  3. Dynamic loading - Extensions loaded from ~/.copilot/extensions/ at runtime
  4. 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 list

Extension 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:

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 list
  • copilot 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):

  1. Accept SDK PR → Internal plugins work
  2. Add Extension Loader → External plugins work
  3. Community chooses → Both patterns coexist

OR

  1. Accept Extension API concept → We refactor SDK PR to match
  2. Ship Extension Loader first → Community starts building
  3. SDK enhancements follow → Based on community feedback

Call to Action

Question for Maintainers:

Would GitHub be open to:

  1. Accepting an Extension API architecture?
  2. Reviewing implementation proposals?
  3. 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


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. 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions