feat(fish): add GitHub Copilot CLI

This commit is contained in:
Stefan Imhoff
2023-03-07 17:56:58 +01:00
parent a0ecbf4710
commit 2e20ec1d36
4 changed files with 52 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
function copilot_git-assist
set TMPFILE (mktemp)
trap 'rm -f $TMPFILE' EXIT
if github-copilot-cli git-assist $argv --shellout $TMPFILE
if test -e "$TMPFILE"
set FIXED_CMD (cat $TMPFILE)
echo -s "$FIXED_CMD"
eval "$FIXED_CMD"
else
echo "Apologies! Extracting command failed"
end
else
return 1
end
end