{"id":23818022,"url":"https://github.com/lsongdev/chatgpt-cli","last_synced_at":"2026-03-03T22:32:49.251Z","repository":{"id":146600177,"uuid":"609018274","full_name":"lsongdev/chatgpt-cli","owner":"lsongdev","description":"This is a command-line interface (CLI) that uses OpenAI's GPT-3 model to provide conversational answers to user prompts.","archived":false,"fork":false,"pushed_at":"2023-09-01T07:38:52.000Z","size":399,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-13T19:55:35.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/lsongdev.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-03T07:48:25.000Z","updated_at":"2026-01-09T23:52:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa14853e-c382-40f3-86ba-13483632ca34","html_url":"https://github.com/lsongdev/chatgpt-cli","commit_stats":null,"previous_names":["lsongdev/chatgpt-cli","song940/chatgpt-cli"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lsongdev/chatgpt-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fchatgpt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fchatgpt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fchatgpt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fchatgpt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsongdev","download_url":"https://codeload.github.com/lsongdev/chatgpt-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fchatgpt-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30064349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-01-02T05:49:21.951Z","updated_at":"2026-03-03T22:32:49.235Z","avatar_url":"https://github.com/lsongdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chatgpt-cli\n\nChatGPT is a CLI tool that enables you to interact with OpenAI's GPT-3 model\nusing chat-style input. With ChatGPT, you can carry out a conversation with\nthe GPT-3 language model and get responses in natural language.\n\n## Installation\n\n```bash\nbash -c \"$(curl -s https://raw.githubusercontent.com/song940/chatgpt-cli/master/install.sh)\"\n```\n\nOr download the source code and install the dependencies by running:\n\n```bash\ngit clone https://github.com/song940/chatgpt-cli.git\ngo get github.com/charmbracelet/glamour\ngo get github.com/song940/openai-go/openai\ngo build # or make\n```\n\n## API Key\n\nBefore using the program, you need to provide an API key for OpenAI. You can find or create your API key by going to your [OpenAI dashboard](https://beta.openai.com/account/api-keys).\n\nSet your API key as an environment variable:\n\n```\nexport OPENAI_API_KEY=\u003cyour-api-key\u003e\n```\n\nYou can also set your OpenAI API endpoint as an environment variable (optional):\n\n```\nexport OPENAI_API=https://api.openai.com/v1\n```\n\n## Usage\n\nTo start the program, run:\n\n```bash\n~$ chatgpt\nYou\u003e Hi, what's your name?\nOpenAI\u003e\nMy name is ChatGPT. How can I assist you today?\n\nYou\u003e Can you tell me a joke?\nOpenAI\u003e\nWhy did the tomato turn red? Because it saw the salad dressing!\n```\n\nPress `Ctrl^D` to end the conversation.\n\n## Options\n\nThe program accepts the following command line options:\n\n+ -p : The prompt to use, it will ignore pipeline input and interactive.\n+ -s : The name of the system role.\n+ -r : Disable color output.\n\nOnce the program is running, you can start a conversation by typing your prompt and hitting enter. \n\n```bash\n~$ chatgpt -s \"Now, you're useful code assistant\"\nYou\u003e hi\nOpenAI\u003e\n\n  Hello! How can I assist you today?\n\n\nYou\u003e\n```\n\nYou can also use ChatGPT with piped input:\n\n```bash\n~$ echo \"What is the meaning of life?\" | chatgpt\nOpenAI\u003e\nThe meaning of life is subjective and varies from person to person. Some\nmay find purpose in their work, others in their relationships, and others in\ntheir hobbies or spiritual beliefs.\n```\n\n![](./images/chatgpt-cli-convert-to-json.png)\n![](./images/chatgpt-cli-work-with-ls.png)\n![](./images/chatgpt-cli-write-readme.png)\n\n```bash\n~$ cat main.go | chatgpt -r -s \"Write a README.md file\" | tee README.md\n```\n\n## Acknowledgements\n\nThis program uses the following dependencies:\n\n- [github.com/charmbracelet/glamour](https://github.com/charmbracelet/glamour) - for rendering markdown output\n- [github.com/song940/openai-go/openai](https://github.com/song940/openai-go) - for communicating with OpenAI's API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fchatgpt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsongdev%2Fchatgpt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fchatgpt-cli/lists"}