A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

Related tags

CLI Tools zsh_codex
Overview

⌨️ 🦾 Zsh Codex

AI in the command line.

Repository's starts Issues License
Latest commit GitHub repository size

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?

  1. Download the ZSH plugin.
    $ git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/plugins/ 
  1. Add the following to your .zshrc file.
    plugins=(zsh_codex)
    bindkey '^X' create_completion
  1. Create a file called openaiapirc in ~/.config with your ORGANIZATION_ID and SECRET_KEY.
[openai]
organization_id = ...
secret_key = ...
  1. Run zsh, start typing and complete it using ^X!
Comments
  • Invalid Request error - Engine not found

    Invalid Request error - Engine not found

    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

    image
    opened by stonelazy 2
  • Port to fish shell?

    Port to fish shell?

    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?

    opened by DarremMolko 2
  • Execute generated command

    Execute generated command

    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

    opened by fischer-felix 2
  • No such organization: Personal.

    No such organization: Personal.

    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.

    opened by tomc98 2
  • Add Fig as an installation method to the README

    Add Fig as an installation method to the README

    We recently listed Zsh Codex in Fig Plugin Store, so we'd love to have Fig listed as a download method on your readme. We have over 100k users that will benefit from this.

    Thanks so much and please let me know if you have any questions!

    opened by ibayramli 1
  • Fix the git clone command for the plugin

    Fix the git clone command for the plugin

    The git clone command may throw errors like:

    $ git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/
    fatal: destination path '/home/$USER/.oh-my-zsh/custom/plugins' already exists and is not an empty directory.
    

    Adding the full path helps to mitigate this problem.

    opened by RafaelMoreira1180778 1
  • Install instructions for use without oh-my-zsh

    Install instructions for use without oh-my-zsh

    Since oh-my-zsh basically just sources the plugin file, we can do that manually as well. Also states clearly that one needs oh-my-zsh for the original install method.

    opened by clotodex 0
  • feat: replace openai with llmhub

    feat: replace openai with llmhub

    Summary

    This PR integrates LLMHub. This integration allows users to get started right away (1-click!), and automatically integrates all relevant LLM providers without requiring users to set up API keys with each. Additionally we provide various tools to make it easier to improve its accuracy/latency/costs (via tools for finetuning & prompt engineering).

    A user would only need to do the following to get started:

    pip3 install llmhub
    # llmhub was globally installed as part of previous command.
    llmhub auth
    

    llmhub auth points users to a webpage where they need to sign in via GitHub. That's it!

    Features

    :massage: Allow users to use your app in 1-click.

    :computer: Deploy in 1-click.

    :haircut: Integrate ANY LLM in 3-lines with a standardised API.

    :wrench: Monitor and improve your prompts.

    :earth_americas: Discover new prompts easily, and showcase your work.

    :muscle: Contribute to popular prompts, and improve your skills.

    :dollar: Free credits while we're in beta

    Some things to note

    • The current prompts are deployed to be an exact replica of existing code (models & parameters like temperature/frequency_penalty). Easy to edit.
    • We'd love to keep this LLM work public/open-source. Is that OK?

    About Us

    We're @vatsalaggarwal and @sidroopdaska. @sidroopdaska was the second engineering hire at the largest autonomous driving company in Europe, and I was an ML Scientist at Amazon for 4 years and researched deep generative models!

    opened by vatsalaggarwal 1
  • I'm not getting feedback

    I'm not getting feedback

    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>
    
    opened by jeusdi 1
  • Feature Request: Preview completions like zsh-autosuggestions

    Feature Request: Preview completions like zsh-autosuggestions

    zsh-autosuggestions is able to provide a tab-autocompletion preview based on the .zsh_history:

    tab-completion

    Something similar would be useful for this plugin: This way, one could accept codex completions using <TAB> or discard them with any other key.

    opened by hashworks 2
  • Make it possible to use in mulitiple python environment

    Make it possible to use in mulitiple python environment

    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?

    opened by Czaki 2
  • No such model: code-davinci-002

    No such model: code-davinci-002

    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?

    opened by kwanUm 2
Owner
Tom Dörr
Tom Dörr
Yet another bash/zsh prompt script

Here we have yet another script for Git-aware customization of the command prompt in Bash and zsh. Unlike all the other scripts, I wrote this one, so

John T. Wodder II 5 Oct 13, 2021
gget is a free and open-source command-line tool and Python package that enables efficient querying of genomic databases.

gget is a free and open-source command-line tool and Python package that enables efficient querying of genomic databases. gget consists of a collection of separate but interoperable modules, each designed to facilitate one type of database querying in a single line of code.

Pachter Lab 570 Dec 29, 2022
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Stream your favorite shows straight from the command line.

A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Jonardon Hazarika 17 Dec 11, 2022
Powerful yet easy command line calculator.

Powerful yet easy command line calculator.

Cruisen 1 Jul 22, 2022
A cd command that learns - easily navigate directories from the command line

NAME autojump - a faster way to navigate your filesystem DESCRIPTION autojump is a faster way to navigate your filesystem. It works by maintaining a d

William Ting 14.5k Jan 3, 2023
AML Command Transfer. A lightweight tool to transfer any command line to Azure Machine Learning Services

AML Command Transfer (ACT) ACT is a lightweight tool to transfer any command from the local machine to AML or ITP, both of which are Azure Machine Lea

Microsoft 11 Aug 10, 2022
Ros command - Unifying the ROS command line tools

Unifying the ROS command line tools One impairment to ROS 2 adoption is that all

null 37 Dec 15, 2022
PdpCLI is a pandas DataFrame processing CLI tool which enables you to build a pandas pipeline from a configuration file.

PdpCLI Quick Links Introduction Installation Tutorial Basic Usage Data Reader / Writer Plugins Introduction PdpCLI is a pandas DataFrame processing CL

Yasuhiro Yamaguchi 15 Jan 7, 2022
git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Partial Submodules for Git git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's

Nathan Reed 15 Sep 22, 2022
Command-line tool to use LNURL with your LND instance

LND LNURL Commandline tool to use LNURL payRequest and withdrawRequest with LND. Usage: Customize config lndlnurl.conf Run python main.py <LNURL> Dock

Djuri Baars 6 Jan 14, 2022
A command-line tool to flash python code to Codey Rocky without having to use the online mblock5 IDE.

What? A command-line tool to flash python code to Codey Rocky without having to use the online mblock5 IDE. Description This is a very low-effort proj

null 1 Dec 29, 2021
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo

pyGinit pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo Requirements Requirements be

AlphaBeta 15 Feb 26, 2022
Collection of useful command line utilities and snippets to help you organise your workspace and improve workflow.

Collection of useful command line utilities and snippets to help you organise your workspace and improve workflow.

Dominik Tarnowski 3 Dec 26, 2021
Tidier - a simple command line tool that helps you make your files tidy up

Tidier - a simple command line tool that helps you make your files tidy up

AmirMohammad Hosseini Nasab 8 Aug 16, 2022
A powerful Minecraft command library.

Mecha A powerful Minecraft command library. from mecha import Mecha

null 32 Dec 10, 2022
A python script that enables a raspberry pi sd card through the CLI and automates the process of configuring network details and ssh.

This project is one script (wpa_helper.py) written in python that will allow for the user to automate the proccess of setting up a new boot disk and configuring ssh and network settings for the pi

Theo Kirby 6 Jun 24, 2021
commandpack - A package of modules for working with commands, command packages, files with command packages.

commandpack Help the project financially: Donate: https://smartlegion.github.io/donate/ Yandex Money: https://yoomoney.ru/to/4100115206129186 PayPal:

null 4 Sep 4, 2021
A Python-based command prompt concept which includes windows command emulation.

PythonCMD A Python-based command prompt concept which includes windows command emulation. Current features: echo: Input your message and it will be cl

null 1 Feb 5, 2022