Skip to content

Copilot extension in vscode commit message input shows a button to automatically generate commit message. This allows you to do that without leaving terminal.

Notifications You must be signed in to change notification settings

Amit0617/copilot-commit-in-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

copilot-commit-in-terminal

Copilot extension in vscode commit message input shows a button to automatically generate commit message.alt text

Demo

Now you can do that without leaving your terminal Demo of using it in action

How to use?

⚠️ For the following process, it is assummed that you have copilot access and have setup your vscode with github acccount logged in. You must be able to use copilot commit functionality through UI as shown in GIF above then only you can have that access in terminal.

  1. Clone repo
    git clone https://github.com/Amit0617/copilot-commit-in-terminal.git
    
  2. Put Github Oauth user access token for vscode in aicommit-remote.py file. How to get Github Oauth token?
    # aicommit-remote.py
    ...
    ...
    ...
    if __name__ == "__main__":
        github_token = 'gho_<YOUR_GITHUB_TOKEN>'
        print(generate_commit_message(github_token))
  3. Setup git alias
    git config --global alias.ai-commit '!python3 /path/to/aicommit-remote.py | git commit -F -'

How to get Github OAuth token?

This is not going to be some random token generated by us. This has to be exact user access token copilot extension is using for authorizing access on behalf of your account.

  1. Install mitmproxy.
  2. Launch mitmproxy in console.
  3. Launch vscode and go into Settings (Gear icon in the bottom-left corner). Paste http.proxy in the search bar of settings and populate proxy input with http://localhost:8080.
  4. Check the console which have mitmproxy running. It will show you various Flows. You have to find https://api.github.com/copilot_internal/v2/token endpoint. Press Enter to see body and headers of the Request. authorization key of header consists of the token you are looking for.

About

Copilot extension in vscode commit message input shows a button to automatically generate commit message. This allows you to do that without leaving terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages