mirror of
https://github.com/danbulant/dotfiles
synced 2026-05-27 05:51:54 +00:00
47 lines
1.2 KiB
Fish
47 lines
1.2 KiB
Fish
function __copilot_what-the-shell
|
|
set TMPFILE (mktemp)
|
|
trap 'rm -f $TMPFILE' EXIT
|
|
if github-copilot-cli what-the-shell $argv --shellout $TMPFILE
|
|
if test -e $TMPFILE
|
|
set FIXED_CMD (cat $TMPFILE)
|
|
eval $FIXED_CMD
|
|
else
|
|
echo "Apologies! Extracting command failed"
|
|
end
|
|
else
|
|
return 1
|
|
end
|
|
end
|
|
alias '!!'='__copilot_what-the-shell'
|
|
|
|
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)
|
|
eval $FIXED_CMD
|
|
else
|
|
echo "Apologies! Extracting command failed"
|
|
end
|
|
else
|
|
return 1
|
|
end
|
|
end
|
|
alias 'git!'='__copilot_git-assist'
|
|
|
|
function __copilot_gh-assist
|
|
set TMPFILE (mktemp)
|
|
trap 'rm -f $TMPFILE' EXIT
|
|
if github-copilot-cli gh-assist $argv --shellout $TMPFILE
|
|
if test -e $TMPFILE
|
|
set FIXED_CMD (cat $TMPFILE)
|
|
eval $FIXED_CMD
|
|
else
|
|
echo "Apologies! Extracting command failed"
|
|
end
|
|
else
|
|
return 1
|
|
end
|
|
end
|
|
alias 'gh!'='__copilot_gh-assist'
|