Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use Copilot API #426

Closed
krzwiatrzyk-lgd opened this issue Jan 29, 2025 · 2 comments
Closed

Document how to use Copilot API #426

krzwiatrzyk-lgd opened this issue Jan 29, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@krzwiatrzyk-lgd
Copy link

Is your feature request related to a problem? Please describe.
Partially. I want to use Github Copilot as AI API however, there is no documentation regarding how to set it up.

I get following error indicating that authentication is needed however I have no clue how to generate/set those files:

❯ mods Hello

   ERROR  Copilot authentication failed

  failed to get refresh token: no token found in /Users/<user>/.config/github-copilot/hosts.json, /Users/<user>/.config/github-copilot/apps.json

Describe the solution you'd like
Describe in documentation what steps should be performed to make Copilot integration work.

Describe alternatives you've considered
Link to any Github Copilot documentation explaining how to set those files - however I didn't find any.

Additional context
Related PR - #406

@krzwiatrzyk-lgd krzwiatrzyk-lgd added the enhancement New feature or request label Jan 29, 2025
@nathabonfim59
Copy link
Contributor

nathabonfim59 commented Feb 8, 2025

Hi! I'm the author of the PR you referenced

Current situation

As mentioned there, the only official way to generate this file is through their LSP, but it's an obfuscated build and I don't know if it would be a good fit to include an entire LSP into this project.

I've been working on a way to integrate copilot into LazyGit, and have the exact same constraints (built a simple POC there).

I'll file a PR later this weekend. Will mention you guys to test it out.


But I want to use mods with Copilot RN!!!

No worries, here is the gist:

I'm deep into the weeds of this because I'm building an integration to copilot into my own editor

@krzwiatrzyk-lgd
Copy link
Author

Thanks a lot for the update! I could make it work using Zed (it took me about 2 minutes). I guess native integration in mods would be better, but that is not so bad.

For all other seeking information, here before any official built-in login:

  1. Install Zed code editor.
  2. In the right bottom corner, click Copilot icon and select Sign in
  3. Proceed with logging in to the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants