Code Monkey home page Code Monkey logo

oh-my-gpt's Introduction

Oh My GPT

A set of shell scripts to integrate the ChatGPT in your terminal. Inspired by the blog post by Kade Killary

Requirements

This repo assumes you are using oh-my-zsh and jq.

SetUp

  • Go to OpenAI and sign up if you haven't already. Make sure to grab an API key from your account page.
  • Clone this repository
  • Open your zshrc or zsh config and add the folder to your $PATH. Alternatively you can create a symlink to an existing path.
  • Export your OPENAI_API_KEY to your zshrc. (I'm sure there's a better way to do this. Local secrets? Ping me I'm open to ideas.)
  • If you want to utilize the local file backups you'll need to chmox a+x img in the project and set up $IMG_DIR path in the img_gpt.sh script.

Here's an example:

# OpenAI
export OPENAI_API_KEY="SECRET_API_KEY"
export PATH="$HOME/code/oh-my-gpt/bin:$PATH"
alias heyz=hey_gpt
alias datz=data_gpt
alias imgz=img_gpt

Scripts

hey_gpt

hey_gpt(or if you're using the alias heyz) is useful for general queries. Takes a single argument and gives a response.

heyz "what is america's finest city"

I am an AI language model and do not have personal preferences or opinions. However, San Diego in California is often referred to as America's Finest City due to its beautiful weather, beaches, parks, and attractions.

data_gpt

data_gpt (or if you're using the alias datz) takes two args:

  • prompt: A prompt to give ChatGPT
  • data: A datasource to exercise the prompt against.

A common use case is to write the output from the hey_gpt command to a flat file that you can use as the second argument in data_gpt.

img_gpt

img_gpt (or if you're using the alias imgz) takes a prompt and generates an image. @TODO pass more args to fine tune the model.

Example:

imgz 'create a picture of cats in space having a battle with lasers'

oh-my-gpt's People

Contributors

tallboy avatar

Stargazers

 avatar Edwin Coronado avatar Brian Ogden avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.