From 3f25128f8934c64447ef519ea42cb8ea0142b4fa Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sat, 23 Mar 2024 22:47:41 +0100 Subject: [PATCH] feat: Add zsh-copilot help --- README.md | 5 +++++ zsh-copilot.plugin.zsh | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 2e860d3..6171270 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,11 @@ export OPENAI_API_KEY= I tried out using `gpt-3` but the results were garbage. +To see available configurations, run: + +```sh +zsh-copilot --help + ## Usage Type in your command or your message and press `CTRL + Z` to get your suggestion! diff --git a/zsh-copilot.plugin.zsh b/zsh-copilot.plugin.zsh index c5f461e..a2bfba1 100644 --- a/zsh-copilot.plugin.zsh +++ b/zsh-copilot.plugin.zsh @@ -64,6 +64,15 @@ function _suggest_ai() { 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 bindkey $ZSH_COPILOT_KEY _suggest_ai