在shell中使用github copilot
brew install gh gh auth login
gh extension install github/gh-copilot
create alias:
alias copilot='gh copilot' ; echo 'alias copilot="gh copilot"' >> ~/.zshrc && source ~/.zshrc
alias gcs='gh copilot suggest' ; echo 'alias gcs="gh copilot suggest"' >> ~/.zshrc && source ~/.zshrc
alias gce='gh copilot explain' ; echo 'alias gce="gh copilot explain"' >> ~/.zshrc && source ~/.zshrc
explain commands:
gh copilot explain 'your query'
gh copilot suggest 'command you want to run' -t 'type of command'
The -t
flag means type of command and can be one of the following:
- git
- gh
- shell