AI in the command line.
You just need to write a comment or variable name and the AI will write the corresponding code.
This is a ZSH plugin that enables you to use OpenAI's powerful AI in the command line. OpenAI is the AI that also powers GitHub Copilot.
- Install the OpenAI package.
pip3 install openai
- Download the ZSH plugin.
git clone https://github.com/alexclaz/zsh_openai.git ~/.oh-my-zsh/custom/plugins/zsh_openai
- Add the following to your
.zshrc
file.
Using oh-my-zsh:
plugins=(zsh_openai)
bindkey '^X' create_completion
Without oh-my-zsh:
# in your/custom/path you need to have a "plugins" folder and in there you clone the repository as zsh_openai
export ZSH_CUSTOM="your/custom/path"
source "$ZSH_CUSTOM/plugins/zsh_openai/zsh_openai.plugin.zsh"
bindkey '^X' create_completion
- Create a file called
openaiapirc
in~/.config
with your ORGANIZATION_ID and SECRET_KEY.
[openai]
organization_id = ...
secret_key = ...
- Run
zsh
, start typing and complete it using^X
!