最近使ってる便利シェル関数: gh copilot suggest -t shell

「iOSシミュレータを起動するコマンドがあったんだけど忘れた」というような状況で便利

copilot() {
    gh copilot suggest -t shell "$@"
}

alias c="copilot"

忘れたのでコマンド履歴から検索してくることもままならない。そんな時はこう

❯ c launch ios sim

Welcome to GitHub Copilot in the CLI!
version 0.5.3-beta (2023-11-09)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve.

Suggestion:

  open -a Simulator

? Select an option  [Use arrows to move, type to filter]
> Copy command to clipboard
  Explain command
  Revise command
  Rate response
  Exit

Copy command to clipboardして実行する

gh copilotはGitHubが提供しているCLI

docs.github.com

難点としては結構間違ったことも言う。だが、ゆるしてやってくれ