Skip to content

dyamon/codecompanion-copilot-enterprise.nvim

Repository files navigation

· CodeCompanion Copilot Enterprise adapter ·

A CodeCompanion adapter for GitHub Copilot Business/Enterprise.

Adds a custom CodeCompanion adapter for GitHub Copilot Business/Enterprise plans.

📋 Requirements

📦 Installation

Install the plugin

Use your favourite package manager.

lazy.nvim

Install as a dependency of olimorris/codecompanion.nvim.

{
    "olimorris/codecompanion.nvim",
    dependencies = {
        "dyamon/codecompanion-copilot-enterprise.nvim"
        -- other plugins...
    }
}

Add the adapter to CodeCompanion

If your organization is available at https://acme.ghe.com

require("codecompanion").setup({
  adapters = {
    http = {
      copilot_enterprise = function()
        local adapter = require 'codecompanion.adapters.http.copilot_enterprise'
        adapter.opts.provider_url = "acme.ghe.com" -- 'https://' can be removed but doesn't hurt.
        return adapter
      end,
    },
  },
  strategies = {
    chat = {
      -- Setup the custom adapter for each strategy. You can change default models as usual.
      -- See https://codecompanion.olimorris.dev/configuration/adapters.html#changing-the-default-adapter
      -- and https://codecompanion.olimorris.dev/configuration/adapters.html#changing-a-model
      adapter = {
        name = "copilot_enterprise",
        model = "claude-sonnet-4",
      },
    },
    inline = {
      adapter = "copilot_enterprise",
    },
    cmd = {
      adapter = "copilot_enterprise",
    },
  },
})

🔮 Future Roadmap

  • Copilot statistics: it seems like the same API endpoint used for individual GitHub accounts to get statistics about Copilot usage is available for enterprise accounts as well, but returns a whooping 404; I can replicate this behaviour in VS Code as well. If the feature becomes available in the future, the plugin supports it already.

🙏 Acknowledgements

📄 License

MIT

About

Custom CodeCompanion adapter for GitHub Copilot Enterprise.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages