summaryrefslogtreecommitdiffstats
path: root/scripts/completions/aichat.bash
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2025-01-17 20:06:28 +0800
committerGitHub <noreply@github.com>2025-01-17 20:06:28 +0800
commit30dae5c12b81a6f92be138966d8930fa15612cb0 (patch)
treeecb641bedbe8798d6b477f1036d714b99f1a8081 /scripts/completions/aichat.bash
parent50c60e8097f5148c30295a296063d0fc8391a5f4 (diff)
downloadaichat-30dae5c12b81a6f92be138966d8930fa15612cb0.tar.gz
feat: support macro (#1087)
Diffstat (limited to 'scripts/completions/aichat.bash')
-rw-r--r--scripts/completions/aichat.bash7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/completions/aichat.bash b/scripts/completions/aichat.bash
index c335a6e..4708077 100644
--- a/scripts/completions/aichat.bash
+++ b/scripts/completions/aichat.bash
@@ -17,7 +17,7 @@ _aichat() {
case "${cmd}" in
aichat)
- opts="-m -r -s -a -e -c -f -S -h -V --model --prompt --role --session --empty-session --save-session --agent --agent-variable --rag --rebuild-rag --serve --execute --code --file --no-stream --dry-run --info --list-models --list-roles --list-sessions --list-agents --list-rags --help --version"
+ opts="-m -r -s -a -e -c -f -S -h -V --model --prompt --role --session --empty-session --save-session --agent --agent-variable --rag --rebuild-rag --macro --serve --execute --code --file --no-stream --dry-run --info --list-models --list-roles --list-sessions --list-agents --list-rags --list-macros --help --version"
if [[ ${cur} == -* || ${cword} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -53,6 +53,11 @@ _aichat() {
__ltrim_colon_completions "$cur"
return 0
;;
+ --macro)
+ COMPREPLY=($(compgen -W "$("$1" --list-macros)" -- "${cur}"))
+ __ltrim_colon_completions "$cur"
+ return 0
+ ;;
-f|--file)
local oldifs
if [[ -v IFS ]]; then