<h1 align="center">
Sengpt
</h1>
<p align="center">
ChatGPT in your terminal, runs on
<a href="https://github.com/Zai-Kun/reverse-engineered-chatgpt">re-gpt</a> so no OpenAI API key required
</p>
<p align="center">
<p align="center">
<a href="#installation">Installation</a> •
<a href="#configuration">Configuration</a> •
<a href="#usage">Usage</a> •
<a href="#building-from-source">Building from source</a> •
<a href="#support">Support</a>
</p>
<img align="center" src="https://raw.githubusercontent.com/SenZmaKi/Sengpt/master/.github/images/example.png" alt="example">
## Installation
Ensure you have [Python 3.11](https://www.python.org/downloads/release/python-3111) and [Glow](https://github.com/charmbracelet/glow) installed.
```bash
pip install sengpt
```
## Configuration
### Session token
- Go to https://chat.openai.com and log in or sign up.
- Open the browser developer tools (right click and click "inspect" or "inspect element").
- Go to the Application tab (try expanding the dev tools window if you can't find it) and expand the Cookies section.
- Look for https://chat.openai.com.
- Copy the value for \_\_Secure-next-auth.session-token.
- Run `sengpt --session_token <your-session-token-goes-here>`.
### Preconfigured prompts
- Open the config file, run `sengpt --config_file` to see its location.
- Add a field named `preconfigured_prompts` and set its value to key value pairs of prompt name and value e.g.,
```json
{
"preconfigured_prompts": {
"readme": "generate a README.md for this project",
"expain": "briefly explain what this code does",
"refactor": "refactor this code to improve readability"
}
}
```
- To pass the prompt run `sengpt --prompt_name` or `sengpt -pn`.
- Warning!!! Make sure the short version of the prompt name doesn't clash with each other or with any of sengpt's default flags, i.e., a prompt name like `script_tags` will clash with `session_token` so every time you try and use it sengpt will think you want to set your session token.
- The preconfigured prompts are appended to the final prompt i.e., `some_project.py | sengpt --readme make it as brief as possible`
### Modes
#### Interactive mode
Back and forth interaction with ChatGPT, saves the conversation on exit.
Currently doesn't support piped inputs i.e., `cat README.md | sengpt summarise this document`, if piped inputs are passed Query mode will be used instead.
Press `Ctrl + C` to exit.
#### Query mode
Print ChatGPT's response, delete the conversation and exit.
#### Default mode
The default mode is interactive mode but you can change this in the config
```json
{
"default_mode": "query"
}
```
With this configuration to use interactive mode run `sengpt --interactive`
### Models
Either `gpt-3.5` or `gpt-4` can be used, the default is `gpt-3.5`. `gpt-4` requires a ChatGPT Plus account and is slower. To switch to `gpt-4` add this in your config file.
```json
{
"model": "gpt-4"
}
```
### Username
How your username appears in the conversation, the default is `You`.
```json
{
"username": "Sen"
}
```
## Usage
```
Usage: sengpt [prompt] [options]
-h, --help Show help message and exit
-v, --version Show the version information
-cf, --config_file Show the config file's contents and location
-st, --session_token Set session token
-ng, --no_glow Disable pretty printing with Glow,
this can be set to be the default behaviour in the config file
-c, --copy Copy the prompt response to the clipboard,
this can be set to be the default behaviour in the config file
-p, --paste Append the most recently copied clipboard text to the sent prompt
-rc, --recent_conversation Use the most recently saved conversation as context
-pp, --preconfigured_prompt Append a preconfigured prompt to the sent prompt,
replace "preconfigured_prompt" with the prompt's name
as it appears in the config file
-q, query Use query mode i.e., print ChatGPT's response and exit,
this flag is only necessary if "default_mode" in config file is interactive
-s, --save By default conversations in query mode are deleted on exit,
this saves the conversation instead,
this can be set to be the default behaviour in the config file
-i, --interactive Use interactive mode i.e., back and forth interaction with ChatGPT,
this flag is only necessary if "default_mode" in the config file is query
-d, --delete By default conversations in interactive mode are saved on exit,
this deletes then exits the interactive mode session,
this can be set to be the default behaviour in the config file
```
## Building from Source
Ensure you have [Python 3.11](https://www.python.org/downloads/release/python-3111) and [Git](https://github.com/git-guides/install-git) installed.
1. **Set everything up.**
```
git clone https://github.com/SenZmaKi/Sengpt && cd Sengpt && pip install poetry && poetry install
```
2. **Run Sengpt.**
```
poetry run sengpt
```
3. **Build the package to install with pip**.
```
poetry build
```
- The `tar` and `wheel` will be built at `Sengpt/dist`
## Support
- You can support the development of Sengpt through donations on [GitHub Sponsors](https://github.com/sponsors/SenZmaKi)
- You can also star the github repository for other terminal enthusiasts and freedom fighters to know about it
Raw data
{
"_id": null,
"home_page": "https://github.com/SenZmaKi/Sengpt",
"name": "sengpt",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "chatgpt, gpt, cli, command line, terminal, free gpt, free, no api key, no api, openai, openai chatgpt, chatgpt free",
"author": "SenZmaKi",
"author_email": "senzmaki@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a9/e7/25a026cc6844657bc7abd366ddc7b0fb8a69503a0aed01cb313e0254b614/sengpt-0.1.2.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">\n Sengpt\n</h1>\n<p align=\"center\">\n ChatGPT in your terminal, runs on \n <a href=\"https://github.com/Zai-Kun/reverse-engineered-chatgpt\">re-gpt</a> so no OpenAI API key required\n</p>\n<p align=\"center\">\n<p align=\"center\">\n <a href=\"#installation\">Installation</a> \u2022\n <a href=\"#configuration\">Configuration</a> \u2022\n <a href=\"#usage\">Usage</a> \u2022\n <a href=\"#building-from-source\">Building from source</a> \u2022\n <a href=\"#support\">Support</a>\n</p>\n\n<img align=\"center\" src=\"https://raw.githubusercontent.com/SenZmaKi/Sengpt/master/.github/images/example.png\" alt=\"example\">\n\n## Installation\n\nEnsure you have [Python 3.11](https://www.python.org/downloads/release/python-3111) and [Glow](https://github.com/charmbracelet/glow) installed.\n\n```bash\npip install sengpt\n```\n\n## Configuration\n\n### Session token\n\n- Go to https://chat.openai.com and log in or sign up.\n- Open the browser developer tools (right click and click \"inspect\" or \"inspect element\").\n- Go to the Application tab (try expanding the dev tools window if you can't find it) and expand the Cookies section.\n- Look for https://chat.openai.com.\n- Copy the value for \\_\\_Secure-next-auth.session-token.\n- Run `sengpt --session_token <your-session-token-goes-here>`.\n\n### Preconfigured prompts\n\n- Open the config file, run `sengpt --config_file` to see its location.\n- Add a field named `preconfigured_prompts` and set its value to key value pairs of prompt name and value e.g.,\n\n```json\n{\n \"preconfigured_prompts\": {\n \"readme\": \"generate a README.md for this project\",\n \"expain\": \"briefly explain what this code does\",\n \"refactor\": \"refactor this code to improve readability\"\n }\n}\n```\n\n- To pass the prompt run `sengpt --prompt_name` or `sengpt -pn`.\n- Warning!!! Make sure the short version of the prompt name doesn't clash with each other or with any of sengpt's default flags, i.e., a prompt name like `script_tags` will clash with `session_token` so every time you try and use it sengpt will think you want to set your session token.\n- The preconfigured prompts are appended to the final prompt i.e., `some_project.py | sengpt --readme make it as brief as possible`\n\n### Modes\n\n#### Interactive mode\n\nBack and forth interaction with ChatGPT, saves the conversation on exit.\n\nCurrently doesn't support piped inputs i.e., `cat README.md | sengpt summarise this document`, if piped inputs are passed Query mode will be used instead.\n\nPress `Ctrl + C` to exit.\n\n#### Query mode\n\nPrint ChatGPT's response, delete the conversation and exit.\n\n#### Default mode\n\nThe default mode is interactive mode but you can change this in the config\n\n```json\n{\n \"default_mode\": \"query\"\n}\n```\n\nWith this configuration to use interactive mode run `sengpt --interactive`\n\n### Models\n\nEither `gpt-3.5` or `gpt-4` can be used, the default is `gpt-3.5`. `gpt-4` requires a ChatGPT Plus account and is slower. To switch to `gpt-4` add this in your config file.\n\n```json\n{\n \"model\": \"gpt-4\"\n}\n```\n\n### Username\nHow your username appears in the conversation, the default is `You`.\n```json\n{\n \"username\": \"Sen\"\n}\n```\n\n## Usage\n\n```\n\nUsage: sengpt [prompt] [options]\n\n-h, --help Show help message and exit\n-v, --version Show the version information\n-cf, --config_file Show the config file's contents and location\n-st, --session_token Set session token\n\n-ng, --no_glow Disable pretty printing with Glow,\nthis can be set to be the default behaviour in the config file\n\n-c, --copy Copy the prompt response to the clipboard,\nthis can be set to be the default behaviour in the config file\n\n-p, --paste Append the most recently copied clipboard text to the sent prompt\n-rc, --recent_conversation Use the most recently saved conversation as context\n-pp, --preconfigured_prompt Append a preconfigured prompt to the sent prompt,\nreplace \"preconfigured_prompt\" with the prompt's name\nas it appears in the config file\n\n-q, query Use query mode i.e., print ChatGPT's response and exit,\nthis flag is only necessary if \"default_mode\" in config file is interactive\n\n-s, --save By default conversations in query mode are deleted on exit,\nthis saves the conversation instead,\nthis can be set to be the default behaviour in the config file\n\n-i, --interactive Use interactive mode i.e., back and forth interaction with ChatGPT,\nthis flag is only necessary if \"default_mode\" in the config file is query\n\n-d, --delete By default conversations in interactive mode are saved on exit,\nthis deletes then exits the interactive mode session,\nthis can be set to be the default behaviour in the config file\n\n```\n\n## Building from Source\n\nEnsure you have [Python 3.11](https://www.python.org/downloads/release/python-3111) and [Git](https://github.com/git-guides/install-git) installed.\n\n1. **Set everything up.**\n\n```\ngit clone https://github.com/SenZmaKi/Sengpt && cd Sengpt && pip install poetry && poetry install\n```\n\n2. **Run Sengpt.**\n\n```\npoetry run sengpt\n```\n\n3. **Build the package to install with pip**.\n\n```\npoetry build\n```\n\n- The `tar` and `wheel` will be built at `Sengpt/dist`\n\n## Support\n- You can support the development of Sengpt through donations on [GitHub Sponsors](https://github.com/sponsors/SenZmaKi)\n- You can also star the github repository for other terminal enthusiasts and freedom fighters to know about it\n",
"bugtrack_url": null,
"license": "GPL-3.0-only",
"summary": "ChatGPT in your terminal, no OpenAI API key required",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/SenZmaKi/Sengpt/issues",
"Homepage": "https://github.com/SenZmaKi/Sengpt",
"Repository": "https://github.com/SenZmaKi/Sengpt"
},
"split_keywords": [
"chatgpt",
" gpt",
" cli",
" command line",
" terminal",
" free gpt",
" free",
" no api key",
" no api",
" openai",
" openai chatgpt",
" chatgpt free"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31464c38116306f780740abd8289643b11765370f9a251217e3510a268f256d7",
"md5": "d078d81eee4a4d15cf09542dacb71fbe",
"sha256": "420ded4a8e0e975002b6737e0c2b98b08b1148e31c6a77c9696de36cf284e798"
},
"downloads": -1,
"filename": "sengpt-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d078d81eee4a4d15cf09542dacb71fbe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 35897,
"upload_time": "2024-03-26T19:29:11",
"upload_time_iso_8601": "2024-03-26T19:29:11.069149Z",
"url": "https://files.pythonhosted.org/packages/31/46/4c38116306f780740abd8289643b11765370f9a251217e3510a268f256d7/sengpt-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a9e725a026cc6844657bc7abd366ddc7b0fb8a69503a0aed01cb313e0254b614",
"md5": "a417e0d8946749d23f7fd918a3a6d98a",
"sha256": "58628a5e7ea34e1ed9f7cb1dbe0ca31d938bc9aab748a3ae5ecb253f0af92873"
},
"downloads": -1,
"filename": "sengpt-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "a417e0d8946749d23f7fd918a3a6d98a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 30302,
"upload_time": "2024-03-26T19:29:13",
"upload_time_iso_8601": "2024-03-26T19:29:13.423378Z",
"url": "https://files.pythonhosted.org/packages/a9/e7/25a026cc6844657bc7abd366ddc7b0fb8a69503a0aed01cb313e0254b614/sengpt-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-26 19:29:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SenZmaKi",
"github_project": "Sengpt",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "sengpt"
}