在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
 
 

 

 
 

 

 
 

 

posted @ 2024-09-12 17:45  hh9515  阅读(11)  评论(0编辑  收藏  举报