GPTSH: A Command Line Interface for GPT


gptsh is a cross platform CLI tool built with NodeJS and powered by Open AI's GPT-3. It's main purpose is to translate natural language questions and requests into shell commands. Heavily inspired by projects such as nlsh and cmdxyz, it can easily be installed and used in conjunction with your classic shell environment.

This tool is not meant as a complete replacement for all of you shell commands. It's role is to integrate into your standard shell workflow to help you make generic task which commands you dont know by heart. For example, when compressing or uncompressing a files, using new frameworks, searching files on your system and much more...

• Demo


• Installation

Use the package manager NPM or Yarn to install GPTerminal globally on your system.

npm install --global gpterminal
yarn global add gpterminal

• Getting started

To use this tool, you will need to set OpenAI API key either as an environment variable.


As a option while executing the command.

gpt <input> --secret <YOUR_SECRET_KEY>

Or in the ~/.gpterminalrc file.


• Usage

Usage: gpt <input> [options]

      --version      Show version number                               [boolean]
  -s, --secret       OpenAI API key for authentication                  [string]
  -e, --engine       ID of the engine to use                            [string]
  -t, --tokens       Maximum number of tokens to consume [number] [default: 100]
      --temperature  Higher values means the model will take more risks
                                                         [number] [default: 0.0]
  -p, --platform     Platform of the command to output                  [string]
  -n                 Number of completions to generate                  [number]
      --help         Show help                                         [boolean]

• Examples

$ gpt install node 12 repository
curl -sL | sudo -E bash -
$ gpt add yarn bin folder to path on zsh
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.zshrc
$ gpt List all files of this directory | bash
LICENSE  data  node_modules  package.json  src  yarn.lock
$ gpt Install the lodash package using yarn --secret <YOUR_SECRET_KEY>
yarn add lodash
$ gpt Delete the root directory --engine ada
rm -rf /
$ gpt Add remote from github with name goulartnogueira/gptsh
git remote add goulartnogueira

Oh, and it works for other platforms too.

PS C:\WINDOWS\system32> gpt Add a new user --platform win32
Add-ADUser -Name "username" -SamAccountName username -AccountPassword (Read-Host -AsSecureString "Password") -Enabled $true -ChangePasswordAtLogon $false
$ gpt Add a new user --platform aix
mkuser username

• Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Based on gptsh by shorwood

Download Details:

Author: Goulartnogueira
Source Code: 
License: MIT

#gpt #cli #tool #openai 

GPTSH: A Command Line Interface for GPT
1.30 GEEK