Giter Site home page Giter Site logo

rajivraghu / gptcli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evilpan/gptcli

0.0 0.0 0.0 659 KB

ChatGPT in command line with gpt-3.5-turbo api

Home Page: https://platform.openai.com/docs/introduction

License: GNU General Public License v2.0

Python 97.88% Dockerfile 2.12%

gptcli's Introduction

Take chatGPT into command line.

stream

Setup

  1. clone this repo
  2. pip3 install -U -r requirements.txt
  3. get your apikey from https://platform.openai.com/account/api-keys and put it in .key

Run

$ ./gptcli.py -h
usage: gptcli.py [-h] [-r] [-k KEY] [-p PROXY]

options:
  -h, --help  show this help message and exit
  -n          query openai in non-stream mode (default: False)
  -r          attach server response in request prompt, consume more tokens to get better results (default: False)
  -k KEY      path to api_key (default: .key)
  -p PROXY    http/https proxy to use (default: None)

Console help (with tab-complete):

$ ./gptcli.py
Input: -h
usage: Input [-help] [-reset] [-exit] [-multiline]

options:
  -help       show this help message
  -reset      reset session, i.e. clear chat history
  -exit       exit console
  -multiline  input multiple lines, end with ctrl-d(Linux/macOS) or ctrl-z(Windows). cancel with ctrl-c

Run in Docker:

# build
$ docker build -t gptcli:latest .

# run
$ docker run -it --rm -v $PWD/.key:/gptcli/.key gptcli:latest -h

# for host proxy access:
$ docker run --rm -it -v $PWD/.key:/gptcli/.key --network host gptcli:latest -rp socks5://127.0.0.1:1080

Feature

  • Session based
  • Markdown support
  • Syntax highlight
  • Proxy support
  • Multiline input
  • Stream output

LINK

gptcli's People

Contributors

evilpan avatar 6r6 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.