{"id":20496740,"url":"https://github.com/lordpax/cligpt","last_synced_at":"2025-05-09T05:32:48.580Z","repository":{"id":217649132,"uuid":"614577251","full_name":"LordPax/cligpt","owner":"LordPax","description":"A bash script that use openai api to generate text, image and speech.","archived":false,"fork":false,"pushed_at":"2024-05-03T13:49:56.000Z","size":121,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-03T17:19:17.928Z","etag":null,"topics":["chatgpt","cli","dalle-3","gpt-4","openai-api","speech-to-text"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LordPax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-03-15T21:54:42.000Z","updated_at":"2024-05-03T13:50:00.000Z","dependencies_parsed_at":"2024-03-17T20:32:32.896Z","dependency_job_id":"6f2a53c9-db1b-414b-922c-8c804ec7583d","html_url":"https://github.com/LordPax/cligpt","commit_stats":null,"previous_names":["lordpax/cligpt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordPax%2Fcligpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordPax%2Fcligpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordPax%2Fcligpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordPax%2Fcligpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LordPax","download_url":"https://codeload.github.com/LordPax/cligpt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224824019,"owners_count":17376014,"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":["chatgpt","cli","dalle-3","gpt-4","openai-api","speech-to-text"],"created_at":"2024-11-15T18:08:34.078Z","updated_at":"2024-11-15T18:08:34.773Z","avatar_url":"https://github.com/LordPax.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CliGPT\n\n## Description\n\nA bash script that use openai api to generate text, image and speech.\n\n## Required Dependencies\n\n**general dependencies**\n\n* `jq`\n* `bat`\n* `curl`\n* `xsel`\n* `notify-send`\n\n**speech dependencies**\n\n* `pacat`\n* `zenity`\n\n**tts dependencies**\n\n* `paplay`\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/LordPax/cligpt.git\ncd cligpt\n```\n\n2. Execute the script to generate config file in `.config/cligpt`\n\n```bash\n./cligpt\n```\n\n3. Add your API key to `~/.config/cligpt/config`:\n\n**Example**\n\n```bash\nAPI_KEY=your-api-key\nAPI_ROUTE=https://api.openai.com/v1\nTEXT_MODEL=gpt-4\nTEXT_TEMP=0.7\nIMAGE_MODEL=dall-e-3\nIMAGE_NB=1\nIMAGE_SIZE=1024x1024\nSPEECH_MODEL=whisper-1\nSPEECH_LANG=fr\nTTS_MODEL=tts-1-hd\nTTS_VOICE=alloy\nTTS_SPEED=1.0\nTTS_FORMAT=mp3\n```\n\n## Integration with tmux\n\nAdd the following line to your `.tmux.conf`:\n\n```\nbind H new-window \"cligpt text\" \\; rename-window \"cligpt\"\n```\n\n## Vim plugin\n\nYou can find the vim plugin [here](https://github.com/LordPax/vim-cligpt)\n\nAdd the following line to your `.vimrc`:\n\n```vim\nPlug 'LordPax/vim-cligpt'\n```\n\n## Integration with i3\n\nAdd the following line to your `~/.config/i3/config`:\n\n```\nbindsym $mod+s exec ~/path/to/cligpt -c -g speech\n```\n\n## Usage\n\n* main help\n\n```\nUsage : cligpt [option] [command]\n\nOption :\n-h or --help ........................... Show help\n-v or --version ........................ Show version\n-l or --list ........................... List all available model\n-i or --inerte ......................... Do nothing except saving prompt in history\n-q or --quiet .......................... Quiet mode\n-c or --clipboard ...................... Save result in clipboard\n-g or --gui ............................ Open GUI\n\nCommand :\ntext ................................... Generate text\nimage .................................. Generate image\nspeech ................................. Generate text from speech\ntts .................................... Generate speech from text\n```\n\n* text help\n\n```\nUsage : cligpt [generalOption] text [option] [prompt|-]\n\nOption :\n-h or --help ........................... Show help text command\n-m or --model \u003cmodel\u003e .................. Select model (default : gpt-4)\n-t or --temp \u003ctemperature\u003e ............. Set temperature (default : 0.7)\n-s or --system [text] .................. Instruction with role system (use \"-\" for stdin)\n-c or --clear .......................... Clear history\n-l or --list-history ................... List history\n--list-json-history .................... List history in json format\n\nExample :\ncligpt text # Interactive mode\ncligpt text \"some prompt with role user\"\necho \"some prompt with role user\" | cligpt text -\ncat somefile.txt | cligpt text -s - # Instruction mode\ncat somefile.txt | cligpt text -s - \"some prompt with role user\"\ncligpt text -s \"some prompt with role system\" \"some prompt with role user\"\n```\n\n* image help\n\n```\nUsage : cligpt [generalOption] image [option] \u003cprompt|-\u003e\n\nOption :\n-h or --help ........................... Show help image command\n-m or --model \u003cmodel\u003e .................. Select model (default : dall-e-3)\n-n or --nb \u003cnumber\u003e .................... Number of image to generate (default : 1)\n-s or --size \u003csize\u003e .................... Size of image (default : 1024x1024)\n-o or --output \u003cname\u003e .................. Get image in file\n\nSize :\n- 256x256\n- 512x512\n- 1024x1024\n- 1024x1792\n- 1792x1024\n\nExample :\ncligpt image \"some prompt\"\necho \"some prompt\" | cligpt image -\ncligpt image -o image.png \"some prompt\"\n```\n\n* speech help\n\n```\nUsage : cligpt [generalOption] speech [option] [file]\n\nOption :\n-h or --help ........................... Show help speech command\n-m or --model \u003cmodel\u003e .................. Select model (default : whisper-1)\n-l or --lang \u003clanguage\u003e ................ Select language (default : fr)\n\nExample :\ncligpt speech # record audio and generate text\ncligpt speech somefile.ogg\ncligpt -c -g speech\n```\n\n* tts help\n\n```\nUsage : cligpt [generalOption] tts [option] [text|-]\n\nOption :\n-h or --help ........................... Show help tts command\n-m or --model \u003cmodel\u003e .................. Select model (default : tts-1-hd)\n-v or --voice \u003cvoice\u003e .................. Select voice (default : alloy)\n-s or --speed \u003cspeed\u003e .................. Select speed (default : 1.0)\n-f or --format \u003cformat\u003e ................ Select format (default : mp3)\n-o or --output \u003cname\u003e .................. Get speech in file\n\nVoice :\n- alloy\n- echo\n- fable\n- onyx\n- nova\n- shimmer\n\nExample :\ncligpt tts \"some text\" # play audio\necho \"some text\" | cligpt tts -\ncligpt tts -o speech.mp3 \"some text\"\n```\n\n## FAQ\n\n### How do I get my OpenAI API key?\n\nTo get an OpenAI API key, you need to sign up on the OpenAI website and follow the instructions to create an account and obtain an API key.\n\n## Example\n\nTODO : update example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordpax%2Fcligpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flordpax%2Fcligpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordpax%2Fcligpt/lists"}