chatgpt

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

README

= ChatGPT

An OpenAI ChatGPT wrapper.

Installation:

`go install github.com/DavidGamba/dgtools/chatgpt@latest`

Then export your OpenAI API key as `OPENAI_API_KEY`.

== Usage

Start the interactive shell: `chatgpt`

=== Interactive Shell Commands

NOTE: A shell command is interpreted from the first word in the input.

* `quit`, `exit`, `.quit`, `.exit`: Exit the interactive shell.

* `fg`, `ls`: no-op, I seem to type this a lot in there.

* `.help`: Show the help message.

* `.reset`: Resets the session history.

* `.image`: Change mode to image.

* `.chat`: Change mode to chat (default).

* `.output`: Save the current session (from the last `.reset`) to a file.

* `.clear`, `clear`: clear the screen.

== Features

* Image output is displayed in the terminal using https://hpjansson.org/chafa/[Chafa].

* Images are stored as `chatgpt-generated-<date-time>.png`.

* Session records are stored to the `chatgpt.log.json` file.

== Roadmap

NOTE: The commands should mirror/be inspired by the sqlite interactive shell.

* Completion of the interactive shell commands.

* Import session for context.

* Save session:

	- There are two types of session saves:

		1. Save the entire session.
		Using the `--output <file.json>` CLI option.
		+
		NOTE: This session file is not cleared when `.reset` is called.

		2. Save the session from the last `.reset` call.
		This should be provided as an interactive command, something like: `.output session.json`

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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