summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-24 07:37:50 +0800
committerGitHub <noreply@github.com>2024-06-24 07:37:50 +0800
commitbce2dbecb9a3c524bf3cfdc3ab42f0f34729e76b (patch)
tree21724487c4a9491e3377d4f019178bfb1a6f43d3 /scripts
parentb3bec3cfb0ab75a5dc30dbd55b91e687a3588410 (diff)
downloadaichat-bce2dbecb9a3c524bf3cfdc3ab42f0f34729e76b.tar.gz
refactor: cli help and shell completions (#642)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/completions/aichat.bash2
-rw-r--r--scripts/completions/aichat.fish6
-rw-r--r--scripts/completions/aichat.nu50
-rw-r--r--scripts/completions/aichat.ps112
-rw-r--r--scripts/completions/aichat.zsh12
5 files changed, 41 insertions, 41 deletions
diff --git a/scripts/completions/aichat.bash b/scripts/completions/aichat.bash
index afc81f5..a4ac09e 100644
--- a/scripts/completions/aichat.bash
+++ b/scripts/completions/aichat.bash
@@ -19,7 +19,7 @@ _aichat() {
case "${cmd}" in
aichat)
- opts="-m -r -s -a -R -e -c -f -H -S -w -h -V --model --prompt --role --session --save-session --agent --rag --serve --execute --code --file --no-highlight --no-stream --wrap --light-theme --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 -w -H -h -V --model --prompt --role --session --save-session --agent --rag --serve --execute --code --file --no-stream --wrap --no-highlight --light-theme --dry-run --info --list-models --list-roles --list-sessions --list-agents --list-rags --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
diff --git a/scripts/completions/aichat.fish b/scripts/completions/aichat.fish
index 4a926c9..2bd8cba 100644
--- a/scripts/completions/aichat.fish
+++ b/scripts/completions/aichat.fish
@@ -5,13 +5,13 @@ complete -c aichat -s s -l session -x -a"(aichat --list-sessions)" -d 'Start or
complete -c aichat -l save-session -d 'Forces 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 -s f -l file -d 'Include files with the message' -r -F
-complete -c aichat -s w -l wrap -d 'Control text wrapping (no, auto, <max-width>)'
complete -c aichat -l serve -d 'Serve the LLM API and WebAPP'
complete -c aichat -s e -l execute -d 'Execute commands in natural language'
complete -c aichat -s c -l code -d 'Output code only'
+complete -c aichat -s f -l file -d 'Include files with the message' -r -F
+complete -c aichat -s S -l no-stream -d 'Turn off stream mode'
+complete -c aichat -s w -l wrap -d 'Control text wrapping (no, auto, <max-width>)'
complete -c aichat -s H -l no-highlight -d 'Turn off syntax highlighting'
-complete -c aichat -s S -l no-stream -d 'Turns off stream mode'
complete -c aichat -l light-theme -d 'Use light theme'
complete -c aichat -l dry-run -d 'Display the message without sending it'
complete -c aichat -l info -d 'Display information'
diff --git a/scripts/completions/aichat.nu b/scripts/completions/aichat.nu
index 4a3d189..6c370aa 100644
--- a/scripts/completions/aichat.nu
+++ b/scripts/completions/aichat.nu
@@ -36,31 +36,31 @@ module completions {
# All-in-one chat and copilot CLI that integrates 10+ AI platforms
export extern aichat [
- --model(-m): string@"nu-complete aichat model" # Select a LLM model
- --prompt # Use the system prompt
- --role(-r): string@"nu-complete aichat role" # Select a role
- --session(-s): string@"nu-complete aichat role" # Start or join a session
- --save-session # Forces 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
- --execute(-e) # Execute commands in natural language
- --code(-c) # Output code only
- --file(-f): string # Include files with the message
- --no-highlight(-H) # Turn off syntax highlighting
- --no-stream(-S) # Turns off stream mode
- --wrap(-w): string # Control text wrapping (no, auto, <max-width>)
- --light-theme # Use light theme
- --dry-run # Display the message without sending it
- --info # Display information
- --list-models # List all available chat models
- --list-roles # List all roles
- --list-sessions # List all sessions
- --list-agents # List all agents
- --list-rags # List all RAGs
- ...text: string # Input text
- --help(-h) # Print help
- --version(-V) # Print version
+ --model(-m): string@"nu-complete aichat model" # Select a LLM model
+ --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
+ --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
+ --execute(-e) # Execute commands in natural language
+ --code(-c) # Output code only
+ --file(-f): string # Include files with the message
+ --no-stream(-S) # Turn off stream mode
+ --wrap(-w): string # Control text wrapping (no, auto, <max-width>)
+ --no-highlight(-H) # Turn off syntax highlighting
+ --light-theme # Use light theme
+ --dry-run # Display the message without sending it
+ --info # Display information
+ --list-models # List all available chat models
+ --list-roles # List all roles
+ --list-sessions # List all sessions
+ --list-agents # List all agents
+ --list-rags # List all RAGs
+ ...text: string # Input text
+ --help(-h) # Print help
+ --version(-V) # Print version
]
}
diff --git a/scripts/completions/aichat.ps1 b/scripts/completions/aichat.ps1
index dd0dc9c..37fe5e1 100644
--- a/scripts/completions/aichat.ps1
+++ b/scripts/completions/aichat.ps1
@@ -32,19 +32,19 @@ Register-ArgumentCompleter -Native -CommandName 'aichat' -ScriptBlock {
[CompletionResult]::new('--agent', '--agent', [CompletionResultType]::ParameterName, 'Start a agent')
[CompletionResult]::new('-R', '-R', [CompletionResultType]::ParameterName, 'Start a RAG')
[CompletionResult]::new('--rag', '--rag', [CompletionResultType]::ParameterName, 'Start a RAG')
- [CompletionResult]::new('-f', '-f', [CompletionResultType]::ParameterName, 'Include files with the message')
- [CompletionResult]::new('--file', '--file', [CompletionResultType]::ParameterName, 'Include files with the message')
- [CompletionResult]::new('-w', '-w', [CompletionResultType]::ParameterName, 'Control text wrapping (no, auto, <max-width>)')
- [CompletionResult]::new('--wrap', '--wrap', [CompletionResultType]::ParameterName, 'Control text wrapping (no, auto, <max-width>)')
[CompletionResult]::new('--serve', '--serve', [CompletionResultType]::ParameterName, 'Serve the LLM API and WebAPP')
[CompletionResult]::new('-e', '-e', [CompletionResultType]::ParameterName, 'Execute commands in natural language')
[CompletionResult]::new('--execute', '--execute', [CompletionResultType]::ParameterName, 'Execute commands in natural language')
[CompletionResult]::new('-c', '-c', [CompletionResultType]::ParameterName, 'Output code only')
[CompletionResult]::new('--code', '--code', [CompletionResultType]::ParameterName, 'Output code only')
+ [CompletionResult]::new('-f', '-f', [CompletionResultType]::ParameterName, 'Include files with the message')
+ [CompletionResult]::new('--file', '--file', [CompletionResultType]::ParameterName, 'Include files with the message')
+ [CompletionResult]::new('-S', '-S', [CompletionResultType]::ParameterName, 'Turn off stream mode')
+ [CompletionResult]::new('--no-stream', '--no-stream', [CompletionResultType]::ParameterName, 'Turn off stream mode')
+ [CompletionResult]::new('-w', '-w', [CompletionResultType]::ParameterName, 'Control text wrapping (no, auto, <max-width>)')
+ [CompletionResult]::new('--wrap', '--wrap', [CompletionResultType]::ParameterName, 'Control text wrapping (no, auto, <max-width>)')
[CompletionResult]::new('-H', '-H', [CompletionResultType]::ParameterName, 'Turn off syntax highlighting')
[CompletionResult]::new('--no-highlight', '--no-highlight', [CompletionResultType]::ParameterName, 'Turn off syntax highlighting')
- [CompletionResult]::new('-S', '-S', [CompletionResultType]::ParameterName, 'Turns off stream mode')
- [CompletionResult]::new('--no-stream', '--no-stream', [CompletionResultType]::ParameterName, 'Turns off stream mode')
[CompletionResult]::new('--light-theme', '--light-theme', [CompletionResultType]::ParameterName, 'Use light theme')
[CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'Display the message without sending it')
[CompletionResult]::new('--info', '--info', [CompletionResultType]::ParameterName, 'Display information')
diff --git a/scripts/completions/aichat.zsh b/scripts/completions/aichat.zsh
index 45da3ca..b311f6a 100644
--- a/scripts/completions/aichat.zsh
+++ b/scripts/completions/aichat.zsh
@@ -27,19 +27,19 @@ _aichat() {
'--agent[Start a agent]:AGENT:->agents' \
'-R[Start a RAG]:RAG:->rags' \
'--rag[Start a RAG]:RAG:->rags' \
-'*-f[Include files with the message]:FILE:_files' \
-'*--file[Include files with the message]:FILE:_files' \
-'-w[Control text wrapping (no, auto, <max-width>)]:WRAP: ' \
-'--wrap[Control text wrapping (no, auto, <max-width>)]:WRAP: ' \
'--serve[Serve the LLM API and WebAPP]' \
'-e[Execute commands in natural language]' \
'--execute[Execute commands in natural language]' \
'-c[Output code only]' \
'--code[Output code only]' \
+'*-f[Include files with the message]:FILE:_files' \
+'*--file[Include files with the message]:FILE:_files' \
+'-S[Turn off stream mode]' \
+'--no-stream[Turn off stream mode]' \
+'-w[Control text wrapping (no, auto, <max-width>)]:WRAP: ' \
+'--wrap[Control text wrapping (no, auto, <max-width>)]:WRAP: ' \
'-H[Turn off syntax highlighting]' \
'--no-highlight[Turn off syntax highlighting]' \
-'-S[Turns off stream mode]' \
-'--no-stream[Turns off stream mode]' \
'--light-theme[Use light theme]' \
'--dry-run[Display the message without sending it]' \
'--info[Display information]' \