Kanji
・ Cloud engineer / freelance ・ Born in 1993 ・ Born in Ehime Prefecture / Lives in Shibuya-ku, Tokyo ・ AWS history 5 years Profile details
Table of Contents
The source code is available at the following GitHub repository:
kanji-shinohara/github-copilot-cli
You can see the operation image of automating the custom CLI tool github-copilot-cli with PyAutoGUI in the following videos:
github-copilot-cli
<Video: Operating GitHub Copilot Chat from CLI options>
Operating GitHub Copilot Chat from CLI options
<Video: Batch execution by specifying repositories in spec.yml>
Batch execution by specifying repositories in spec.yml
The prerequisites for running github-copilot-cli are as follows:
open_vscode_with_file
exec_github_copilot_chat.py
"/Applications/Visual Studio Code - Insiders.app"
command + shift + i
ctrl + l
command + enter
command + k
command + w
a
requirements.txt :
requirements.txt
PyAutoGUI PyYAML pillow pytesseract pygetwindow
Notes on using this CLI:
There are various caveats, so you need to understand these and modify the script as needed. Since this tool is difficult to maintain, if you cannot modify the script yourself, it may be better to wait until an official CLI is provided.
gh repo clone kanji-shinohara/github-copilot-cli cd github-copilot-cli
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
brew install gh # or install by official instructions gh auth login
Please install VSCode and the Copilot Chat extension. Do not use any Japanese localization plugins, as GitHub Copilot Chat prompt completion is only supported in English.
You can adjust sleep seconds and other settings in github_copilot_cli/config/config.yml .
github_copilot_cli/config/config.yml
There are two ways to run github-copilot-cli : specifying the Copilot Chat operation via CLI options, or batch execution using spec.yml .
spec.yml
python github_copilot_cli.py \ --file <file path> \ --working_directory <working directory> \ --chat_message "<chat message>"
Example:
python github_copilot_cli.py \ --file README.md \ --working_directory /Users/user01/Desktop/github-copilot-cli \ --chat_message "Write the README for this repository."
python github_copilot_cli.py \ --spec_file <path to spec.yml>
python github_copilot_cli.py \ --spec_file spec.yml