summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-10-14 18:20:07 +0800
committerGitHub <noreply@github.com>2024-10-14 18:20:07 +0800
commitaaea0ff7029356108c59198fbbad505277a7c05e (patch)
tree6af3839da4e576c2cf622e398746b37e4e73225b /scripts
parent349c23647284b3a2cd3cc3fda4d02bb43fc38acf (diff)
downloadaichat-aaea0ff7029356108c59198fbbad505277a7c05e.tar.gz
feat: add CLI option `--empty-session` (#922)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/completions/aichat.bash2
-rw-r--r--scripts/completions/aichat.fish3
-rw-r--r--scripts/completions/aichat.nu3
-rw-r--r--scripts/completions/aichat.ps13
-rw-r--r--scripts/completions/aichat.zsh3
5 files changed, 9 insertions, 5 deletions
diff --git a/scripts/completions/aichat.bash b/scripts/completions/aichat.bash
index 9b6a462..260a9d4 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 -R -e -c -f -S -h -V --model --prompt --role --session --save-session --agent --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 -R -e -c -f -S -h -V --model --prompt --role --session --empty-session --save-session --agent --rag --serve --execute --code --file --no-stream --dry-run --info --list-models --list-roles --list-sessions --list-agents --list-rags --help --version"
if [[ ${cur} == -* || ${cword} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
diff --git a/scripts/completions/aichat.fish b/scripts/completions/aichat.fish
index 90c17f0..f5b2576 100644
--- a/scripts/completions/aichat.fish
+++ b/scripts/completions/aichat.fish
@@ -2,7 +2,8 @@ complete -c aichat -s m -l model -x -a "(aichat --list-models)" -d 'Select a LLM
complete -c aichat -l prompt -d 'Use the system prompt'
complete -c aichat -s r -l role -x -a "(aichat --list-roles)" -d 'Select a role' -r
complete -c aichat -s s -l session -x -a"(aichat --list-sessions)" -d 'Start or join a session' -r
-complete -c aichat -l save-session -d 'Forces the session to be saved'
+complete -c aichat -l empty-session -d 'Ensure the session is empty'
+complete -c aichat -l save-session -d 'Force the session to be saved'
complete -c aichat -s a -l agent -x -a"(aichat --list-agents)" -d 'Start a agent' -r
complete -c aichat -s R -l rag -x -a"(aichat --list-rags)" -d 'Start a RAG' -r
complete -c aichat -l serve -d 'Serve the LLM API and WebAPP'
diff --git a/scripts/completions/aichat.nu b/scripts/completions/aichat.nu
index dcd7043..22b3d31 100644
--- a/scripts/completions/aichat.nu
+++ b/scripts/completions/aichat.nu
@@ -40,7 +40,8 @@ module completions {
--prompt # Use the system prompt
--role(-r): string@"nu-complete aichat role" # Select a role
--session(-s): string@"nu-complete aichat session" # Start or join a session
- --save-session # Forces the session to be saved
+ --empty-session # Ensure the session is empty
+ --save-session # Force the session to be saved
--agent(-a): string@"nu-complete aichat agent" # Start a agent
--rag(-R): string@"nu-complete aichat rag" # Start a RAG
--serve # Serve the LLM API and WebAPP
diff --git a/scripts/completions/aichat.ps1 b/scripts/completions/aichat.ps1
index 2f30bd1..025427e 100644
--- a/scripts/completions/aichat.ps1
+++ b/scripts/completions/aichat.ps1
@@ -27,7 +27,8 @@ Register-ArgumentCompleter -Native -CommandName 'aichat' -ScriptBlock {
[CompletionResult]::new('--role', '--role', [CompletionResultType]::ParameterName, 'Select a role')
[CompletionResult]::new('-s', '-s', [CompletionResultType]::ParameterName, 'Start or join a session')
[CompletionResult]::new('--session', '--session', [CompletionResultType]::ParameterName, 'Start or join a session')
- [CompletionResult]::new('--save-session', '--save-session', [CompletionResultType]::ParameterName, 'Forces the session to be saved')
+ [CompletionResult]::new('--empty-session', '--empty-session', [CompletionResultType]::ParameterName, 'Ensure the session is empty')
+ [CompletionResult]::new('--save-session', '--save-session', [CompletionResultType]::ParameterName, 'Force the session to be saved')
[CompletionResult]::new('-a', '-a', [CompletionResultType]::ParameterName, 'Start a agent')
[CompletionResult]::new('--agent', '--agent', [CompletionResultType]::ParameterName, 'Start a agent')
[CompletionResult]::new('-R', '-R', [CompletionResultType]::ParameterName, 'Start a RAG')
diff --git a/scripts/completions/aichat.zsh b/scripts/completions/aichat.zsh
index 62434a4..c13cb70 100644
--- a/scripts/completions/aichat.zsh
+++ b/scripts/completions/aichat.zsh
@@ -22,7 +22,8 @@ _aichat() {
'--role[Select a role]:ROLE:->roles' \
'-s[Start or join a session]:SESSION:->sessions' \
'--session[Start or join a session]:SESSION:->sessions' \
-'--save-session[Forces the session to be saved]' \
+'--empty-session[Ensure the session is empty]' \
+'--save-session[Force the session to be saved]' \
'-a[Start a agent]:AGENT:->agents' \
'--agent[Start a agent]:AGENT:->agents' \
'-R[Start a RAG]:RAG:->rags' \