# oregpt
![workflow](https://github.com/shinichi-takayanagi/oregpt/actions/workflows/main.yml/badge.svg)
[![license](https://img.shields.io/github/license/shinichi-takayanagi/oregpt.svg)](https://github.com/shinichi-takayanagi/oregpt/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/shinichi-takayanagi/oregpt.svg)](https://github.com/shinichi-takayanagi/oregpt/releases/latest)
[![python-version](https://img.shields.io/pypi/pyversions/oregpt.svg)](https://pypi.org/project/oregpt/)
[![pypi](https://img.shields.io/pypi/v/oregpt?color=%2334D058&label=pypi%20package)](https://pypi.org/project/oregpt)
A tiny GPT CLI tool.
You can chat with the GPT model developped by OpenAI and save the conversation as json.
<img src="https://github.com/shinichi-takayanagi/oregpt/assets/24406372/91969861-9f29-4c81-9505-620ef5567a5b" width="800px">
## Installation
### Get your own OpenAI API Key
Assuming you have an environment variable with key named `OPENAI_API_KEY`.
If you don't have a OpenAI API key [visit here](https://platform.openai.com/account/api-keys), generate one and add it as an environment variable
```bash
export OPENAI_API_KEY=<YOUR-OPENAI-API-KEY>
```
### Instal from PyPI
You can install the package using pip:
```bash
$ pip install oregpt
```
## Usage
Once you have installed oregpt, you can run it by typing:
```bash
$ oregpt
```
There are a few options:
```bash
$ oregpt --help
Usage: oregpt [OPTIONS]
Options:
-m, --model_name TEXT Model name in OpenAI (e.g, gpt-3.5-turbo, gpt-4)
-a, --assistant_role TEXT Role setting for Assistant (AI)
--help Show this message and exit.
```
## Supported commands on chat
Commands such as saving and loading conversations are available as the following:
| Command | Description |
| ---- | ---- |
| `/exit` | Exit from this chat tool |
| `/quit` | Exit from this chat tool |
| `/q` | Exit from this chat tool |
| `/clear` | Clear chat history all |
| `/history` | Show chat history in json format |
| `/save` | Save chat history in json format |
| `/load` | Load chat history from a json file |
| `/help` | Show all commands which you can use in this chat tool |
## Configuration
You can specify the place of conversation `log`,
[style (color etc)](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/styling.html)
and
[the model supported in /v1/chat/completions endpoint provided by OpenAI](https://platform.openai.com/docs/models/overview)
in `~/.config/oregpt/config.yml`
```yaml
❯ cat ~/.config/oregpt/config.yml
log: /tmp/oregpt/
openai:
model: gpt-3.5-turbo
# You can also specify OpenAI's API key here
# api_key: <your-api-key>
character:
user:
name: Me
style: "#00BEFE"
role: "You are a chat bot"
assistant:
name: AI
style: "#87CEEB"
system:
name: System
style: "#cc0000"
```
Raw data
{
"_id": null,
"home_page": "https://github.com/shinichi-takayanagi/oregpt",
"name": "oregpt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "gpt-chatbot,gpt-cli,openai-cli",
"author": "Shinichi Takayanagi",
"author_email": "shinichi.takayanagi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3a/35/b9ec23dff2eef5d9fefcb843aef5c1b5d7c469c762a70c050e1a4803fef8/oregpt-0.2.0.tar.gz",
"platform": null,
"description": "# oregpt\n![workflow](https://github.com/shinichi-takayanagi/oregpt/actions/workflows/main.yml/badge.svg)\n[![license](https://img.shields.io/github/license/shinichi-takayanagi/oregpt.svg)](https://github.com/shinichi-takayanagi/oregpt/blob/master/LICENSE)\n[![release](https://img.shields.io/github/release/shinichi-takayanagi/oregpt.svg)](https://github.com/shinichi-takayanagi/oregpt/releases/latest)\n[![python-version](https://img.shields.io/pypi/pyversions/oregpt.svg)](https://pypi.org/project/oregpt/)\n[![pypi](https://img.shields.io/pypi/v/oregpt?color=%2334D058&label=pypi%20package)](https://pypi.org/project/oregpt)\n\nA tiny GPT CLI tool.\nYou can chat with the GPT model developped by OpenAI and save the conversation as json.\n\n<img src=\"https://github.com/shinichi-takayanagi/oregpt/assets/24406372/91969861-9f29-4c81-9505-620ef5567a5b\" width=\"800px\">\n\n## Installation\n### Get your own OpenAI API Key\nAssuming you have an environment variable with key named `OPENAI_API_KEY`.\nIf you don't have a OpenAI API key [visit here](https://platform.openai.com/account/api-keys), generate one and add it as an environment variable\n\n```bash\nexport OPENAI_API_KEY=<YOUR-OPENAI-API-KEY>\n\n```\n\n### Instal from PyPI\nYou can install the package using pip:\n\n```bash\n$ pip install oregpt\n```\n\n## Usage\nOnce you have installed oregpt, you can run it by typing:\n```bash\n$ oregpt\n```\n\nThere are a few options:\n```bash\n$ oregpt --help\nUsage: oregpt [OPTIONS]\n\nOptions:\n -m, --model_name TEXT Model name in OpenAI (e.g, gpt-3.5-turbo, gpt-4)\n -a, --assistant_role TEXT Role setting for Assistant (AI)\n --help Show this message and exit.\n```\n\n## Supported commands on chat\nCommands such as saving and loading conversations are available as the following:\n\n| Command | Description |\n| ---- | ---- |\n| `/exit` | Exit from this chat tool |\n| `/quit` | Exit from this chat tool |\n| `/q` | Exit from this chat tool |\n| `/clear` | Clear chat history all |\n| `/history` | Show chat history in json format |\n| `/save` | Save chat history in json format |\n| `/load` | Load chat history from a json file |\n| `/help` | Show all commands which you can use in this chat tool |\n\n## Configuration\nYou can specify the place of conversation `log`,\n[style (color etc)](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/styling.html)\nand\n[the model supported in /v1/chat/completions endpoint provided by OpenAI](https://platform.openai.com/docs/models/overview)\nin `~/.config/oregpt/config.yml`\n```yaml\n\u276f cat ~/.config/oregpt/config.yml\nlog: /tmp/oregpt/\nopenai:\n model: gpt-3.5-turbo\n# You can also specify OpenAI's API key here\n# api_key: <your-api-key>\ncharacter:\n user:\n name: Me\n style: \"#00BEFE\"\n role: \"You are a chat bot\"\n assistant:\n name: AI\n style: \"#87CEEB\"\n system:\n name: System\n style: \"#cc0000\"\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tiny GPT CLI tool",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/shinichi-takayanagi/oregpt",
"Repository": "https://github.com/shinichi-takayanagi/oregpt"
},
"split_keywords": [
"gpt-chatbot",
"gpt-cli",
"openai-cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "696a17d5f459b4db34315aa809b37e49c1552f71db35ed4d394a10fcc1264760",
"md5": "100c6775976916fffa4adb1403d88351",
"sha256": "83973acdeed55068999bfd7959c3c9ba736c104390797d3457932b699dbfe59d"
},
"downloads": -1,
"filename": "oregpt-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "100c6775976916fffa4adb1403d88351",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 8255,
"upload_time": "2023-05-22T23:47:58",
"upload_time_iso_8601": "2023-05-22T23:47:58.142095Z",
"url": "https://files.pythonhosted.org/packages/69/6a/17d5f459b4db34315aa809b37e49c1552f71db35ed4d394a10fcc1264760/oregpt-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3a35b9ec23dff2eef5d9fefcb843aef5c1b5d7c469c762a70c050e1a4803fef8",
"md5": "e46793798abff510ce87f093c48ddf0f",
"sha256": "6c61eef3c380f1377be6a5735ad3a5a54f2206971d3ed5244edb6e2a46bb05c7"
},
"downloads": -1,
"filename": "oregpt-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "e46793798abff510ce87f093c48ddf0f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 8929,
"upload_time": "2023-05-22T23:48:01",
"upload_time_iso_8601": "2023-05-22T23:48:01.307462Z",
"url": "https://files.pythonhosted.org/packages/3a/35/b9ec23dff2eef5d9fefcb843aef5c1b5d7c469c762a70c050e1a4803fef8/oregpt-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-22 23:48:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "shinichi-takayanagi",
"github_project": "oregpt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "oregpt"
}