ChatCLI

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 1 Imported by: 0

README

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

Example

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

  1. Asking a single message:

    chat-cli "What is the capital of France?"
    
  2. Entering interactive mode with an initial message:

    chat-cli -i "Tell me a joke."
    
  3. Using the Dracula markdown rendering style:

    chat-cli -s dracula "What is the meaning of life?"
    
  4. 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL