feat(shell): setup for GitHub Copilot CLI

This commit is contained in:
2023-04-21 15:00:37 +01:00
parent 43d8a4ad9f
commit 50b21937b3
3 changed files with 33 additions and 0 deletions

31
zsh/copilot.zsh Normal file
View File

@@ -0,0 +1,31 @@
#
# Setup for GitHub Copilot CLI
#
# Lazy-load the Copilot CLI helpers on first use.
if command-exists github-copilot-cli; then
setup_copilot-cli-integration() {
local cmd="$1"
shift
eval "$(github-copilot-cli alias -- "$SHELL")"
"$cmd" "$@"
}
copilot_what-the-shell() {
setup_copilot-cli-integration "$0" "$@"
}
alias '??'='copilot_what-the-shell'
alias 'wts'='copilot_what-the-shell'
copilot_git-assist() {
setup_copilot-cli-integration "$0" "$@"
}
alias 'git?'='copilot_git-assist'
copilot_gh-assist() {
setup_copilot-cli-integration "$0" "$@"
}
alias 'gh?'='copilot_gh-assist'
fi

View File

@@ -10,6 +10,7 @@ install_node_global_packages() {
local npm_packages=(
@commitlint/cli
@commitlint/config-conventional
@githubnext/github-copilot-cli
@mermaid-js/mermaid-cli
@prettier/plugin-php
@prettier/plugin-ruby

1
zshrc
View File

@@ -126,6 +126,7 @@ if [[ "$OSTYPE" == "linux"* ]]; then source "$DOTZSH/linux.zsh"; fi
# Utils
source "$DOTZSH/1password.zsh"
source "$DOTZSH/copilot.zsh"
source "$DOTZSH/emacs.zsh"
source "$DOTZSH/fzf.zsh"
source "$DOTZSH/less.zsh"