Github Copilot Provider

Open 💬 6 comments Opened Sep 15, 2025 by SilverMarcs

What feature would you like to see?

It would be nice to have Github copilot as a model provider. Copilot offers an endpoint that is OpenAI compatible but requires Github authentication and token refreshing.

Are you interested in implementing this feature?

_No response_

Additional information

I think it was available in the non-rust version but has not been ported yet

View original on GitHub ↗

6 Comments

benjosua · 9 months ago

I would be open to help implementing this.

A rough plan could be:

  • Add a new copilot provider that can be enabled via configuration.
  • Implement the authentication flow to read the local GitHub token and exchange it for a temporary API token.
  • Create a client adapter for the Copilot Chat API endpoint.
  • Add a simple way in the TUI to manage sign-in and see the current status.

For the auth and client logic, I'd plan to take inspiration from Zed's implementation, which seems quite solid: https://github.com/zed-industries/zed/tree/main/crates/copilot/src

Does this seem like a reasonable approach?

SilverMarcs · 9 months ago

Seems good. Would be great to have model selector working seamlessly with copilots model unless it brings about serious complexity at which point setting model via cli flag might be simpler

benjosua · 9 months ago

Hello @pakrym-oai,

I've implemented the GitHub Copilot provider as outlined in my previous comment.

Could I get approval from an OpenAI team member to open a PR? I want to make sure this aligns with the project roadmap before submitting.

Thanks

flacks · 8 months ago
Hello @pakrym-oai, I've implemented the GitHub Copilot provider as outlined in my previous comment. Could I get approval from an OpenAI team member to open a PR? I want to make sure this aligns with the project roadmap before submitting. Thanks

@benjosua Do you have a branch somewhere so community could test?

MuntasirSZN · 7 months ago

@benjosua is this done? Would love to see this in codex cli. Also, I can also implement it.

johnib · 4 months ago