24
GitHub - tom-doerr/zsh_codex
source link: https://github.com/tom-doerr/zsh_codex
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Zsh Codex
AI in the command line.
You just need to write a comment or variable name and the AI will write the corresponding code.
What is it?
This is a ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line. OpenAI Codex is the AI that also powers GitHub Copilot. To use this plugin you need to get access to OpenAI's Codex API.
How do I install it?
- Install the OpenAI package.
pip3 install openai
- Download the ZSH plugin.
$ git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/
- Add the following to your
.zshrc
file.
plugins=(zsh_codex)
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
!
Troubleshooting
unhandled ZLE widget 'create_completion'
zsh-syntax-highlighting: unhandled ZLE widget 'create_completion'
zsh-syntax-highlighting: (This is sometimes caused by doing `bindkey <keys> create_completion` without creating the 'create_completion' widget with `zle -N` or `zle -C`.)
Add the line
zle -N create_completion
before you call bindkey
but after loading the plugin (plugins=(zsh_codex)
).
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK