{"id":23588188,"url":"https://github.com/kristiangasic/chatgpt-bash","last_synced_at":"2026-05-17T17:04:26.472Z","repository":{"id":269388453,"uuid":"907259291","full_name":"kristiangasic/ChatGPT-bash","owner":"kristiangasic","description":"ChatGPT Terminal Interaction","archived":false,"fork":false,"pushed_at":"2024-12-23T07:28:44.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T06:09:26.269Z","etag":null,"topics":["bash","chatgpt-bot"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/kristiangasic.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":"2024-12-23T07:26:50.000Z","updated_at":"2024-12-23T07:30:47.000Z","dependencies_parsed_at":"2024-12-23T08:38:31.769Z","dependency_job_id":null,"html_url":"https://github.com/kristiangasic/ChatGPT-bash","commit_stats":null,"previous_names":["kristiangasic/chatgpt-bash"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kristiangasic/ChatGPT-bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristiangasic%2FChatGPT-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristiangasic%2FChatGPT-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristiangasic%2FChatGPT-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristiangasic%2FChatGPT-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristiangasic","download_url":"https://codeload.github.com/kristiangasic/ChatGPT-bash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristiangasic%2FChatGPT-bash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265105786,"owners_count":23712210,"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":["bash","chatgpt-bot"],"created_at":"2024-12-27T05:12:41.957Z","updated_at":"2026-05-17T17:04:21.426Z","avatar_url":"https://github.com/kristiangasic.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT Terminal Interaction Script\n\nThis script allows you to interact with OpenAI's ChatGPT directly from your terminal. It is specifically designed for free-tier usage and logs the conversation history to a file named `history.txt`. \n\n---\n\n## Features\n- **Interactive Terminal Chat**: Send messages to ChatGPT and receive responses in real-time.\n- **Free Tier Model**: Uses `gpt-3.5-turbo`, the model available in OpenAI's free tier.\n- **Conversation Logging**: Automatically saves all interactions (user inputs and AI responses) to `history.txt`.\n\n---\n\n## Prerequisites\n- **Bash**: This script is designed for Linux or macOS systems with Bash.\n- **Dependencies**:\n  - `curl`: Used for making HTTP requests to the OpenAI API.\n  - `jq`: Used for creating and parsing JSON data.\n\n### Install Dependencies\n```bash\nsudo apt update \u0026\u0026 sudo apt install -y curl jq\n```\n\n---\n\n## Setup\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/your-repo/chatgpt-terminal.git\n   cd chatgpt-terminal\n   ```\n\n2. **Add Your OpenAI API Key**:\n   Open the script and replace the placeholder `API_KEY` with your actual OpenAI API key:\n   ```bash\n   API_KEY=\"sk-...\"  # Replace with your key\n   ```\n\n3. **Make the Script Executable**:\n   ```bash\n   chmod +x chat.sh\n   ```\n\n---\n\n## Usage\n\n1. **Run the Script**:\n   ```bash\n   ./chat.sh\n   ```\n\n2. **Start Chatting**:\n   - Type your message and press Enter.\n   - ChatGPT will respond.\n   - Type `exit` to quit the script.\n\n3. **View Conversation History**:\n   All interactions are logged in `history.txt`:\n   ```bash\n   cat history.txt\n   ```\n\n---\n\n## Example\n\n### Terminal Session:\n```plaintext\nChatGPT Terminal (Free Tier). Type 'exit' to quit.\nYou: Hello, who are you?\nBob: I'm ChatGPT, your virtual assistant powered by OpenAI. How can I help you today?\n\nYou: What is the capital of France?\nBob: The capital of France is Paris.\n\nYou: exit\nGoodbye!\n```\n\n### Logged in `history.txt`:\n```plaintext\nYou: Hello, who are you?\nBob: I'm ChatGPT, your virtual assistant powered by OpenAI. How can I help you today?\n\nYou: What is the capital of France?\nBob: The capital of France is Paris.\n```\n\n---\n\n## Help\n\nRun the script with the `-h` option to display a help message:\n```bash\n./chat.sh -h\n```\n\nOutput:\n```plaintext\nUsage: ./chat.sh [-h]\n\nOptions:\n  -h         Display this help message\n```\n\n---\n\n## Notes\n- **API Key Security**: Keep your API key private to avoid unauthorized access.\n- **Rate Limits**: The free tier has usage limits. Check your OpenAI account for details.\n- **Error Handling**: If the API key is invalid or the service is unavailable, the script will notify you.\n\n---\n\n## License\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\nFeel free to contribute by submitting issues or pull requests! 😊\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristiangasic%2Fchatgpt-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristiangasic%2Fchatgpt-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristiangasic%2Fchatgpt-bash/lists"}