Skip to content

codeWithPriyan/chat-cli

Repository files navigation

CLI demo

Table of Contents

Features

  • Experimental support for Bing's version of ChatGPT, powered by GPT-4.
  • Support for the official ChatGPT raw model, text-chat-davinci-002, via OpenAI's API.
  • Includes an API server (with Docker support) you can run to use ChatGPT in non-Node.js applications.
  • Includes a ChatGPTClient and BingAIClient class that you can use in your own Node.js applications.
  • Includes a CLI interface where you can chat with ChatGPT.
  • (ChatGPTClient) Replicates chat threads from the official ChatGPT website (with conversation IDs and message IDs), with persistent conversations using Keyv.
    • Conversations are stored in memory by default, but you can optionally install a storage adapter to persist conversations to a database.
    • The keyv-file adapter is also included in this package, and can be used to store conversations in a JSON file if you're using the API server or CLI (see settings.example.js).
  • (ChatGPTClient) Supports configurable prompt prefixes, and custom names for the user and ChatGPT.
    • In essence, this allows you to turn ChatGPT into a different character.
    • This is currently only configurable on a global level, but I plan to add support for per-conversation customization.

Getting Started

Prerequisites

  • Node.js >= 16.0.0
  • npm
  • Docker (optional, for API server)
  • OpenAI API key

Usage

CLI

Setup

Follow the same setup instructions for the API server, creating settings.js.

Usage

If installed globally:

chatgpt-cli

If installed locally:

npm run cli

ChatGPT's responses are automatically copied to your clipboard, so you can paste them into other applications.

Contributing

If you'd like to contribute to this project, please create a pull request with a detailed description of your changes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors