Copilot extension in vscode commit message input shows a button to automatically generate commit message.
Now you can do that without leaving your terminal
- Clone repo
git clone https://github.com/Amit0617/copilot-commit-in-terminal.git
- 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))
- Setup git alias
git config --global alias.ai-commit '!python3 /path/to/aicommit-remote.py | git commit -F -'
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.
- Install
mitmproxy
. - Launch
mitmproxy
in console. - Launch
vscode
and go into Settings (Gear icon in the bottom-left corner). Pastehttp.proxy
in the search bar of settings and populate proxy input withhttp://localhost:8080
. - Check the console which have
mitmproxy
running. It will show you various Flows. You have to findhttps://api.github.com/copilot_internal/v2/token
endpoint. PressEnter
to see body and headers of the Request.authorization
key of header consists of the token you are looking for.