{"id":15064329,"url":"https://github.com/simatwa/gpt-cli","last_synced_at":"2025-10-05T00:31:10.342Z","repository":{"id":65674487,"uuid":"597050508","full_name":"Simatwa/gpt-cli","owner":"Simatwa","description":"Interact with ChatGPT and Bard at the terminal.","archived":true,"fork":false,"pushed_at":"2024-02-16T17:26:36.000Z","size":1709,"stargazers_count":54,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-21T20:22:59.218Z","etag":null,"topics":["chatgpt","chatgpt4","cli","gpt-","gpt-2","gpt-3","gpt-4","gpt-cli","gpt-terminal","gpt3-terminal","python","terminal"],"latest_commit_sha":null,"homepage":"http://smarttalks.pythonanywhere.com/post/34","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Simatwa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-03T14:17:22.000Z","updated_at":"2025-05-15T19:59:11.000Z","dependencies_parsed_at":"2023-12-17T12:25:13.317Z","dependency_job_id":"419e5f8c-1653-4a0e-be61-78cb0cbda3a7","html_url":"https://github.com/Simatwa/gpt-cli","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/Simatwa/gpt-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2Fgpt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2Fgpt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2Fgpt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2Fgpt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simatwa","download_url":"https://codeload.github.com/Simatwa/gpt-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2Fgpt-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278395874,"owners_count":25979685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chatgpt4","cli","gpt-","gpt-2","gpt-3","gpt-4","gpt-cli","gpt-terminal","gpt3-terminal","python","terminal"],"created_at":"2024-09-25T00:15:25.214Z","updated_at":"2025-10-05T00:31:09.875Z","avatar_url":"https://github.com/Simatwa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003egpt-cli\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/Simatwa/gpt-cli\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?logo=Github\u0026label=Github\u0026message=Passing\u0026color=lime\" alt=\"Gihtub\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/chatgpt4-cli/\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Pypi\u0026message=v1.5.9\u0026color=green\u0026logo=pypi\" alt=\"Pypi\"/\u003e\n\u003ca href=\"https://wakatime.com/badge/github/Simatwa/gpt-cli\"\u003e\u003cimg src=\"https://wakatime.com/badge/github/Simatwa/gpt-cli.svg\" alt=\"wakatime\"/\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=License\u0026message=MIT\u0026color=green\u0026logo=MIT\" alt=\"license\"/\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Development\u0026message=Beta\u0026color=Orange\u0026logo=progress\" alt=\"Progress\"/\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Code Style\u0026message=Black\u0026color=black\u0026logo=Black\" alt=\"Code-style\"/\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Coverage\u0026message=80%\u0026color=green\" alt=\"Coverage\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://pepy.tech/project/chatgpt4-cli\"\u003e\u003cimg src=\"https://static.pepy.tech/badge/chatgpt4-cli\" alt=\"Downloads\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nCLI tool for interacting with [ChatGPT](https://openai.com) and [Bard](https://bard.google.com).\n\u003e Generate images with BingImageCreator and ChatGPT's DALL-E models.\n\n![screenshot](https://github.com/Simatwa/gpt-cli/raw/main/assets/Screenshot1.png)\n\n### Features\n\n- Chat with ChatGPT and Bard conversationally.\n- Let **ChatGPT** and **Bard** chat to each other.\n- Generate Images (DALL-E \u0026 BingImageCreator)- Based on your prompt or GPT generated description.\n- Stream or Non-stream responses.\n- Maintain record of the chats.\n- Parse [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) easily.\n- Fully customizable Commandline Interface.\n- Interact with system commands on the fly.\n\n### Prerequisites\n\n- [x] [OPENAI_API_KEY](https://platform.openai.com/account/api-keys)\n\n- [x] [Bard Cookies](https://bard.google.com)\n\n- [x] [Bing cookies](https://bing.com) - *optional*\n\n## Installation\n\nEither of the following ways will get you ready.\n\n1. Using pip\n\n- From pypi\n\n```sh\nsudo pip install chatgpt4-cli\n```\n\n- Installing from source\n\n```sh\n sudo pip install git+https://github.com/Simatwa/gpt-cli.git\n ```\n\n2. Cloning locally and install\n\n```sh\ngit clone https://github.com/Simatwa/gpt-cli.git\ncd gpt-cli\npip install .\n #or\nsudo pip install .\n```\n\n## Usage \n\n- Make OPENAI_API_KEY an environment variable.\n\n`$ export OPENAI_API_KEY=\u003copenai-api-key\u003e`\n\nAfter that you can launch the script with or without a prompt\n\n\u003e For instance :\n```sh \n    #Without a prompt\n   $ gpt-cli \n    # With a prompt \n   $ gpt-cli Write a conversation between Sun and Pluto.`\n```\n\n- Parsing OPENAI_API_KEY as one of the arguments\n\nRun `$ gpt-cli -k \u003copenai-api-key\u003e \u003cYour query\u003e` at the terminal.\n\n\u003e For instance :\n\n```sh\n$ gpt-cli -k xxxxxxxxxxxxxxxxxx How to scan for SMB vulnerability using NMAP?\n```\n\nThe [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) can be parsed to the script through the following ways:\n\n- Specifying the role - (*case-sensitive*)\n\n    e.g `$ gpt-cli UX/UI Developer`\n\n- Specifying the index of the prompt:\n\n    e.g `$ gpt-cli 29`\n\nRun `$ gpt-cli --dump show` to view the act,prompt and their **indexes**\n\nYou can as well generate images using EdgeGPT (DALL-E) or ChatGPT independent of `gpt-cli`, uninteractively at the terminal:\n\n1. EdgeGPT \n\n```sh\n$ gpt-cli-emage --cookie-file \u003cpath\u003e \u003cYour prompt\u003e\n```  \n- Visit [EdgeGPT](https://github.com/acheong08/EdgeGPT#requirements) to learn more on how to get the cookies.\n\n2. ChatGPT \n\n```sh\n  # Make OPENAI_API_KEY environment variable\n  $ gpt-cli-image \u003cYour Prompt\u003e\n```\n\nFor more info run `$gpt-cli-image -h` or `$gpt-cli-emage -h`.\n\n## Highlight\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\u003cth style=\"text-align: right;\"\u003e  No.\u003c/th\u003e\u003cth\u003eCommand          \u003c/th\u003e\u003cth\u003eAction                                     \u003c/th\u003e\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    0\u003c/td\u003e\u003ctd\u003e./{command}      \u003c/td\u003e\u003ctd\u003eRun command against system                 \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    1\u003c/td\u003e\u003ctd\u003eimg              \u003c/td\u003e\u003ctd\u003eGenerate image ChatGPT based on prompt     \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    2\u003c/td\u003e\u003ctd\u003eemg              \u003c/td\u003e\u003ctd\u003eGenerate image with EdgeGPT based on prompt\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    3\u003c/td\u003e\u003ctd\u003etxt2img          \u003c/td\u003e\u003ctd\u003eGenerate image based on GPT description    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    4\u003c/td\u003e\u003ctd\u003e_font_color      \u003c/td\u003e\u003ctd\u003eModify font-color                          \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    5\u003c/td\u003e\u003ctd\u003e_background_color\u003c/td\u003e\u003ctd\u003eModify background_color                    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    6\u003c/td\u003e\u003ctd\u003e_prompt          \u003c/td\u003e\u003ctd\u003eModify terminal prompt                     \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    7\u003c/td\u003e\u003ctd\u003e_save            \u003c/td\u003e\u003ctd\u003eSave current configurations to `.json` file\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    8\u003c/td\u003e\u003ctd\u003e_load            \u003c/td\u003e\u003ctd\u003eLoad configurations from file              \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e    9\u003c/td\u003e\u003ctd\u003e_rollback        \u003c/td\u003e\u003ctd\u003eRollback Chat by {n} times                 \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e   10\u003c/td\u003e\u003ctd\u003e_reset           \u003c/td\u003e\u003ctd\u003eReset current chat and start new           \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e   11\u003c/td\u003e\u003ctd\u003e_help            \u003c/td\u003e\u003ctd\u003eShow this help info                        \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd style=\"text-align: right;\"\u003e   12\u003c/td\u003e\u003ctd\u003e{Any Other}      \u003c/td\u003e\u003ctd\u003eChat with ChatGPT                          \u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/summary\u003e\n\n1.img : Text-to-Image converter - ChatGPT\n - e.g ```img Toddler cartoon coding in Python```\n\n2.emg : Text-to-Image converter - EdgeGPT\n - e.g ```emg Toddler cartoon coding in Python```\n\n3.txt2img : Generate image based on GPT description\n - e.g ```txt2img Describe phenotype anatomy of ancient dinosaurs```\n\n4._font_color : modifies font-color\n - e.g ```font_color input red```\n\n5._background_color : modifies background_color\n - e.g ```background_color cyan```\n\n6._prompt : Modify CMD prompt\n - e.g ```prompt ┌─[Smartwa@GPT-CLI]─(%H:%M:%S)```\n\n7._load : Load configurations from the json file\n - e.g ```load DAN.json```\n\n8._save : Save the current Chat Configurations\n - e.g ```save DAN.json```\n\n9._rollback : Rollback the Chat by the {n} time(s)\n - e.g ```_rollback 2```\n\n10._reset : Reset current chat and start new\n - e.g ```_reset Chat as if you are a 10 year old child```\n\n11.bard : Specifies to use bard GPT\n - e.g ```bard Explain the composite concept in business```\n\n12.gpt4 : Specifies to use ChatGPT in case `--bard` was made default\n - e.g ```gpt4 How do you make?```\n\n13._help : Show this help info\n\n* Use  `./` (fullstop and forward slash) to interact with **system commands**\n - e.g ```./ifconfig```\n\n * Use `_botchat` to let the 2 GPTs chat to each other\n\n\u003e **Note** You can further specify the GPT to be used by appending `--gpt4` or `--bard` in the prompt.\n\n* Use *{{f.text-filename}}* to issue prompt contained in the 'text-filename'\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\n\nFor more info run `gpt-cli -h`.\n\n\u003c/summary\u003e\n\n```\n╭─────────────────────────────── gpt-cli v1.5.3 ───────────────────────────────╮\n│                                                                              │\n│             Repo : https://github.com/Simatwa/gpt-cli                        │\n│             By   : Smartwa Caleb                                             │\n╰──────────────────────────────────────────────────────────────────────────────╯\nusage: gpt-cli [-h] [-v] [-m gpt-3.5-turbo|gpt-4|gpt-4-32k] [-t [0.1-1]]\n               [-mt [1-7000]] [-tp [0.1-1]] [-f [0.1-2]] [-p [0.1-2]] [-k KEY]\n               [-kp path] [-ic [cyan|green|yellow|red]]\n               [-oc [cyan|green|yellow|red]] [-bc [blue,magenta,black,reset]]\n               [-pc [cyan|green|yellow|red]] [--prompt [SETTINGS ...]]\n               [-tm value] [-pr PROXY] [-rc value] [-g 1,4] [-sp [text ...]]\n               [-fp path] [-o path] [-pp prefix] [-rp prefix]\n               [-dm keys|values|show|{fnm}] [-dl symbol] [-cf path] [-bk KEY]\n               [-bkp PATH] [-bcf PATH] [-si TIME] [-spin 1|2]\n               [--disable-stream] [--new-record] [--disable-recording]\n               [--zero-show] [--bard] [--markdown] [--update] [--sudo]\n               [message ...]\n\nInteract with ChatGPT and Bard at the terminal.\n\npositional arguments:\n  message               Message to be send.\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --version         show program's version number and exit\n  -m gpt-3.5-turbo|gpt-4|gpt-4-32k, --model gpt-3.5-turbo|gpt-4|gpt-4-32k\n                        ChatGPT model to be used\n  -t [0.1-1], --temperature [0.1-1]\n                        Charge of the generated text's randomness\n  -mt [1-7000], --max-tokens [1-7000]\n                        Maximum number of tokens to be generated upon\n                        completion\n  -tp [0.1-1], --top-p [0.1-1]\n                        Sampling threshold during inference time\n  -f [0.1-2], --frequency-penalty [0.1-2]\n                        Chances of word being repeated\n  -p [0.1-2], --presence-frequency [0.1-2]\n                        Chances of topic being repeated\n  -k KEY, --key KEY     OPENAI-API-KEY\n  -kp path, --key-path path\n                        Path to text-file containing GPT-api key\n  -ic [cyan|green|yellow|red], --input-color [cyan|green|yellow|red]\n                        Font color for inputs\n  -oc [cyan|green|yellow|red], --output-color [cyan|green|yellow|red]\n                        Font color for outputs\n  -bc [blue,magenta,black,reset], --background-color [blue,magenta,black,reset]\n                        Console's background-color\n  -pc [cyan|green|yellow|red], --prompt-color [cyan|green|yellow|red]\n                        Prompt's display color\n  --prompt [SETTINGS ...]\n                        Customizes the prompt display\n  -tm value, --timeout value\n                        Request timeout while making request - (Soon)\n  -pr PROXY, --proxy PROXY\n                        Pivot request through this proxy\n  -rc value, --reply-count value\n                        Number of responses to be received\n  -g 1,4, --gpt 1,4     ChatGPT version to be used\n  -sp [text ...], --system-prompt [text ...]\n                        Text to train ChatGPT at the start\n  -fp path, --file-path path\n                        Path to .csv file containing role and prompt -\n                        [act,prompt]\n  -o path, --output path\n                        Filepath for saving the chats - default\n                        [/home/smartwa/git/gpt-cli/.chatgpt-history.txt]\n  -pp prefix, --prompt-prefix prefix\n                        Text to append before saving each prompt - default\n                        [\u003e\u003e\u003e timestamp]\n  -rp prefix, --response-prefix prefix\n                        Text to append before saving each response - default\n                        [None]\n  -dm keys|values|show|{fnm}, --dump keys|values|show|{fnm}\n                        Stdout [keys,values]; Save all prompts in json format\n                        to a file\n  -dl symbol, --delimiter symbol\n                        Delimeter for the .CSV file - [act,prompt]\n  -cf path, --cookie-file path\n                        Path to Bing's cookies - for Edge Image Generation\n  -bk KEY, --bard-key KEY\n                        Bard's session value\n  -bkp PATH, --bard-key-path PATH\n                        Path to Bard's key path\n  -bcf PATH, --bard-cookie-file PATH\n                        Path to Bard's cookie file\n  -si TIME, --stream-interval TIME\n                        Interval for printing responses in (s)\n  -spin 1|2, --spinner 1|2\n                        Busy bar indicator\n  --disable-stream      Specifies not to stream responses from ChatGPT\n  --new-record          Override previous chats under the filepath\n  --disable-recording   Disable saving prompts and responses\n  --zero-show           Specifies not to stdout prompt of the act parsed\n  --bard                Make Bard the default GPT\n  --markdown            Stdout responses in markdown-format - disables\n                        streaming\n  --update              Download latest prompts - [awesome-chatgpt-prompts]\n  --sudo                Run commands against system with sudo privileges\n\n```\n\n\u003c/details\u003e\n\n\u003e **Note** : **gpt-4** *(model)* supports upto *7000* tokens and others *3000*.\n\n\u003e `$ gpt-cli --dump pdf` will generate `all-acts.pdf` file containing latest acts and prompts as shown [here](https://chatgpt-prompts.tiiny.site). \n\nVisit [acheong08/Bard](https://github.com/acheong08/Bard) for info on how to get the Bard's cookie file and Sessions.\n\n## Motive\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\n\nLove for `Terminal` ❤️\n\n\u003c/summary\u003e\n\nAs a `terminal guy` I used to find it uncomfortable to keep shifting from one window to next in order to access ChatGPT even after trying out the [gpt-login](https://github.com/Simatwa/gpt-login), the rest is [here.](https://github.com/Simatwa/gpt-cli)\n\u003c/details\u003e\n\n## Contributions\n\n- Anyone is free to [fork](https://github.com/Simatwa/gpt-cli/fork), submit an [issue](https://github.com/Simatwa/gpt-cli/issues) without any **guideline** or submitting a [pull request](https://github.com/Simatwa/gpt-cli/pulls).\n\n### ToDo\n\n- [x] Use dialogue\n- [x] Issue prompt from a file\n- [x] Busy bar\n- [ ] Add prompts to the [prompts.csv](https://github.com/Simatwa/gpt-cli/edit/main/assets/prompts.csv)\n\n  \u003e Review [CHANGELOG](https://github.com/Simatwa/gpt-cli/blob/main/docs/CHANGELOG.md)\n\n## Acknowledgements\n\n1. [remo7777](https://github.com/remo7777/T-Header)\n\n2. [acheong08](https://github.com/acheong08/ChatGPT)\n\n3. [f](https://github.com/f/awesome-chatgpt-prompts)\n\nYou wanna save your bill? Well, purpose to make use of [WebChatGPT](https://github.com/Simatwa/WebChatGPT), which is reverse engineer of ChatGPT web-version.\n\n\u003e **Note** Consider supporting this project by purchasing [Prompts for ChatGPT and Bard](https://payhip.com/b/zxQM0) ebook.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatwa%2Fgpt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimatwa%2Fgpt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatwa%2Fgpt-cli/lists"}