summaryrefslogtreecommitdiffstats
path: root/scripts/completions/aichat.nu
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-13 19:50:10 +0800
committerGitHub <noreply@github.com>2024-04-13 19:50:10 +0800
commit1c3e81afe9f63fb47303384a82c7239458166f52 (patch)
tree85d89be89fe9347cf4e8b8cbf30993e5d85c38f8 /scripts/completions/aichat.nu
parent568e9a06db7189a28f9346802356b3fd4bdf921b (diff)
downloadaichat-1c3e81afe9f63fb47303384a82c7239458166f52.tar.gz
feat: add completion scripts (#411)
Diffstat (limited to 'scripts/completions/aichat.nu')
-rw-r--r--scripts/completions/aichat.nu50
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/completions/aichat.nu b/scripts/completions/aichat.nu
new file mode 100644
index 0000000..19b382e
--- /dev/null
+++ b/scripts/completions/aichat.nu
@@ -0,0 +1,50 @@
+module completions {
+
+ def "nu-complete aichat completions" [] {
+ [ "bash" "zsh" "fish" "powershell" "nushell" ]
+ }
+
+ def "nu-complete aichat model" [] {
+ ^aichat --list-models |
+ | lines
+ | parse "{value}"
+ }
+
+ def "nu-complete aichat role" [] {
+ ^aichat --list-roles |
+ | lines
+ | parse "{value}"
+ }
+
+ def "nu-complete aichat session" [] {
+ ^aichat --list-sessions |
+ | lines
+ | parse "{value}"
+ }
+
+ # All-in-one chat and copilot CLI that integrates 10+ AI platforms
+ export extern aichat [
+ --model(-m): string@"nu-complete aichat model" # Choose a LLM model
+ --role(-r): string@"nu-complete aichat role" # Choose a role
+ --session(-s): string@"nu-complete aichat role" # Create or reuse a session
+ --save-session # Whether to save the session
+ --execute(-e) # Execute commands using natural language
+ --code(-c) # Generate only code
+ --file(-f): string # Attach files to the message
+ --no-highlight(-H) # Disable syntax highlighting
+ --no-stream(-S) # No stream output
+ --wrap(-w): string # Specify the text-wrapping mode (no, auto, <max-width>)
+ --light-theme # Use light theme
+ --dry-run # Run in dry run mode
+ --info # Print related information
+ --list-models # List all available models
+ --list-roles # List all available roles
+ --list-sessions # List all available sessions
+ ...text: string # Input text
+ --help(-h) # Print help
+ --version(-V) # Print version
+ ]
+
+}
+
+export use completions *