{"id":18598768,"url":"https://github.com/crazypython/gpt3-cli","last_synced_at":"2025-04-10T18:31:02.626Z","repository":{"id":148713130,"uuid":"350455352","full_name":"CrazyPython/gpt3-cli","owner":"CrazyPython","description":"A lightweight command-line interface to OpenAI's GPT-3. Temperature, presence, and frequency up to 2. Streaming support","archived":false,"fork":false,"pushed_at":"2023-03-22T21:33:59.000Z","size":57,"stargazers_count":55,"open_issues_count":10,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T02:01:36.571Z","etag":null,"topics":["cli","frequency","gpt-3","gpt3","gpt3-cli","openai","presence","temperature"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrazyPython.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":"2021-03-22T18:52:38.000Z","updated_at":"2023-12-06T05:54:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"9cee8eda-bb91-4c9e-a963-65146760a434","html_url":"https://github.com/CrazyPython/gpt3-cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyPython%2Fgpt3-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyPython%2Fgpt3-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyPython%2Fgpt3-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyPython%2Fgpt3-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrazyPython","download_url":"https://codeload.github.com/CrazyPython/gpt3-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271595,"owners_count":21075800,"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","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":["cli","frequency","gpt-3","gpt3","gpt3-cli","openai","presence","temperature"],"created_at":"2024-11-07T01:34:18.197Z","updated_at":"2025-04-10T18:31:02.619Z","avatar_url":"https://github.com/CrazyPython.png","language":"Shell","readme":"# gpt3-cli\nStreaming command-line interface for OpenAI's GPT-3\n### Usecases\n * Use GPT-3 distraction-free: Just you and the terminal\n * Command-line remembers your past prompts and output history\n * Command-line streams just like the Playground\n### Features\n - [x] Streaming\n - [x] Any temperature up to 2.0 (unlike Playground)  \n - [x] Any presence and frequency penalty up to 2.0\n - [x] Easy to install\n - [x] Documentation\n - [ ] Proper error echoing\n - [ ] Search endpoint\n\n### Installation\n0. If you are on Windows, install [Git for Windows](https://gitforwindows.org)\n1. Install [jq](https://stedolan.github.io/jq/download/)\n2. Run these commands (on macOS, at the built-in Terminal app. on Windows, at Git Bash)\n```\ngit clone https://github.com/CrazyPython/gpt3-cli.git\necho \"export PATH=\\\"$(realpath gpt3-cli):\\$PATH\\\"\" \u003e\u003e ~/.bash_profile\necho 'export OPENAI_API_KEY=\"'$(printf \"Your OpenAPI Key: \" \u003e\u00262; head -n 1)'\"'  \u003e\u003e ~/.bash_profile\n```\n\nType `source ~/.bash_profile` to get it working immediately without a shell restart.\n\n## Usage summary\nInside the brackets means \"optional\"\n```\ngpt3 [parameters] \"prompt\" [max_tokens]\n```\n\n## `[parameters]`\nSet OPENAI_KEY as an environment variable\nCan be passed via the command-line, or via environment variables. command-line options override environment variables. Environment variables are used for defaults in scripts and environments.\n\n- `-e`/`--engine` - or the `ENGINE` environment variable\n- `-t`/`--temperature` - or the `TEMPERATURE` environment variable\n- `-f`/`--freq-penalty` - or the `FREQ_PENALTY` environment variable\n- `-p`/`--pres-penalty` - or the `PRES_PENALTY` environment variable\n\nDefaults to OpenAI's defaults.\n\n## Examples\n\n### Basic usage\n\n```\ngpt3 --engine ada --temperature 0.5 --freq-penalty 1 --pres-penalty 1 \\\n    \"As Descartes said, I think therefore\" 2\n``` \n\nThe prompt of the above command is \"As Descartes said, I think therefore\".\nThe max tokens of the above command is 2.\n\nShorthand version of the same above command:\n\n```\ngpt3 -e ada -t 0.5 -f 1 -p 1 \"As Descartes said, I think therefore\" 2\n```\n\n\n### Setting global defaults to frequency and presency penalty 1\n\nAdd these lines to your `~/.bash_profile`:\n\n```\nexport FREQ_PENALTY=1\nexport PRES_PENALTY=1\n```\n\n### Keep your input and prompt separate and concatenate them togehter\n\n1. Make a folder, \"myproject\"\n2. `cd myproject`\n3. Make a new file, input1.txt with your favorite editor\n4. Make a new file, prompt.txt with your favorite editor\n5. Run `gpt3 -e davinci-instruct-beta \"$(cat input.txt prompt.txt)\" 100`\n\nThis concatenates the input and the prompt together, input first, prompt second,and streams the result with 100 max tokens.\n\n## File upload via CLI\nTry [OpenAI's Python tool.](https://github.com/openai/openai-python#openai-python-library)\n\n## License\n**N.B.** You have the full right to base any closed-source or open-source program on this software if it remains on your own, your company's, or your company's contractors computers and cloud servers. (In other words, you can use this to build a closed-source SaaS.) If you distribute a program to a third-party end-user, you are required to give them the source code. The requirement to share source code only applies when distributed to other people. This is the GPLv3's private use clause.\nThe intent is to ensure GPT-3 developer tools remain [open-source](https://www.gnu.org/philosophy/free-sw.en.html). OpenAI asks that end-users of products that use GPT-3 products be shielded from direct API access, so this license should not impose any restriction. A copy of the private use exception is copied below:\n\u003e All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\n\u003e You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\n\nAGPLv3. As long as you use this library on a server, you do not have to release any source code that is in a separate file, because AGPLv3 can be linked with GPLV3, and GPLv3 has a private use clause.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazypython%2Fgpt3-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazypython%2Fgpt3-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazypython%2Fgpt3-cli/lists"}