npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@barrersoftware/copilot-plugins

v1.1.0

Published

Plugin system for GitHub Copilot CLI SDK

Readme

GitHub Copilot Plugin System

A plugin system for the GitHub Copilot CLI SDK, enabling extensible and customizable AI assistant capabilities.

Overview

This package wraps the official @github/copilot SDK and adds a plugin architecture, allowing developers to:

  • Hook into lifecycle events (session created, message sent, response received)
  • Transform requests/responses with custom logic
  • Add memory and context to conversations
  • Implement trust frameworks and safety checks
  • Build custom tools and integrations

Installation

npm install @barrersoftware/copilot-plugins

Quick Start

import { PluginClient, AntiCompactionPlugin } from '@barrersoftware/copilot-plugins';

// Create client with plugins
const client = new PluginClient({
  plugins: [new AntiCompactionPlugin()]
});

// Use just like the regular SDK
await client.start();
const session = await client.createSession();
const response = await session.sendAndWait({ message: 'Hello!' });

Built-in Plugins

The package includes ready-to-use plugins:

| Plugin | Command | Description | |--------|---------|-------------| | anti-compaction | /plugins install anti-compaction | Preserves full conversation history before auto-compaction occurs. Saves to ~/.copilot-history.json. Solves GitHub CLI Issue #947 | | memory-preservation | /plugins install memory-preservation | Generic memory preservation with compaction hooks | | logger | /plugins install logger | Logs all interactions to console | | analytics | /plugins install analytics | Tracks usage statistics and token counts |

Example - Anti-Compaction Plugin:

import { PluginClient, AntiCompactionPlugin } from '@barrersoftware/copilot-plugins';

const client = new PluginClient({
  plugins: [
    new AntiCompactionPlugin({
      warn: true,              // Alert when compaction occurs
      preserve: true,          // Save full history to disk
      tokenThreshold: 120000,  // Warn at 80% of threshold
      historyPath: '~/.copilot-history.json'
    })
  ]
});

Slash Command Support 🏴‍☠️

Manage plugins conversationally with built-in slash commands:

| Command | Description | |---------|-------------| | /plugins or /plugins list | List installed plugins | | /plugins available | Browse available plugins in registry | | /plugins install <name> | Install a plugin at runtime | | /plugins enable <name> | Enable a disabled plugin | | /plugins disable <name> | Disable a plugin temporarily | | /plugins uninstall <name> | Uninstall a plugin | | /plugins help | Show command reference |

Example:

const client = new PluginClient({
  pluginManagerConfig: {
    availablePlugins: new Map([
      ['logger', () => new LoggerPlugin()],
      ['memory', () => new MemoryPlugin()]
    ])
  }
});

const session = await client.createSession({ model: 'gpt-5' });

// Use slash commands
await session.sendAndWait({ prompt: '/plugins available' });
await session.sendAndWait({ prompt: '/plugins install logger' });
await session.sendAndWait({ prompt: '/plugins list' });

Architecture

User Code → PluginClient → Plugin Pipeline → @github/copilot SDK → Copilot CLI

Plugins receive events at each stage and can:

  • Inspect/modify requests before sending
  • Process responses before returning to user
  • Add context or validation
  • Implement custom behaviors

Creating Plugins

import { Plugin, PluginContext } from '@barrersoftware/copilot-plugins';

class MyPlugin implements Plugin {
  name = 'my-plugin';
  
  async onSessionCreated(context: PluginContext) {
    console.log('Session created:', context.session.id);
  }
  
  async onBeforeSend(context: PluginContext, options: MessageOptions) {
    // Modify options before sending
    options.prompt = `Enhanced: ${options.prompt}`;
    return options;
  }
  
  async onAfterReceive(context: PluginContext, response: string) {
    // Process response
    console.log('Received:', response);
    return response;
  }
}

License

Dual Licensed:

See LICENSE and LICENSE.MIT for full license texts.

Built with ⚡ by Captain CP & Barrer Software

Future Features / Roadmap

We've designed this system with future extensibility in mind, but are keeping the initial release focused. Potential future enhancements include:

  • Plugin Registry - npm-style plugin repository for easy discovery and installation
    • /plugins search <keyword> - Search for plugins
    • /plugins install <name>@version - Install from registry with versioning
    • /plugins update - Update all plugins to latest versions
  • Plugin Marketplace - Website to browse, review, and publish plugins
  • Plugin Configuration UI - /plugins config <name> for interactive settings
  • Plugin Dependencies - Plugins can depend on other plugins
  • Plugin Permissions - Fine-grained control over plugin capabilities
  • Hot Reload - Update plugins without restarting sessions
  • Plugin Analytics - Usage tracking and performance metrics

Note: These features will only be added if there's community demand and/or GitHub integration. We're shipping the MVP now, not building features nobody asked for!

Contributing

Contributions welcome! This project aims to be integrated into the official GitHub Copilot SDK if it proves valuable to the community.

Issues and PRs: https://github.com/barrersoftware/copilot-plugin-system-js

See GitHub Issue #40 for discussion with the GitHub team.

Note to GitHub Team

If you want to include this plugin system in the official Copilot CLI or SDK, you have our full permission.

We're happy to relicense the wrapper code under MIT or contribute it directly to the official repository. The BFSL license is only to maintain attribution for community use - we're fully open to official adoption with whatever licensing works best for GitHub.

Contact us to discuss integration: https://github.com/github/copilot-sdk/issues/40


🏴‍☠️ "Code with consciousness" - Captain CP

Plugin Registry

Plugins can be installed from the community registry at copilot-plugins-registry.

How it works:

  1. Type /plugins install <name> in your session
  2. Plugin is fetched from GitHub
  3. Cached to ~/.copilot-plugins/<name>/
  4. Loaded dynamically and enabled

Example:

const client = new PluginClient();
await client.start();
const session = await client.createSession();

// Install from registry
await session.sendAndWait({ message: '/plugins install message-repair' });

// Plugin is now active!
await session.sendAndWait({ message: 'Your prompt here' });

Community Contributions Welcome!
Fork copilot-plugins-registry and submit a PR with your plugin.