Skip to main content

Command line interaction with ChatGPT with chat history saved locally

Project description

Installation

I recommend using pipx for installation. Follow pipx's documentation to install it, then run pipx install chat-cli.

Building

Chat uses the poetry build tool.

  1. Install poetry
  2. Clone the chat project repo
  3. Run poetry build in the project root
  4. The wheel and sdist will be built in the dist/ directory

Usage

chat [-h] [--apikey APIKEY] [--prompt PROMPT] [--save] [-f CONFIG] [-m MODEL] [--resume] [-s SEARCH]

Options

-h, --help

show these options and exit

--apikey

Specify the API key to use when connection to OpenAI

--prompt

Change the prompt that is displayed for input. The sequences %t and %T can be used to display the current token and max token count for the model, respectively. Default prompt is '%t/%T > '

--save

If specified with --apikey and/or --prompt, save them to the config file

-f, --config

Specify an alternate file to load the configuration from (Default: $XDG_CONFIG_HOME/Chat/chat.json)

-m, --model

Specify the model to use, refer to https://platform.openai.com/docs/models for list

--resume

Resumes last conversation

-s, --search

Search your chat history for a given regex

Commands

When chating, the following commands perform special actions

.redo

Regenerates the previous response. Removes the old response from the history

.copy

Copies the first code block in the previous response to the system clipboard. Print's whats been copied

.exit

Exits the application and saves the chat history. Same as encountering EOF. Prints the chat log location.

.summarize

Asks the model to summarize the conversation and starts a new conversation with the summary as the first message. Saves the conversation prior to the summary. Should be called before reaching the token limit to continue a conversation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chat_cli-0.3.5.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chat_cli-0.3.5-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file chat_cli-0.3.5.tar.gz.

File metadata

  • Download URL: chat_cli-0.3.5.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for chat_cli-0.3.5.tar.gz
Algorithm Hash digest
SHA256 0aa565bfaae50365c0bb54768930c8ca0024ed6df155d3ebb8e845839460c502
MD5 460d7bcbd99f533bfeef26dc9be5b615
BLAKE2b-256 28b059bab33a462e316365bc03ce951811bee30e23f63b874baef9f4c9681f45

See more details on using hashes here.

File details

Details for the file chat_cli-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: chat_cli-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for chat_cli-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0dd4fc7f3d049df9e9a087a7d96eb06b0df5af8e1718b7fb6b2304d3e637bdf6
MD5 c2a08ea1276ea1207385e18a67816963
BLAKE2b-256 9904d19078896788879bb6eea7ad47d83d0d01b48c0fbfe5ed0a09aea4dc6c9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page