Skip to content

Instantly share code, notes, and snippets.

@fourthdimension
Created May 1, 2024 01:25
Show Gist options
  • Save fourthdimension/2c22b31775351405f0e299713a7835a7 to your computer and use it in GitHub Desktop.
Save fourthdimension/2c22b31775351405f0e299713a7835a7 to your computer and use it in GitHub Desktop.
Fish Shell - Wrapper around `gh copilot explain` to explain a given input command in natural language.
function ghce --description 'Wrapper around `gh copilot explain` to explain a given input command in natural language.'
set -l GH_DEBUG "$GH_DEBUG"
for arg in $argv
switch $arg
case '-d' '--debug'
set GH_DEBUG 'api'
case '-h' '--help'
echo "USAGE
ghce [flags] <command>
FLAGS
-d, --debug Enable debugging
-h, --help Display help usage
EXAMPLES
# View disk usage, sorted by size
ghce 'du -sh | sort -h'
# View git repository history as text graphical representation
ghce 'git log --oneline --graph --decorate --all'
# Remove binary objects larger than 50 megabytes from git history
ghce 'bfg --strip-blobs-bigger-than 50M'"
return
end
end
set -lx GH_DEBUG $GH_DEBUG gh copilot explain $argv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment