tom-doerr / zsh_codex Goto Github PK
View Code? Open in Web Editor NEWThis is a ZSH plugin that enables you to use OpenAI's Codex AI in the command line.
License: MIT License
This is a ZSH plugin that enables you to use OpenAI's Codex AI in the command line.
License: MIT License
Hello,
I'm MB. A very nice and polite guy.
Feature request:
A bash version : )
This is going to happen you know and it will be the biggest thing that ever happened to the Linux terminal.
3573829478367
Steps done to install zsh_codex
1.) Installed openai using pip install openai
2.) Clone the repo with the given link, in my custom dir.
3.) Added source "$ZSH_CUSTOM/plugins/zsh_codex/zsh_codex.plugin.zsh"
to my .zshrc
4.) Created openaipirc with the secrets generated from https://beta.openai.com/account/api-keys
With default settings, the suggestions are often hit or miss.
Using lower temperature should fix that.
The engine name here should be text-davinci-002
Love what you've done here. Good job!
I seem to be getting this error ๐ค
I think it's a python env issue but I'm not sure?
โ v6 git:(feature/DDA-2350-V6-components) โ # testTraceback (most recent call last):
File "/Users/lopu/.oh-my-zsh/custom/plugins/zsh_codex/create_completion.py", line 3, in <module>
from openai import OpenAI
ModuleNotFoundError: No module named 'openai'
zsh-autosuggestions is able to provide a tab-autocompletion preview based on the .zsh_history
:
Something similar would be useful for this plugin: This way, one could accept codex completions using <TAB>
or discard them with any other key.
Hello @tom-doerr and all! Thank you for this extension!
I see the completion was implemented in python and this is the great opportunity to create Codex extension for the python-powered https://xon.sh shell!
How to do it:
So you can create xontrib-codex
for xonsh shell. It will be cool!
Thanks!
โฌ๏ธ Please click the ๐ reaction instead of leaving a +1
or ๐ comment
I'm getting the error in title. org_id & secret_key are correct, but I still get the error immediately after pressing ^X.
Anyone else experiences that?
Maybe I'm just missing something here, but I can't seem to figure out how to acutally have zsh execute whatever codex comes up with, upon pressing enter, it complains about the # and if I press Ctrl+x again, it just generates more commands.
https://user-images.githubusercontent.com/65448408/139941453-7a4974c5-028c-4cfb-b9f6-4c59be16f42d.mp4
When trying to run I get:
echo Traceback (most recent call last): File "/home/tc/.oh-my-zsh/custom/plugins/zsh_codex/create_completion.py", line 67, in <module> response = openai.Completion.create(engine='davinci-codex', prompt=input_prompt, temperature=0.5, max_tokens=32, stream=STREAM) File "/home/tc/.local/lib/python3.9/site-packages/openai/api_resources/completion.py", line 31, in create return super().create(*args, **kwargs) File "/home/tc/.local/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 66, in create response, _, api_key = requestor.request( File "/home/tc/.local/lib/python3.9/site-packages/openai/api_requestor.py", line 129, in request resp = self.interpret_response(rbody, rcode, rheaders, stream=stream) File "/home/tc/.local/lib/python3.9/site-packages/openai/api_requestor.py", line 348, in interpret_response return self.interpret_response_line(rbody, rcode, rheaders, stream) File "/home/tc/.local/lib/python3.9/site-packages/openai/api_requestor.py", line 367, in interpret_response_line raise self.handle_error_response( openai.error.AuthenticationError: No such organization: Personal.
thanks
Hi,
I'm a python developer who work with multiple python environments (at least one per project). I did not want to install openai in each environment.
Maybe you could create python package in place of create_completion.py
that could be installed with pipx
?
N
I'm trying to get it works.
Everything seems to be well configured, but when I'm trying to get some feedback... you can see behavior here.
This is my related .zshrc
related configuration:
plugins=(git zsh-syntax-highlighting zsh-autosuggestions history z kubectl kube-aliases docker helm zsh_codex)
zle -N create_completion
bindkey '^X' create_completion
Also, here my ~/.config/open
:
[openai]
organization_id = <org_...>
secret_key = <secret_key>
I rushed and tried this out. Failed. In so many attempt and even couple of hack-ish methods (I even worked it out without changing anything significantly, just building a bridge between zsh_codex (a base_url injection made) - litellm (simple proxy) - ollama (A nice model was running). As you can imagine where I am now, they didn't work out too.
Since, I'm something of a Data Scientist myself, I gathered my mind and simply test out some methods to get a really nice output. Man, I tried couple of things and after some python packaging issues, I succeded on something and pushed.
It would be great to collaborate and work together, I have a million ideas about this fork.
Thank you for your all hard work and time (to @tom-doerr and to all contributors).
Thanks!
Is this suppose to be my login to open ai API?
As the title says, there is always an extra line before suggestion.
So when I execute code from demo GIF, I get the following:
As can be seen, there is an extra line before suggestion
This is particularly annoying when trying to complete the current command, since it inserts completion on a new line.
Hi. This looks like a fantastic idea and I'd like to try it out but I'm currently using fish. Would it be possible to port this as a plugin for Fisher or OMF?
Please add support for zinit plugin system: https://github.com/zdharma-continuum/zinit. Thanks a lot for this amazing project!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.