{"id":17311998,"url":"https://github.com/boris-code/chatgpt-cli","last_synced_at":"2025-04-14T14:20:43.199Z","repository":{"id":93264337,"uuid":"607658862","full_name":"Boris-code/chatgpt-cli","owner":"Boris-code","description":"chatgpt 命令行工具","archived":false,"fork":false,"pushed_at":"2023-12-13T05:23:12.000Z","size":1748,"stargazers_count":16,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T16:16:03.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Boris-code.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-28T12:27:42.000Z","updated_at":"2024-03-26T14:16:16.000Z","dependencies_parsed_at":"2024-10-15T12:42:13.952Z","dependency_job_id":"44f16998-6cf9-441e-a690-bfbf37ca5170","html_url":"https://github.com/Boris-code/chatgpt-cli","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"fbc606e144812397b614ec96776b2086ea906f15"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-code%2Fchatgpt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-code%2Fchatgpt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-code%2Fchatgpt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-code%2Fchatgpt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Boris-code","download_url":"https://codeload.github.com/Boris-code/chatgpt-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894939,"owners_count":21179154,"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":[],"created_at":"2024-10-15T12:42:03.030Z","updated_at":"2025-04-14T14:20:43.173Z","avatar_url":"https://github.com/Boris-code.png","language":"Python","readme":"# ChatGPT-CLI\n\u003e ChatGPT shell command\n\u003e Support gpt-4\n\nChatGPT 支持终端命令行啦，支持gpt-4\n\n支持连续对话，在终端输入asst即可开启对话。\n\n如让它写个feapder的爬虫，实际对答如下：\n\n![](media/16788027988798.jpg)\n\n## 安装\n\n```shell\npip install asst\n```\n\n## 环境变量\n\n| 变量 | 必须 | 描述                                                                                                        |\n| ----|--|-----------------------------------------------------------------------------------------------------------|\n| OPENAI_API_KEY| 是 | OpenAI的密钥                                                                                                 |\n| OPENAI_BASE_URL |否 | OpenAI的镜像接口地址，如：https://api.openai.com， 注意不需要携带 v1/chat/completions |\n| OPENAI_PROXY| 否 | 代理，如 username:password@ip:port                                                                            |\n| OPENAI_MODEL| 否 |模型， 支持 gpt-4-1106-preview、gpt-3.5-turbo等，默认为 gpt-4-1106-preview |\n\n\n## 配置\n\n\u003e 没有OPENAI_API_KEY，openai官网自己搞\n\n设置`OPENAI_API_KEY=\"chatgpt的密钥\"`到环境变量\n\n**mac或linux下**\n临时设置的方式\n```\nexport OPENAI_API_KEY=your key\n```\n永久设置\n```\nvim ~/.bash_profile\n\n# 在合适的位置添加环境变量\nexport OPENAI_API_KEY=\"your key\"\n```\n\n**window下设置为系统环境变量**\n\n参考：\u003ca href=\"https://blog.csdn.net/xue_nuo/article/details/114793534\" target=\"_blank\"\u003ehttps://blog.csdn.net/xue_nuo/article/details/114793534\u003c/a\u003e\n\n## 使用\n\n```shell\n\u003e asst\nYou: hello\nBot: Hi there!\n```\n\n## 请求超时\n\n国内用户因为墙的原因，无法直接访问chatgpt，需配置镜像api或使用代理\n\n代理使用方式：\n\n设置`ASST_PROXY=\"代理\"`到环境变量\n\n如：\n\n```\nexport ASST_PROXY=\"username:password@ip:port\"\n```\n\n## 境外代理举例\n\n**推荐：brightdata**\n\n不需要公司、不需要实名，准备好邮箱即可\n\n地址：\u003ca href=\"https://brightdata.grsm.io/r0g6zla8seqs\" target=\"_blank\"\u003ehttps://brightdata.grsm.io/r0g6zla8seqs\u003c/a\u003e\n\n若提示认证，选择支付宝即可，并不需要真正的认证\n\n充值支持支付宝\n\n使用方式：\n\n1. 选择机房代理，因为便宜。追求稳定选择住宅\n\n    ![](media/16788015593888.jpg)\n    \n2. 配置：\n\n    ![](media/16788016828506.jpg)\n    \n3. 查看访问参数\n\n![](media/16788017441719.jpg)\n\n4. 配置代理\n\n    设置`ASST_PROXY=\"代理\"`到环境变量\n    \n    如：\n    \n    ```\n    export ASST_PROXY=\"用户名:密码@主机\"\n    ```\n\n## OPENAI_API_KEY\n\n在chatgpt官网申请\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboris-code%2Fchatgpt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboris-code%2Fchatgpt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboris-code%2Fchatgpt-cli/lists"}