{"id":21860930,"url":"https://github.com/bkrmdahal/cli-chatgpt","last_synced_at":"2025-04-14T19:21:57.260Z","repository":{"id":128664562,"uuid":"611230619","full_name":"BkrmDahal/cli-chatgpt","owner":"BkrmDahal","description":"CLI to call chatGPT api with query and system context. ","archived":false,"fork":false,"pushed_at":"2023-03-09T16:54:20.000Z","size":3994,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T07:41:37.011Z","etag":null,"topics":["chatgpt","cli","gpt3"],"latest_commit_sha":null,"homepage":"","language":"Go","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/BkrmDahal.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-03-08T11:53:20.000Z","updated_at":"2023-04-05T20:03:23.000Z","dependencies_parsed_at":"2023-07-03T03:52:46.095Z","dependency_job_id":null,"html_url":"https://github.com/BkrmDahal/cli-chatgpt","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BkrmDahal%2Fcli-chatgpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BkrmDahal%2Fcli-chatgpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BkrmDahal%2Fcli-chatgpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BkrmDahal%2Fcli-chatgpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BkrmDahal","download_url":"https://codeload.github.com/BkrmDahal/cli-chatgpt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943415,"owners_count":21186958,"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","gpt3"],"created_at":"2024-11-28T03:09:05.730Z","updated_at":"2025-04-14T19:21:57.233Z","avatar_url":"https://github.com/BkrmDahal.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cli-chatgpt(cgpt)\nCLI to call chatGPT api with query and system context.\n\n\n## Steps\n1. Get API keys from [openai setting](https://platform.openai.com/account/api-keys)\n2. [Optional]Setup apikey as `OPENAI_API_KEY` in environment variable. If this is not set, key need to be enter key first time you run the cli\n3. Build go by cloning the repo and run `go build` or download from [release](https://github.com/BkrmDahal/cli-chatgpt/releases).\n4. Make file executable and move to env path like */usr/local/bin*. For Mac check Issue session after this. \n`sudo chmod +x cgpt-XXX \u0026\u0026 sudo mv cgpt-XXX /usr/local/bin/cgpt`\n5. Run `cgpt -q \"your text\"`. \n6. If yout want to change system context you can add flag `-sc` like `cgpt -q \"your text\" -sc \"chat bot that fix grammer of input text\"`\n\n## Flags\n```\n  -q, --query string            Query for chat prompt. You can pass just Args to, first Args is taken as query.\n  -s, --system_context string   System context (default \"Your are chatbot. Always be more detail.\")\n  -c, --code                    Flag to just get code.\n  -d, --debug                   Print query, system context and response\n  -g, --grammar                 Flag to fix grammar of text.\n  -j, --json                    Flag to just get json.\n  ```\n\n## Examples\n```bash\n#simple query\ncgpt \"Make todo list to be productivity\"\ncgpt -q \"Make todo list to be productivity\"\n\n# added the system context\ncgpt \"Make todo list to productivity\" -s \"Your are the expert\"\n\n# debug , print more detail\ncgpt \"Make todo list to productivity\" -s \"Your are the expert\" -d\ncgpt \"Make todo list to productivity\" -s \"Your are the expert\" -d\n\n# other flag\ncgpt -c \"write python code to make https request to weather api\"\n\n```\n\n## Issue\n1. On Mac getting \"cannot be opened because the developer cannot be verified.\"  \nSolution 1: Build locally and move the file  \nSolution 2: Close the popup. Open System Preferences \u003e Security \u0026 Privacy \u003e General, and clicking on the \"Allow Anyway\" button. \n![image](https://i.imgur.com/Hnhk2I7.png)\nWhen asked again. Click on open.\n\n## Tip and Tricks\n1. On mac directly copy output\n```\ncgpt \"write email to client asking for demo\" | pbcopy\n```\n\n\n### Why not use chatGPT UI?  \n\u003e - I love cli and chatGPT UI keep going over capacity.\n\u003e - You can set system context on api. \n\u003e - This will be dirt cheap compare for $20 for plus. \n\n### Goal\n- Slove all developer query from cli. \n- Fix grammar and write better email using cli only. \n- First point of contact before google. \n\n### Need Help\n- [ ] Write better system context\n- [ ] Add more system context\n- [ ] Add more parameters\n- [ ] Add test cases\n- [ ] Refactor code\n\n\n### Disclaimer \nI am currently in the process of learning golang and hate pointers. As a result, my code may not be structured optimally. However, I intend to refactor it as I become more proficient in the language.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkrmdahal%2Fcli-chatgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkrmdahal%2Fcli-chatgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkrmdahal%2Fcli-chatgpt/lists"}