Giter VIP home page Giter VIP logo

ai-bash-gpt's Introduction

AI - a commandline ChatGPT (3.5/4) client in BASH with conversation/completion and image generation support

Features:

  • Interactive chat sessions with OpenAI gpt-3.5-turbo and gpt-4 completion API endpoint models (aka ChatGPT/ChatGPT4) -- note: ChatGPT4 currently requires an API key from a paid OpenAI plan to work

  • Multiline input

  • Image generation support:

    • image preview grid rendered directly in the terminal

    • generate up to 10 images at a time

    • automatic URL shortening

    • optionally save images and prompt to local disk

  • Markdown support for replies (requires glow)

  • One shot Q&A with optional follow-up conversation

  • Data piping support (sending file contents to ChatGPT)

  • Full conversation support:

    • locally store unlimited conversations (in JSON format)

    • quick resume last conversation

    • delete/resume any stored conversation

    • conversation messages replay on resume

    • store current and start new conversation (reset history) during interactive sessions

    • Automatic conversation topic identification and update

Full command line options (ai -h):

  • Note: the -4 optional parameter switches to GPT-4 model.
Start a new interactive conversation:

ai [-4]

One shot Q&A (will ask you to continue interacting, otherwise quit after answer):

ai [-4] "how many planets are there in the solar system?"

Generate one or more images (default 1, max 10):

ai -i [num] "a cute cat"

Submit data as part of the question:

cat file.txt | ai [-4] can you summarize the contents of this file?

List saved conversations:

ai -l

Continue last conversation:

ai [-4] -c

Continue specific conversation:

ai [-4] -c <conversation_id>

Delete a specific conversation:

ai -d <conversation_id>

Delete selected conversations:

ai -d <conversation_id_start>-<conversation_id_end>

Delete all conversations:

rm "$HOME/conversations.json"

Usage examples:

(Interaction and conversation resuming)

asciicast

(Image generation)

asciicast

(Input piping to stdin)

asciicast

Installation:

Prerequisites:
  • Install jq, curl, imagemagick, catimg

    • for e.g. Ubuntu: apt -y install jq curl imagemagick catimg
  • Install glow for Markdown rendering support in your terminal

Script download:

Install the script by either cloning this repository or directly downloading to your $PATH, e.g.:

curl "https://raw.githubusercontent.com/nitefood/ai-bash-gpt/master/ai" > /usr/bin/ai && chmod 0755 /usr/bin/ai

ai-bash-gpt's People

Contributors

nitefood 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.