{"id":15832187,"url":"https://github.com/milliorn/chatgpt-cli","last_synced_at":"2026-04-10T23:54:13.164Z","repository":{"id":164598721,"uuid":"640057795","full_name":"milliorn/chatgpt-cli","owner":"milliorn","description":"Chat with OpenAI GPT-3 using Golang, NodeJs, or Python","archived":false,"fork":false,"pushed_at":"2025-09-01T09:40:29.000Z","size":149,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-01T10:54:50.861Z","etag":null,"topics":["ai","artificial-intelligence","chatbot","chatbots","chatgpt","chatgpt3","cli","command-line-interface","command-line-tool","conversational-ai","developer-tool","gpt-3","interactive","language-model","natural-language-processing","nlp","openai","openai-gpt3","terminal","text-generation"],"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/milliorn.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-12T21:57:25.000Z","updated_at":"2025-09-01T09:40:33.000Z","dependencies_parsed_at":"2023-07-25T23:30:49.027Z","dependency_job_id":"1bc61e14-9adc-42c9-b7e7-850ea9cac4dd","html_url":"https://github.com/milliorn/chatgpt-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/milliorn/chatgpt-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliorn%2Fchatgpt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliorn%2Fchatgpt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliorn%2Fchatgpt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliorn%2Fchatgpt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milliorn","download_url":"https://codeload.github.com/milliorn/chatgpt-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliorn%2Fchatgpt-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064222,"owners_count":25578997,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","artificial-intelligence","chatbot","chatbots","chatgpt","chatgpt3","cli","command-line-interface","command-line-tool","conversational-ai","developer-tool","gpt-3","interactive","language-model","natural-language-processing","nlp","openai","openai-gpt3","terminal","text-generation"],"created_at":"2024-10-05T12:41:18.090Z","updated_at":"2026-04-10T23:54:13.155Z","avatar_url":"https://github.com/milliorn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT CLI\n\n[![CodeQL](https://github.com/milliorn/chatgpt-cli/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/milliorn/chatgpt-cli/actions/workflows/github-code-scanning/codeql)\n![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)\n![Node.js](https://img.shields.io/badge/Node.js-ES2022-green)\n![Go](https://img.shields.io/badge/Go-1.22-00ADD8)\n![Python](https://img.shields.io/badge/Python-3.7%2B-3776AB)\n\nA command-line interface for having interactive, real-time conversations with OpenAI's ChatGPT models — implemented in three programming languages: **Node.js**, **Go**, and **Python**. Each implementation is functionally equivalent and demonstrates idiomatic patterns for its respective language. This repository is ideal for developers who want to quickly spin up a local ChatGPT CLI, compare multi-language API integration approaches, or use it as a learning reference.\n\n---\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Features](#features)\n3. [Repository Structure](#repository-structure)\n4. [Prerequisites](#prerequisites)\n   - [Obtaining an OpenAI API Key](#obtaining-an-openai-api-key)\n   - [Node.js Prerequisites](#nodejs-prerequisites)\n   - [Go Prerequisites](#go-prerequisites)\n   - [Python Prerequisites](#python-prerequisites)\n5. [Configuration](#configuration)\n6. [Installation \u0026 Usage](#installation--usage)\n   - [Node.js](#nodejs)\n   - [Go](#go)\n   - [Python](#python)\n7. [How It Works](#how-it-works)\n   - [Architecture Overview](#architecture-overview)\n   - [Node.js Implementation Details](#nodejs-implementation-details)\n   - [Go Implementation Details](#go-implementation-details)\n   - [Python Implementation Details](#python-implementation-details)\n8. [Error Handling \u0026 Resilience](#error-handling--resilience)\n9. [Implementation Comparison](#implementation-comparison)\n10. [Troubleshooting](#troubleshooting)\n11. [Contributing](#contributing)\n12. [Security](#security)\n13. [License](#license)\n14. [Acknowledgements](#acknowledgements)\n\n---\n\n## Overview\n\n**ChatGPT CLI** provides a lightweight, interactive terminal interface to the [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat). You type a prompt, the application sends it to OpenAI, and the model's response is printed directly in your terminal. The loop repeats until you type `exit`.\n\nThe project contains three complete, independent implementations that all share the same high-level design:\n\n- **Node.js** — Uses the official `openai` npm package with async/await and exponential backoff retry logic.\n- **Go** — Uses Go's standard library `net/http` directly, with structured JSON types and a 10-second request timeout.\n- **Python** — Uses the `requests` library with Python dataclasses for type-safe request construction.\n\nYou only need to set up one implementation — choose whichever language you are most comfortable with.\n\n---\n\n## Features\n\n- **Interactive conversation loop** — Type prompts and receive responses in real time without leaving the terminal.\n- **Clean exit** — Type `exit` at any prompt to gracefully shut down the application.\n- **Empty input guard** — If you press Enter without typing anything, the application prompts you again rather than sending a blank request.\n- **Environment-based configuration** — API credentials are loaded from a `.env` file and are never hardcoded.\n- **Exponential backoff with retry (Node.js)** — Automatically retries failed requests up to three times, with delays of 2 s, 4 s, and 8 s. Respects the `Retry-After` response header when rate-limited.\n- **Request timeout (Go \u0026 Python)** — HTTP requests are bounded by a hard 10-second timeout to prevent indefinite hangs.\n- **Structured error reporting** — All implementations clearly report configuration errors and API failures to the terminal.\n- **Automated dependency updates** — Dependabot monitors all three package ecosystems and automatically merges patch and minor updates.\n\n---\n\n## Repository Structure\n\n```\nchatgpt-cli/\n├── .github/\n│   ├── dependabot.yml          # Monitors npm, Go modules, and pip for updates\n│   └── workflows/\n│       └── automerge.yml       # Auto-approves patch/minor Dependabot PRs\n├── golang/\n│   ├── main.go                 # Entry point: input loop, request dispatch, response display\n│   ├── types.go                # Go structs: Request, Message, Response, Choice, Content\n│   ├── go.mod                  # Module definition: requires Go 1.22, godotenv v1.5.1\n│   ├── go.sum                  # Dependency checksums (do not edit manually)\n│   ├── .env                    # Your credentials (not committed to version control)\n│   ├── .gitignore\n│   └── readme.md\n├── nodejs/\n│   ├── chatgpt.js              # Complete CLI application (ES module)\n│   ├── package.json            # npm scripts, dependencies (dotenv, openai)\n│   ├── package-lock.json       # Locked dependency tree\n│   ├── .env                    # Your credentials (not committed to version control)\n│   ├── .gitignore\n│   └── README.md\n├── python/\n│   ├── chat_cli.py             # Entry point: input loop and output display\n│   ├── send_request.py         # Handles HTTP request construction and execution\n│   ├── models.py               # Dataclasses: Message, RequestBody\n│   ├── requirements.txt        # Pinned dependencies\n│   ├── .env                    # Your credentials (not committed to version control)\n│   └── readme.md\n├── SECURITY.md                 # Vulnerability reporting policy\n└── readme.md                   # This file\n```\n\n\u003e **Note:** The `.env` files listed above are for your local credentials only. They are excluded from version control via `.gitignore`. Never commit API keys to a repository.\n\n---\n\n## Prerequisites\n\n### Obtaining an OpenAI API Key\n\nAll three implementations require a valid OpenAI API key. Follow these steps to obtain one:\n\n1. Visit [https://platform.openai.com/signup](https://platform.openai.com/signup) and create an account, or sign in if you already have one.\n2. Navigate to **API Keys** in the left sidebar (or go to [https://platform.openai.com/api-keys](https://platform.openai.com/api-keys)).\n3. Click **Create new secret key**, give it a descriptive name, and copy the key immediately — it will not be shown again.\n4. If your account belongs to an organization, note your **Organization ID** from [https://platform.openai.com/account/org-settings](https://platform.openai.com/account/org-settings). The Node.js implementation requires this; Go and Python do not.\n\n\u003e **Billing:** OpenAI API usage is billed per token. New accounts may receive free credits. Review your [usage limits](https://platform.openai.com/account/limits) before running the application extensively.\n\n---\n\n### Node.js Prerequisites\n\n| Requirement | Minimum Version | How to Check |\n|---|---|---|\n| Node.js | 18.x LTS or later | `node --version` |\n| npm | 8.x or later | `npm --version` |\n\nDownload Node.js from [https://nodejs.org](https://nodejs.org). npm is bundled with Node.js.\n\n---\n\n### Go Prerequisites\n\n| Requirement | Minimum Version | How to Check |\n|---|---|---|\n| Go | 1.22 or later | `go version` |\n\nDownload Go from [https://go.dev/dl](https://go.dev/dl). Follow the official installation instructions for your operating system. After installation, ensure `go` is on your `PATH`.\n\n---\n\n### Python Prerequisites\n\n| Requirement | Minimum Version | How to Check |\n|---|---|---|\n| Python | 3.7 or later | `python --version` or `python3 --version` |\n| pip | Any recent version | `pip --version` |\n\nDownload Python from [https://www.python.org/downloads](https://www.python.org/downloads). pip is included with Python 3.4+. Using a virtual environment is strongly recommended (see [Python setup](#python) below).\n\n---\n\n## Configuration\n\nEach implementation reads credentials from a `.env` file located in its own subdirectory. You must create this file before running the application. The `.env` file is excluded from version control.\n\n### Node.js — `nodejs/.env`\n\n```ini\nOPENAI_API_KEY=sk-...your-key-here...\nOPENAI_ORGANIZATION=org-...your-org-id-here...\n```\n\nBoth variables are required. The application exits with a clear error message if either is missing.\n\n### Go — `golang/.env`\n\n```ini\nOPENAI_API_KEY=sk-...your-key-here...\n```\n\nOnly the API key is required. The Go implementation does not use an organization ID.\n\n### Python — `python/.env`\n\n```ini\nOPENAI_API_KEY=sk-...your-key-here...\n```\n\nOnly the API key is required. The Python implementation does not use an organization ID.\n\n\u003e **Security reminder:** Treat your API key like a password. Do not share it, commit it, or embed it in code. If a key is ever exposed, rotate it immediately from the OpenAI dashboard.\n\n---\n\n## Installation \u0026 Usage\n\n### Node.js\n\n**1. Navigate to the Node.js directory:**\n\n```bash\ncd nodejs\n```\n\n**2. Install dependencies:**\n\n```bash\nnpm install\n```\n\nThis installs `dotenv` (environment variable loading) and `openai` (official OpenAI API client) as declared in `package.json`.\n\n**3. Create your `.env` file** (see [Configuration](#configuration) above).\n\n**4. Start the application:**\n\n```bash\nnpm start\n```\n\nAlternatively, you can run it directly with Node.js:\n\n```bash\nnode chatgpt.js\n```\n\n**5. Interact with the chatbot:**\n\n```\nPlease enter a prompt (type \"exit\" to quit): What is the capital of France?\nChatGPT: The capital of France is Paris.\n\nPlease enter a prompt (type \"exit\" to quit): exit\nGoodbye!\n```\n\n---\n\n### Go\n\n**1. Navigate to the Go directory:**\n\n```bash\ncd golang\n```\n\n**2. Download dependencies:**\n\n```bash\ngo mod download\n```\n\nThis fetches `github.com/joho/godotenv`, the only external dependency.\n\n**3. Create your `.env` file** (see [Configuration](#configuration) above).\n\n**4. Run the application:**\n\nYou can run without building (useful for development):\n\n```bash\ngo run .\n```\n\nOr run with explicit file names:\n\n```bash\ngo run main.go types.go\n```\n\nTo compile a binary and then run it:\n\n```bash\ngo build -o chatgpt-cli\n./chatgpt-cli\n```\n\nOn Windows the binary will be named `chatgpt-cli.exe` and is executed with:\n\n```bash\n.\\chatgpt-cli.exe\n```\n\n**5. Interact with the chatbot:**\n\n```\nEnter your prompt (or 'exit' to quit): Explain recursion in simple terms.\nChatGPT: Recursion is when a function calls itself...\n\nEnter your prompt (or 'exit' to quit): exit\n\nGoodbye!\n```\n\n---\n\n### Python\n\n**1. Navigate to the Python directory:**\n\n```bash\ncd python\n```\n\n**2. (Recommended) Create and activate a virtual environment:**\n\nOn macOS/Linux:\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\nOn Windows (Command Prompt):\n\n```cmd\npython -m venv venv\nvenv\\Scripts\\activate.bat\n```\n\nOn Windows (PowerShell):\n\n```powershell\npython -m venv venv\nvenv\\Scripts\\Activate.ps1\n```\n\nUsing a virtual environment isolates this project's dependencies from your system Python installation.\n\n**3. Install dependencies:**\n\n```bash\npip install -r requirements.txt\n```\n\nThis installs the following pinned packages:\n\n| Package | Version | Purpose |\n|---|---|---|\n| `requests` | 2.32.3 | HTTP client for OpenAI API calls |\n| `python-dotenv` | 1.0.1 | Loads `.env` files into environment variables |\n| `certifi` | 2025.1.31 | Up-to-date CA certificates for HTTPS |\n| `charset-normalizer` | 3.4.1 | Character encoding detection (requests dependency) |\n| `idna` | 3.10 | Internationalized domain names (requests dependency) |\n| `urllib3` | 2.3.0 | Low-level HTTP client (requests dependency) |\n\n**4. Create your `.env` file** (see [Configuration](#configuration) above).\n\n**5. Start the application:**\n\n```bash\npython chat_cli.py\n```\n\n**6. Interact with the chatbot:**\n\n```\nWelcome to the Python Chat CLI!\n\nEnter your prompt (or 'exit' to quit): Write a haiku about programming.\nChatGPT: Code flows like water,\nLogic blooms in silent loops,\nBugs fade into light.\n\nEnter your prompt (or 'exit' to quit): exit\n\nGoodbye!\n```\n\n**7. When finished, deactivate the virtual environment:**\n\n```bash\ndeactivate\n```\n\n---\n\n## How It Works\n\n### Architecture Overview\n\nAll three implementations follow the same request/response pattern:\n\n```\nUser types prompt\n       |\n       v\n Validate input (non-empty, not \"exit\")\n       |\n       v\nBuild request payload:\n  {\n    \"model\": \"\u003cmodel-name\u003e\",\n    \"messages\": [\n      { \"role\": \"user\", \"content\": \"\u003cuser prompt\u003e\" }\n    ]\n  }\n       |\n       v\nPOST https://api.openai.com/v1/chat/completions\n  Headers:\n    Authorization: Bearer \u003cOPENAI_API_KEY\u003e\n    Content-Type: application/json\n       |\n       v\nParse JSON response:\n  choices[0].message.content\n       |\n       v\nPrint response to terminal\n       |\n       v\nRepeat loop\n```\n\nThe conversation is **stateless** — each message is sent as a fresh single-turn request. There is no conversation history accumulation across turns; each prompt is treated independently.\n\n---\n\n### Node.js Implementation Details\n\n**File:** `nodejs/chatgpt.js`\n\nThe Node.js implementation is written as an ES module (`\"type\": \"module\"` in `package.json`) and uses `async`/`await` throughout.\n\n**Startup sequence:**\n1. `dotenv.config()` loads `nodejs/.env` into `process.env`.\n2. Both `OPENAI_API_KEY` and `OPENAI_ORGANIZATION` are validated. If either is absent, the process exits with code `1` and a descriptive error message.\n3. An `OpenAI` client instance is created using the official SDK.\n4. A `readline.Interface` is created, binding to `stdin`/`stdout`.\n\n**Request handling — `handleRequest(input, retries = 0)`:**\n\nThis async function wraps `openai.chat.completions.create()` in a `try/catch` block. On success, it prints the content from `res.choices[0].message.content`. On failure:\n\n- If the error is an HTTP 429 (rate limit), it reads the `Retry-After` response header (defaulting to exponential backoff if the header is absent) and schedules a retry via `setTimeout`.\n- For other errors, it applies exponential backoff: delay = `initialDelay * 2^retries` (2 s → 4 s → 8 s).\n- After `maxRetries` (3) attempts, it logs a final error and stops retrying.\n\n**Input loop — `askQuestion()`:**\n\nUses `userInterface.question()` to prompt the user. After `handleRequest` resolves, it chains `.then(() =\u003e askQuestion())` to present the next prompt. Typing `exit` (case-insensitive) closes the readline interface and terminates the process.\n\n**Model used:** `gpt-3.5-turbo`\n\n---\n\n### Go Implementation Details\n\n**Files:** `golang/main.go`, `golang/types.go`\n\nThe Go implementation uses only the standard library for HTTP and JSON, with a single third-party dependency for `.env` loading.\n\n**Type definitions (`types.go`):**\n\n```go\ntype Request  struct { Model string; Messages []Message }\ntype Message  struct { Role string; Content string }\ntype Response struct { Choices []Choice }\ntype Choice   struct { Message Content }\ntype Content  struct { Content string }\n```\n\nAll fields use `json:\"...,omitempty\"` tags for clean JSON serialization.\n\n**Startup sequence (`main.go`):**\n1. `godotenv.Load()` reads `golang/.env` — a fatal error if the file is missing or unreadable.\n2. `os.Getenv(\"OPENAI_API_KEY\")` is retrieved and validated — fatal if empty.\n3. An `http.Client` and a `bufio.Reader` on `os.Stdin` are created.\n\n**Request function — `sendOpenAIRequest`:**\n1. Marshals the `Request` struct to JSON using `encoding/json`.\n2. Creates a `context.WithTimeout` of **10 seconds** — any request that does not complete within this window is cancelled automatically.\n3. Constructs an `http.NewRequestWithContext` POST to `https://api.openai.com/v1/chat/completions` with `Authorization` and `Content-Type` headers.\n4. Executes the request and checks the HTTP status code. Any non-200 response reads the body and returns it as an error string.\n5. Decodes the JSON response into a `Response` struct and returns it.\n\n**Input loop:** A standard `for` loop with `reader.ReadString('\\n')` reads one line at a time. The prompt is trimmed of whitespace, checked for `exit` or empty string, then dispatched to `sendOpenAIRequest`.\n\n**Model used:** `gpt-3.5-turbo`\n\n---\n\n### Python Implementation Details\n\n**Files:** `python/chat_cli.py`, `python/send_request.py`, `python/models.py`\n\nThe Python implementation is split across three files following a separation-of-concerns approach.\n\n**Data models (`models.py`):**\n\n```python\n@dataclass\nclass Message:\n    role: str\n    content: str\n\n@dataclass\nclass RequestBody:\n    model: str\n    messages: List[Message]\n```\n\nPython 3.7+ dataclasses provide lightweight, type-annotated data containers. `dataclasses.asdict()` converts them to plain dictionaries for JSON serialization.\n\n**API layer (`send_request.py`):**\n\n`send_openai_request(api_key, user_prompt)` builds a `RequestBody` with `model=\"gpt-4\"`, serializes it with `json.dumps(asdict(body))`, and sends a POST request using `requests.post()` with a **10-second timeout**. If the status code is not 200, it prints the status and body before calling `raise_for_status()`. On success it extracts and returns `choices[0][\"message\"][\"content\"]`. Exceptions of type `requests.RequestException` or `KeyError` are caught and logged, returning `None`.\n\n**Entry point (`chat_cli.py`):**\n1. `load_dotenv()` reads `python/.env`.\n2. `OPENAI_API_KEY` is retrieved and validated.\n3. A `while True` loop reads input from `stdin` using Python's built-in `input()`, strips whitespace, checks for `exit` or empty strings, and calls `send_openai_request`.\n\n**Model used:** `gpt-4`\n\n---\n\n## Error Handling \u0026 Resilience\n\n| Scenario | Node.js | Go | Python |\n|---|---|---|---|\n| Missing `OPENAI_API_KEY` | `process.exit(1)` with message | `log.Fatal` | Prints error, returns from `main()` |\n| Missing `OPENAI_ORGANIZATION` | `process.exit(1)` with message | N/A | N/A |\n| Empty user input | Re-prompts | Re-prompts | Re-prompts |\n| HTTP 429 Rate Limit | Reads `Retry-After` header, retries | Returns error, continues loop | Prints status + body, returns `None` |\n| Other HTTP error | Retries up to 3x with backoff | Returns formatted error string | Prints status + body, returns `None` |\n| Request timeout | No hard timeout (relies on retry) | 10-second context cancellation | 10-second timeout on `requests.post()` |\n| JSON decode failure | SDK handles internally | Returns wrapped error | Caught as `KeyError`, returns `None` |\n| Max retries exceeded | Logs error, continues loop | N/A (no retry) | N/A (no retry) |\n\n---\n\n## Implementation Comparison\n\n| Property | Node.js | Go | Python |\n|---|---|---|---|\n| **Model** | `gpt-3.5-turbo` | `gpt-3.5-turbo` | `gpt-4` |\n| **OpenAI SDK** | Official `openai` npm package | None (direct `net/http`) | None (direct `requests`) |\n| **Retry logic** | Yes — 3 retries, exponential backoff | No | No |\n| **Rate limit awareness** | Yes — reads `Retry-After` header | No | No |\n| **Request timeout** | None (retry-based) | 10 s (context) | 10 s (requests param) |\n| **Env loading** | `dotenv` npm package | `godotenv` | `python-dotenv` |\n| **Org ID required** | Yes | No | No |\n| **Type safety** | Runtime checks | Compile-time structs | Dataclasses (runtime) |\n| **Concurrency model** | Async/await (event loop) | Synchronous (goroutine-ready) | Synchronous |\n| **External dependencies** | 2 (`dotenv`, `openai`) | 1 (`godotenv`) | 6 (including transitive) |\n| **File count** | 1 source file | 2 source files | 3 source files |\n\n---\n\n## Troubleshooting\n\n**`Error: Missing required environment variables (OPENAI_API_KEY)`**\nYou have not created a `.env` file or the variable name is misspelled. Check that the file exists in the correct subdirectory (`nodejs/`, `golang/`, or `python/`) and that it contains the correct variable name with no extra spaces around the `=` sign.\n\n**`Could not load .env file` (Go)**\nThe Go binary must be run from within the `golang/` directory, or the `.env` file must exist in the same directory as the working directory when the binary is executed. Ensure you `cd golang` before running `go run .`.\n\n**HTTP 401 Unauthorized**\nYour API key is invalid, has been revoked, or was copied incorrectly. Verify it in the OpenAI dashboard and update your `.env` file.\n\n**HTTP 429 Too Many Requests**\nYou have exceeded your rate limit or used up your free-tier credits. Check your [usage dashboard](https://platform.openai.com/usage). The Node.js implementation will automatically retry; the Go and Python implementations will log the error and continue the loop, allowing you to try again manually.\n\n**HTTP 404 Not Found (Python, gpt-4)**\nYour OpenAI account or tier may not have access to the `gpt-4` model. Verify model access at [https://platform.openai.com/account/limits](https://platform.openai.com/account/limits). If needed, change `model=\"gpt-4\"` to `model=\"gpt-3.5-turbo\"` in `python/send_request.py`.\n\n**`go: command not found`**\nGo is not installed or not in your `PATH`. Follow the [official installation guide](https://go.dev/doc/install) and ensure the Go install directory is in your `PATH`.\n\n**`ModuleNotFoundError` (Python)**\nDependencies have not been installed. Run `pip install -r requirements.txt` from within the `python/` directory, preferably inside a virtual environment.\n\n**`node: command not found` or `npm: command not found`**\nNode.js is not installed. Download it from [https://nodejs.org](https://nodejs.org).\n\n**Responses are slow or time out (Go/Python)**\nOpenAI API response times vary with model load. The 10-second timeout is intentionally conservative. If you consistently experience timeouts, check [https://status.openai.com](https://status.openai.com) for any ongoing incidents.\n\n---\n\n## Contributing\n\nContributions are welcome. Please follow these guidelines:\n\n1. **Fork** the repository and create your branch from `main`.\n2. **Keep changes focused** — one logical change per pull request.\n3. **Consistency** — if you change behavior in one language implementation, consider whether the same change applies to the others.\n4. **Do not commit `.env` files or API keys.** The `.gitignore` files prevent this, but double-check before pushing.\n5. **Open an issue first** for significant changes to discuss the approach before investing time in implementation.\n6. **Submit a pull request** with a clear description of what was changed and why.\n\nFor bug reports or feature requests, open an issue at [https://github.com/milliorn/chatgpt-cli/issues](https://github.com/milliorn/chatgpt-cli/issues).\n\n---\n\n## Security\n\nIf you discover a security vulnerability in this project, **do not open a public GitHub issue**, as this may expose the vulnerability to others before a fix is available.\n\nInstead, email the project maintainer directly at **\u003cscottmilliorn@gmail.com\u003e** with:\n\n- A description of the vulnerability\n- Steps to reproduce the issue\n- Any relevant logs or screenshots\n\nThe maintainer will acknowledge receipt, keep you informed of progress, and credit you in the release notes if desired. See [SECURITY.md](SECURITY.md) for the full disclosure policy.\n\nThis repository is also scanned automatically by [GitHub CodeQL](https://github.com/milliorn/chatgpt-cli/actions/workflows/github-code-scanning/codeql) for common vulnerability patterns on every push and pull request.\n\n---\n\n## License\n\nThis project is licensed under the **ISC License**.\n\nThe ISC License is a permissive open-source license functionally equivalent to the MIT License. You are free to use, copy, modify, and distribute this software for any purpose, with or without modification, provided that the copyright notice and license text are retained. See the [LICENSE](LICENSE) file for the full license text.\n\n---\n\n## Acknowledgements\n\n- [OpenAI](https://openai.com/) — For the GPT-3.5 and GPT-4 models and the Chat Completions API.\n- [openai-node](https://github.com/openai/openai-node) — The official OpenAI Node.js SDK used in the Node.js implementation.\n- [dotenv](https://www.npmjs.com/package/dotenv) — Environment variable loading for Node.js.\n- [godotenv](https://github.com/joho/godotenv) — `.env` file loading for the Go implementation.\n- [python-dotenv](https://pypi.org/project/python-dotenv/) — `.env` file loading for the Python implementation.\n- [Requests](https://docs.python-requests.org/) — Elegant HTTP library for Python.\n- [Dependabot](https://docs.github.com/en/code-security/dependabot) — Automated dependency update management across all three ecosystems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilliorn%2Fchatgpt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilliorn%2Fchatgpt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilliorn%2Fchatgpt-cli/lists"}