{"id":16799867,"url":"https://github.com/fuyufjh/heygpt","last_synced_at":"2025-04-06T07:15:18.160Z","repository":{"id":120434655,"uuid":"610375717","full_name":"fuyufjh/heygpt","owner":"fuyufjh","description":"A simple command-line interface for ChatGPT API written in Rust ⚡️","archived":false,"fork":false,"pushed_at":"2023-11-01T15:57:44.000Z","size":55,"stargazers_count":163,"open_issues_count":4,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T06:09:21.374Z","etag":null,"topics":["chatgpt","cli","gpt","gpt-3","gpt-4","gpt3-cli","openai","openai-api"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/fuyufjh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-06T16:42:00.000Z","updated_at":"2025-02-14T20:29:56.000Z","dependencies_parsed_at":"2024-08-21T02:01:11.372Z","dependency_job_id":null,"html_url":"https://github.com/fuyufjh/heygpt","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":0.05714285714285716,"last_synced_commit":"b84947025821ce4b3d7f96b8c0c2409b2d6743f9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuyufjh%2Fheygpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuyufjh%2Fheygpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuyufjh%2Fheygpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuyufjh%2Fheygpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuyufjh","download_url":"https://codeload.github.com/fuyufjh/heygpt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445682,"owners_count":20939961,"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","gpt","gpt-3","gpt-4","gpt3-cli","openai","openai-api"],"created_at":"2024-10-13T09:29:59.379Z","updated_at":"2025-04-06T07:15:18.123Z","avatar_url":"https://github.com/fuyufjh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `heygpt`\n\nA simple command-line interface for [ChatGPT API](https://platform.openai.com/docs/api-reference/chat/create).\n\n- 🌟 Streaming output!\n- 💡 One-shot mode to get a quick answer\n- 🤖 Interactive mode to have a conversation\n\n\u003cimg width=\"986\" alt=\"screenshot\" src=\"https://github.com/fuyufjh/heygpt/assets/10192522/68ee10a1-942d-47b1-8d13-2d5cef70b649\"\u003e\n\n**[Demo (YouTube)](https://youtu.be/Edqts2ff1Y0)**\n\n## Quickstart\n\nInstall latest release version to `$HOME/.cargo/bin/` via cargo:\n\n```bash\ncargo install heygpt\n```\n\nYou'll need a OpenAI API key (you can get one [here](https://platform.openai.com/account/api-keys)), and you'll need to export your API Key as an environment variable:\n\nYou can also set a OpenAI API base environment variable, just like [openai-python](https://github.com/openai/openai-python/blob/main/openai/__init__.py#L37)\n\n```bash\nexport OPENAI_API_KEY=\u003cyour api key\u003e\n# export OPENAI_API_BASE=\"https://api.openai.com/v1\"\n```\n\nThen you can start an interactive conversation with ChatGPT:\n\n```bash\nheygpt\n```\n\nOR use the one-shot mode by providing a prompt:\n\n```bash\nheygpt how to record screen on mac\n```\n\nYou can also compose prompt with bash tricks like\n\n```bash\nheygpt read the code and tell me what it is doing: $(cat src/main.rs)\n```\n\n```bash\nheygpt read the code diff and write a commit message: $(git diff)\n```\n\n```bash\nheygpt \"please translate this poem to English:\n\u003e 床前明月光，\n\u003e 疑是地上霜。\n\u003e 举头望明月，\n\u003e 低头思故乡。\"\n```\n\nYou may even compose `heygpt` with other CLI tools via pipes:\n\n```\n$ echo \"It's late. I should go to bed\" | heygpt | cowsay\n ______________________________________\n/ Goodnight! Sleep well and have sweet \\\n\\ dreams.                              /\n --------------------------------------\n        \\   ^__^\n         \\  (oo)\\_______\n            (__)\\       )\\/\\\n                ||----w |\n                ||     ||\n```\n\n## Advanced\n\n### Commands in interactive mode\n\nEnter `\\?` to see available commands:\n\n```\nuser =\u003e \\?\nAvailable commands:\n  \\?, \\help: Show this help\n  \\b, \\back: Retract and back to the last user message\n  \\h, \\history: View current conversation history\n```\n\n### Configuration file\n\n`heygpt` will load configurations from `$HOME/.heygpt.toml`. You may also set API keys and base URL here. Example:\n\n```toml\nmodel = \"gpt-4\"\napi_base_url = \"https://some.openai.mirror/v1\"\napi_key = \"your api key\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuyufjh%2Fheygpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuyufjh%2Fheygpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuyufjh%2Fheygpt/lists"}