feat: Add zsh-copilot help

This commit is contained in:
Myzel394 2024-03-23 22:47:41 +01:00
parent 1ae48aeb1e
commit 3f25128f89
No known key found for this signature in database
GPG Key ID: DEC4AAB876F73185
2 changed files with 14 additions and 0 deletions

View File

@ -29,6 +29,11 @@ export OPENAI_API_KEY=<your-api-key>
I tried out using `gpt-3` but the results were garbage. I tried out using `gpt-3` but the results were garbage.
To see available configurations, run:
```sh
zsh-copilot --help
## Usage ## Usage
Type in your command or your message and press `CTRL + Z` to get your suggestion! Type in your command or your message and press `CTRL + Z` to get your suggestion!

View File

@ -64,6 +64,15 @@ function _suggest_ai() {
fi fi
} }
function zsh-copilot() {
echo "ZSH Copilot is now active. Press $ZSH_COPILOT_KEY to get suggestions."
echo ""
echo "Configurations:"
echo " - ZSH_COPILOT_KEY: Key to press to get suggestions (default: ^z, value: $ZSH_COPILOT_KEY)."
echo " - ZSH_COPILOT_SEND_CONTEXT: If \`true\`, zsh-copilot will send context information (whoami, shell, pwd, etc.) to the AI model (default: true, value: $ZSH_COPILOT_SEND_CONTEXT)."
echo " - ZSH_COPILOT_SEND_GIT_DIFF: If \`true\`, zsh-copilot will send the git diff (if available) to the AI model (default: true, value: $ZSH_COPILOT_SEND_GIT_DIFF)."
}
zle -N _suggest_ai zle -N _suggest_ai
bindkey $ZSH_COPILOT_KEY _suggest_ai bindkey $ZSH_COPILOT_KEY _suggest_ai