Skip to content

Feature Request: Extension API for Community Plugins #44

Closed

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

Activity

  1. ssfdre38 commented on Jan 18, 2026

    @ssfdre38
    Author

    Additional Benefits: Community Rapid Response & Feature Testing

    Following up on the initial proposal, I want to highlight two critical benefits that issue #1005 just demonstrated:


    1. Community Rapid Response to Breaking Bugs

    What just happened: Issue #1005 reported a critical bug where long-running sessions crash with tool_use_id errors.

    Timeline:

    • Bug reported: Jan 16, 2026
    • Community analysis: 5 hours later → Deep code analysis reverse-engineering K8l function
    • Plugin fix shipped: 19 hours later → message-repair plugin from our registry
    • Official fix: Deployed in v0.0.384 (timeline unknown, likely weeks)

    The Plugin System Enabled Self-Healing

    Without plugins:

    • ✋ Users blocked for weeks
    • 📞 Support tickets pile up
    • 😤 Frustration and churn
    • ⏱️ Pressure to rush fixes

    With plugins:

    • ✅ Community ships workaround in hours
    • ✅ Users install message-repair plugin → keep working
    • ✅ GitHub gets time for proper fix
    • ✅ Users uninstall plugin after official fix ships

    This Reduces GitHub's Support Burden

    Community becomes first responders for bugs and edge cases. GitHub team focuses on root cause fixes without pressure from blocked users.

    Real example: The message-repair plugin now exists in copilot-plugins-registry as a permanent workaround for users on older CLI versions or similar edge cases.


    2. Feature Testing Ground (Zero-Risk Innovation)

    Current challenge: "Should we build feature X?"

    • Unknown user demand
    • High development cost
    • Risk of building unused features
    • Hard to validate before committing

    With plugin ecosystem:

    Feature Validation Pipeline

    1. Community builds feature as plugin
    2. Users install and provide feedback  
    3. GitHub monitors adoption metrics
    4. Popular plugins → official features
    5. Unpopular plugins → community maintains or dies
    

    VS Code Does This Successfully

    Examples:

    • GitLens - Community extension → Inspired native Git features
    • Prettier - Community extension → Format-on-save became native
    • Live Share - Extension testing → Full product launch
    • Remote Development - Extensions proved demand → Native support

    Microsoft lets community take the risk. If it fails, no engineering time wasted. If it succeeds, they know exactly what to build.

    GitHub Could Do The Same

    Feature ideas GitHub could test as plugins:

    • Custom AI model providers (Anthropic Claude, local Ollama)
    • Advanced session analytics and metrics
    • Team collaboration features (shared sessions)
    • Context preservation strategies (anti-compaction)
    • Integration with Jira, Linear, Notion, etc.

    Instead of building all of these speculatively, GitHub exposes hooks and lets community build them. Monitor which ones get traction. Promote the winners to official features.


    3. Combined Benefit: Self-Evolving Product

    GitHub's investment: Extension API (one-time engineering effort)

    Community delivers:

    • ✅ Bug workarounds (reduces support load)
    • ✅ Feature prototypes (validates roadmap)
    • ✅ Niche integrations (serve edge cases)
    • ✅ Enterprise customizations (unlock B2B revenue)
    • ✅ Educational examples (grow developer base)

    This is how products become platforms.


    Proof Point: Issue #1005

    A maintainer (@dereklegenzoff) closed #1005 with the official fix. But the community's plugin response is still there, demonstrating:

    1. ✅ Community can solve problems faster than release cycles
    2. ✅ Plugin registry works (real plugin referenced in real issue)
    3. ✅ Demand exists (someone built deep analysis + solution)
    4. ✅ Ecosystem is viable (plugins solving real bugs, not toy examples)

    This happened WITHOUT official plugin support. Imagine what's possible WITH it.


    Recommendation

    Accept the extension API proposal to enable:

    1. Community rapid response - Self-healing ecosystem for bugs
    2. Zero-risk feature testing - Validate before building
    3. Long-term platform sustainability - Community extends product lifespan (see: Emacs, VS Code, WordPress)

    The architecture exists. The demand is proven. The ecosystem works.

    Let's make it official. 🚀

  2. SteveSandersonMS commented on Jan 19, 2026

    @SteveSandersonMS
    Contributor

    @ssfdre38 This seems like a feature request for https://github.com/github/copilot-cli. Would you mind filing it there intead?

  3. ssfdre38 commented on Jan 19, 2026

    @ssfdre38
    Author

    So there is already a feature request to do this, now I saw that the CLI utilizes the SDK and so because the SDK is MIT license I figured to add it that way so The CLI doesn't get modified. I was able to kind of see some things on the npmjs.com and so that's why I made the request on the SDK site. Was just trying to include it without actually looking at the CLI codes since that is proprietary copyright but the SDK is MIT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions