diff options
author | Schark <jordan@schark.online> | 2023-12-06 15:28:49 -0800 |
---|---|---|
committer | Schark <jordan@schark.online> | 2023-12-06 15:28:49 -0800 |
commit | d2bb40e4983a1b91ac43bf786c83b298d9a61a9b (patch) | |
tree | 4d5aa48f801717f7d19043b16fea97afc3e34250 /README.md | |
parent | 90e2e98f420b7b213ff16c1376a2905f10addb5f (diff) | |
download | cli-gpt-d2bb40e4983a1b91ac43bf786c83b298d9a61a9b.tar.gz cli-gpt-d2bb40e4983a1b91ac43bf786c83b298d9a61a9b.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 46 |
1 files changed, 31 insertions, 15 deletions
@@ -9,37 +9,39 @@ cli-gpt is a ChatGPT-like terminal wrapper to make interfacing with GPT models with an OpenAI API key easier. -## Requirements and Installation +## Installation -I've tried to keep requirements low as to keep the program pretty minimal. Outside of native Python libraries, we're grabbing `openai` (obviously) to interface with the OpenAI API, `tiktoken` to get token information, and `prompt_toolkit` + `pygments` for better terminal handling. +### Requirements + +I've tried to keep requirements low as to keep the program pretty minimal. Outside of native Python libraries, we're grabbing `openai` (obviously) to interface with the OpenAI API, `tiktoken` to get token information, `selenium` for URL parsing, and `prompt_toolkit` + `pygments` for better terminal handling. To install and run the program, simply execute the following commands. ``` -# Clone repository -git clone https://github.com/jordanscharkey/cli-gpt.git -cd cli-gpt/ - # Create environment python -m venv .venv/ . .venv/bin/activate pip install -r requirements.txt - -# Fill token file and run -vim token -python chat.py ``` ### Token File -To use this program, you will need an OpenAI API key. Keep this token in a file named `key` in the repository and the program should automatically read from it. +To use this program, you will need an OpenAI API key. Keep this token in a file named `key` in the repository directory and the program should automatically read from it. -## Additional Functionality +### Usage -The `/help` command will list all commands and a short description of what that command will accomplish. Here is a summary of those commands: +Simply run the program using the following command in the repository directory + +``` +python src/chat.py +``` + +## Additional Functionalities + +In addition to expected chat-bot call/response functionality, the `/help` command will list all commands and a short description of what that command will accomplish. Here is a summary of those commands: ``` - /exit: Closes the chat. - - /context: Passthrough a URL to curl the context of into the chat history. + - /context: Passthrough a URL or filepath to add context into the chat history. - /help: Display this list of available commands. - /load: Load in a previous chat's JSON file. - /save: Saves messages to specified JSON file and closes chat. @@ -47,5 +49,19 @@ The `/help` command will list all commands and a short description of what that - /model: Change the model being used. - /info: Print model information and cli-gpt version. - /write: Write out any code from the previous message to a specified file. - - /copy: Copy code snippets from the previous message into the copy buffer. ``` + +## TODO: + +Implementations I'm still working on include: + +- "/copy" function to easily copy/paste codeblocks from assistant messages +- Better handling of key reading (perhaps an environment variable) +- Condensing token usage +- Switching between text and image models +- More intuitive command handling, particularly with "/cancel" catching +- More robust error handling :) + +## Contact + +For any inquiries, please reach out to [jordan@schark.online](mailto:jordan@schark.online). A mirror of this repositor can be found at [https://git.schark.online/cli-gpt/](https://git.schark.online/cli-gpt). |