Skip to content

Bring Chat-GPT to the console. Unleash the power of the OpenAI API directly in the terminal.

License

Notifications You must be signed in to change notification settings

ebenjs/gpt-shell

Repository files navigation

npm version Build Status Known Vulnerabilities License: Apache

The app is a command line client for chat gpt. It allows users to ask gpt questions and receive responses directly in the console. Written in nodejs.

Table of Contents

Prerequisites

gpt-shell is a command line tool that can be installed on any operating system. However, it requires any recent version of Node.js to be installed.

Installation

Choose your preferred installation method below. Unix based systems (Linux, macOS) users can install gpt-shell via the command line with the following scripts:

Automatic install on debian based distros

curl -s https://raw.githubusercontent.com/ebenjs/gpt-shell/main/install-scripts/install-script-deb.sh | sudo bash

Manual install from sources

Common steps

git clone https://github.com/ebenjs/gpt-shell.git
cd gpt-shell
npm install

Linux and MacOS

cp .env.example .env
sudo chmod +x index.js
ln -s "$(pwd)/index.js" /usr/local/bin/gpts

Windows

On windows, first you need to copy the .env.example file to .env.

copy .env.example .env

Then you need to create a gpts.cmd file in C:\Windows\System32 with the following content:

@echo off
node "C:\path\to\gpt-shell\index.js" %*

Usage

gpts ask -p "What is the meaning of life?"

Configuration

gpts config -k YOUR_API_KEY -m MODEL_NAME -u API_URL

-k or --key is your openai api key.
-m or --model is the model name to use. Default is gpt-3.5-turbo.
-u or --url is the url of the gpt server. Default is https://api.openai.com/v1/chat/completions.

The configuration command is needed only once. It will create a .gpt-shell-config.json file in current directory. You can edit this file manually if you want to change the configuration.

Contributing

Contributions are welcome. Please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

For more information, please refer to the contributing guidelines.