Giter Club home page Giter Club logo

gpt-bash's Introduction

gpt - OpenAI API client

Note

Early version; examples and options subject to change.

Versatile OpenAI API client in Bash. Append text queries, files, images, screenshots and stdin as separate message modules to the payload, with minimal limitation. Dry run to inspect payload.

Dependencies:

Install

git clone [email protected]:fredfoss/gpt-bash.git
cd gpt-bash
make install

gpt will be copied to ~/.local/bin/. Remember to add directory to path. Example, in ~/.bashrc:

export PATH=$HOME/.local/bin:$PATH

Then, set the OPENAI_API_KEY environment variable with your API key. Example, in ~/.bashrc:

export OPENAI_API_KEY=sk-proj....HB7WOAPmt

If you don't want to make it an environment variable, you could instead store the key in pass. Add the key to pass, then in ~/.bashrc something like:

alias gpt='OPENAI_API_KEY=$(pass openai.com/api-key) gpt'

Usage

usage:
    gpt [options] [query]

options:
    -q <query>    add additional query to payload
    -f <file>     add file as additional query
    -i <image>    add PNG image file to payload
    -p            add screenshot to payload
    -d            dry-run mode, don't call API
    -h            print help

Examples

gpt what is the zig language?
gpt -p what is the object in this screenshot
gpt compare provided images -i path/to/img1.png -i path/to/img2.png
gpt -f file/with/userinput.c explain this code
gpt -q first query -q "then the second" and finally the third

Related environment variables

  • OPENAI_API_KEY
  • OPENAI_API_MODEL
  • OPENAI_API_TEMP
  • OPENAI_API_MAX_TOKENS

TODO

  • Support article urls?
  • Support youtube urls?
  • Support other image formats beside png?
  • Remember conversation?
  • System prompt option: gpt -s new system prompt
  • Check if API key is set
  • Temperature option: gpt -t 0.5
  • Finish Makefile
  • MacOS patch
  • Linux X11 patch

gpt-bash's People

Contributors

fredfoss avatar

Stargazers

 avatar

Watchers

 avatar

gpt-bash's Issues

API_KEY variable used

Seems like API_KEY variable is used instead of OPENAI_API_KEY as stated in the README

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.