ChatCLI
ChatCLI is a simple command-line interface (CLI) program written in Go that allows you to interact with OpenAI's ChatGPT service in the terminal. It supports single message queries, interactive mode, and customizable markdown rendering styles.
This Readme.md is generated by GPT 4.
Snapshot

Table of Contents
Installation
From Source
To install ChatCLI, clone the repository and build the binary:
git clone https://github.com/yzc1114/ChatCLI.git
cd ChatCLI
go build -o chat-cli
From Binary
// TODO
Usage
Ask a single message:
chat-cli [Content]
Enter interactive mode:
chat-cli -i [Optional: First Sentence]
Use a specific markdown rendering style:
chat-cli -s dracula [Content]
Set timeout and enter interactive mode:
chat-cli -t 30 -i
Examples
-
Asking a single message:
chat-cli "What is the capital of France?"
-
Entering interactive mode with an initial message:
chat-cli -i "Tell me a joke."
-
Using the Dracula markdown rendering style:
chat-cli -s dracula "What is the meaning of life?"
-
Setting a 30-second timeout and entering interactive mode:
chat-cli -t 30 -i
Flags
-s, --MD_RENDER_STYLE string Style of markdown rendering. Options: [dark light dracula notty]. (default "dark")
--OPENAI_API_KEY string OpenAI API Key.
-m, --OPENAI_CHAT_MODEL string GPT model. Options: [GPT3.5]. (default "GPT3.5")
-h, --help Help for ChatCLI
-i, --interactive Interactive mode. Use ` to start multi-line input.
-p, --plain-text Render GPT output as plain text. Default is markdown.
-t, --timeout int Timeout in seconds. Default is 60 seconds. (default 60)
Environment Variables
You can set the following environment variables to customize ChatCLI:
$MD_RENDER_STYLE$: Style of markdown rendering.
$OPENAI_API_KEY$: OpenAI API Key.
$OPENAI_CHAT_MODEL$: GPT model.
License
MIT License