diff options
| author | Johannes Bittner <johannes.bittner@gmail.com> | 2023-09-04 13:48:19 +0200 |
|---|---|---|
| committer | Johannes Bittner <johannes.bittner@gmail.com> | 2023-09-04 13:48:19 +0200 |
| commit | 28f602902e2b437ce52871e65057d11891ee7f77 (patch) | |
| tree | dbad65789bed1558124264a3719e002d0cb5f4f6 /src/_chatblade | |
| parent | Merge pull request #1033 from zsh-users/add-supervisord (diff) | |
| download | zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.tar zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.tar.gz zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.tar.bz2 zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.tar.lz zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.tar.xz zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.tar.zst zsh-completions-28f602902e2b437ce52871e65057d11891ee7f77.zip | |
Add completion script for chatblade
Diffstat (limited to 'src/_chatblade')
| -rw-r--r-- | src/_chatblade | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/_chatblade b/src/_chatblade new file mode 100644 index 0000000..ac76a62 --- /dev/null +++ b/src/_chatblade @@ -0,0 +1,57 @@ +#compdef chatblade +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for chatblade (https://github.com/npiv/chatblade) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Johannes Bittner (https://github.com/johannes87) +# +# ------------------------------------------------------------------------------ + +_chatblade() { + local -a args + + args+=( + '(-h --help)'{-h,--help}'[show this help message and exit]' + '--openai-api-key[the OpenAI API key can also be set as env variable OPENAI_API_KEY]' + '--temperature[temperature (openai setting)]' + '(-c --chat-gpt)'{-c,--chat-gpt}'[chat GPT model 3.5/4 shorthand or full qualified model name, can also be set via e + variable OPENAI_API_MODEL]' + '(-i --interactive)'{-i,--interactive}'[start an interactive chat session. This will implicitly continue the + conversation]' + '(-s --stream)'{-s,--stream}'[Stream the incoming text to the terminal]' + '(-t --tokens)'{-t,--tokens}'[display what *would* be sent, how many tokens, and estimated costs]' + '(-p --prompt-file)'{-p,--prompt-file}'[prompt name - will load the prompt with that name at ~/.config/chatblade/nam + or a path to a file]:prompt file:_files' + '(-e --extract)'{-e,--extract}'[extract content from response if possible (either json or code block)]' + '(-r --raw)'{-r,--raw}'[print session as pure text, dont pretty print or format]' + '(-n --no-format)'{-n,--no-format}'[do not add pretty print formatting to output]' + '(-o --only)'{-o,--only}'[Only display the response, omit query]' + '--theme[Set the theme for syntax highlighting see https://pygments.org/styles/, can also be set with + CHATBLADE_THEME]:theme:_values "theme" default emacs friendly manni monokai' + '(-l --last)'{-l,--last}'[alias for -S last, the default session if none is specified]' + '(-S --session)'{-S,--session}'[initiate or continue named session]:session:->sessions' + '--session-list[list sessions]' + '--session-path[show path to session file]' + '--session-dump[dump session to stdout]' + '--session-delete[delete session]' + '--session-rename[rename session]:new session:->sessions' + ) + + case $state in + (sessions) + local -a sessions + sessions=("${(@f)$(chatblade --session-list)}") + _describe 'session' sessions + ;; + esac + + _arguments -s $args +} + +_chatblade |
