mirror of
https://github.com/Myzel394/zsh-copilot.git
synced 2025-06-18 20:55:26 +02:00
feat: Add zsh-copilot help
This commit is contained in:
parent
1ae48aeb1e
commit
3f25128f89
@ -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!
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user