mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 06:24:13 -06:00
feat: add Fish function wrappers for copilot suggest/explain commands
Replace gh copilot aliases with custom Fish functions that provide better help text and wrap the copilot CLI with appropriate prompts
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
function suggest --description "Suggest a command using GitHub Copilot"
|
||||
argparse --name=suggest \
|
||||
'd/debug' \
|
||||
'h/help' \
|
||||
'hostname=' \
|
||||
't/target=' \
|
||||
-- $argv
|
||||
or return 1
|
||||
|
||||
if set -q _flag_help
|
||||
echo "Wrapper around \`copilot\` to suggest a command."
|
||||
echo "Places suggested command on the command line for review/editing."
|
||||
echo
|
||||
echo "USAGE"
|
||||
echo " suggest [flags] <prompt>"
|
||||
echo
|
||||
echo "FLAGS"
|
||||
echo " -d, --debug Enable debugging"
|
||||
echo " -h, --help Display help usage"
|
||||
echo " --hostname HOST GitHub host for authentication"
|
||||
echo " -t, --target TARGET Target: shell (default), gh, git"
|
||||
echo
|
||||
echo "EXAMPLES"
|
||||
echo " suggest"
|
||||
echo " suggest -t git 'Undo the most recent local commits'"
|
||||
echo " suggest -t gh 'Create pull request'"
|
||||
echo " suggest 'Convert MOV to animated PNG'"
|
||||
return 0
|
||||
end
|
||||
|
||||
copilot -p "suggest: $argv" --allow-all-tools
|
||||
end
|
||||
Reference in New Issue
Block a user