Table of Contents
Heavily inspired by the abandoned project https://github.com/microsoft/Codex-CLI Made into a oh-my-zsh plugin.
In your zsh console, type a question, starting with comment sign #
, hit ctrl+g
and get an answer.
Tip
New in v. 1.2.0 Use doble ##
to use gpt-4 model.
# Who edited README.MD last according to git history?
ChatGPT will then answer with e.g.:
git log -1 --format="%an" README.md
Hit enter
to execute or ctrl+c
to deny.
If asked a question that will not resolve in a command, GPT is instructed to use #
.
# Who was Norways first prime minister?
# Norway's first prime minister was Frederik Stang, serving from 1873 to 1880.
First install zshgpt application, then add the plugin.
Warning
Valid Openai API-key
make sure to save under OPENAI_API_KEY
env.
export OPENAI_API_KEY='sk-...'
Snap comes preinstalled and is probalby the fastest way if you are on Linux and do not want to use pipx.
- snap
sudo snap install zshgpt
Instructions if you don't have snap.
- python >= 3.8
- pipx
pipx install zshgpt
- python >= 3.8
- pip
pip install zshgpt
This is not yet automated and you might get an older version.
- Homebrew
brew install AndersSteenNilsen/zshgpt/zshgpt
curl https://raw.githubusercontent.com/AndersSteenNilsen/zshgpt/main/zshgpt.plugin.zsh -o ~ # Copy plugin
echo "source ~/zshgpt.plugin.zsh" >> ~/.zshrc # Add to zshrc
exec zsh # Reload zsh
mkdir $ZSH_CUSTOM/plugins/zshgpt
curl https://raw.githubusercontent.com/AndersSteenNilsen/zshgpt/main/zshgpt.plugin.zsh -o $ZSH_CUSTOM/plugins/zshgpt/zshgpt.plugin.zsh
Then add zshgpt in your list of plugins in ~/.zshrc
plugins(
...
zshgpt
...
)
omz reload
~/.zshrc
...
zplug "AndersSteenNilsen/zshgpt"
zplug load
pipx install hatch
More information: https://hatch.pypa.io/dev/install/hatch shell
- You now should have everything installed.
Made with DALL-E
zshgpt
is distributed under the terms of the MIT license.