Skip to content

A small cli application 'chat' which takes the input args as the text prompt for ChatGPT and prints the response to stdout

Notifications You must be signed in to change notification settings

oranellis/gptcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPT CLI

GPT CLI is a versatile command-line tool that enables ChatGPT integration into CLI and Vim environments. It facilitates executing ChatGPT queries from anywhere cli programs can be run, making it easier to analyze or modify code, generate documentation, and more.

Features

  • Environment Variables: Leverages OPENAI_API_KEY for secure API configuration and allows setting OPENAI_DEFAULT_MODEL to choose the desired language model.
  • CLI and Vim Integration: Enhances command-line workflows and Vim editing with direct ChatGPT integration for insights and content generation.

Getting Started

Prerequisites

Set the OPENAI_API_KEY environment variable to authenticate API requests. Optionally, set OPENAI_DEFAULT_MODEL to specify the default language model.

Installation

For Unix-like environments, you can use the install.sh script located in the root of this project:

./install.sh

Usage

Command Line

Direct CLI usage:

chat [prompt]

Piping command output to ChatGPT:

ls | chat explain the following files

Vim Integration

In Visual Mode, you can:

Replace selected text with ChatGPT suggestions:

:'<,'>!chat improve this rust function

Query ChatGPT about selected text without replacement:

:'<,'>w !chat what does this function do

Stay Informed

For the latest build information, see the GitHub Actions build status:

Rust

Leverage GPT CLI to streamline your CLI and Vim interactions through ChatGPT's capabilities.

About

A small cli application 'chat' which takes the input args as the text prompt for ChatGPT and prints the response to stdout

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published