{"id":29088402,"url":"https://github.com/lovebirdsx/chatgpt-cli-extension","last_synced_at":"2026-04-28T01:31:08.171Z","repository":{"id":294454937,"uuid":"987015711","full_name":"lovebirdsx/chatgpt-cli-extension","owner":"lovebirdsx","description":"ChatGPT cli extension for google chrome.","archived":false,"fork":false,"pushed_at":"2025-05-30T04:34:24.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T03:02:08.177Z","etag":null,"topics":["chatgpt","cli","extension-chrome","googlechrome"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/lovebirdsx.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,"zenodo":null}},"created_at":"2025-05-20T12:59:16.000Z","updated_at":"2025-05-30T04:34:27.000Z","dependencies_parsed_at":"2025-06-28T03:02:05.204Z","dependency_job_id":"0f5cbdb1-7a00-4538-a9f6-f73d09c54499","html_url":"https://github.com/lovebirdsx/chatgpt-cli-extension","commit_stats":null,"previous_names":["lovebirdsx/chatgpt-cli-extension"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lovebirdsx/chatgpt-cli-extension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovebirdsx%2Fchatgpt-cli-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovebirdsx%2Fchatgpt-cli-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovebirdsx%2Fchatgpt-cli-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovebirdsx%2Fchatgpt-cli-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovebirdsx","download_url":"https://codeload.github.com/lovebirdsx/chatgpt-cli-extension/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovebirdsx%2Fchatgpt-cli-extension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32362780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["chatgpt","cli","extension-chrome","googlechrome"],"created_at":"2025-06-28T03:01:20.647Z","updated_at":"2026-04-28T01:31:08.155Z","avatar_url":"https://github.com/lovebirdsx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT CLI Connector\n\nThis project allows you to control the ChatGPT web interface (`https://chatgpt.com/`) from your command-line interface (CLI). It enables sending messages, starting new chats, deleting conversations, and stopping message generation directly from the terminal.\n\n## Overview\n\nThe project consists of three main components:\n\n1.  **Chrome Extension**: Injects a content script into the ChatGPT page to interact with its elements and listens for commands from the native host.\n    * `manifest.json`: Defines the extension, its permissions, and scripts.\n    * `background.js`: Service worker that manages communication between the content script and the native messaging host.\n    * `content.js`: Interacts with the ChatGPT DOM to perform actions like typing messages, clicking buttons, etc.\n    * `icons/`: Contains icons for the extension.\n2.  **Native Messaging Host**: A Node.js application that acts as a bridge between the Chrome extension (via standard I/O) and the CLI tool (via an HTTP server).\n    * `native-host/chatgpt-native-host.js`: The core logic of the native host. It listens for messages from the extension and exposes an HTTP endpoint for the CLI.\n    * `native-host/run-native-host.bat`: A batch script to execute the native host. The extension's manifest points to this.\n    * `native-host/lovebird.chatgpt_native_host.json` (Generated by `install.js`): The manifest file that Chrome uses to find and run the native host.\n3.  **CLI Tool**: A Node.js script that provides command-line access to control ChatGPT.\n    * `cli.js`: Parses command-line arguments and sends them as HTTP requests to the native messaging host.\n    * `chatgpt-cli.bat`: A batch script for conveniently running the `cli.js` script.\n\n## Features\n\n* **Select Model**: Choose between different ChatGPT models (1-5), injects the model selection into the ChatGPT page.\n  * Shortcut is `Alt + 1-5`.\n* **Toggle Skill**: Toggle by different ChatGPT skills (1-4), like `Create an image`, `Search the web`, `Write or code`, and `Run deep research`.\n  * Shortcut is `Ctrl + Alt + 1-4`.\n* **Search conversations**: Search for existing chats by name.\n  * Chatgpt default shortcut is `Ctrl + K` to open the search bar, but is conflicting with the browser's search functionality. Use `Alt + K` to open the search bar instead.\n* **Send Messages**: Send prompts to ChatGPT from your terminal.\n* **New Chat**: Start a new conversation.\n* **Delete Chat**: Delete the current conversation.\n* **Stop Generation**: Stop ChatGPT from generating a response.\n  * Shortcut is `Alt + S` to stop generation.\n* **Ping**: Test the connection to the extension.\n\n## Architecture Flow\n\n* User runs a command via `chatgpt-cli.bat` (e.g., `chatgpt-cli sendMessage \"Hello\"`).\n* `chatgpt-cli.bat` executes `cli.js` with the provided arguments.\n* `cli.js` sends an HTTP POST request to the **Native Messaging Host** (`native-host/chatgpt-native-host.js`) listening on `http://localhost:3333/command`.\n* The **Native Messaging Host** receives the HTTP request.\n* It then sends the command to the **Chrome Extension's `background.js`** script via the Native Messaging protocol (standard input/output).\n* `background.js` relays the command to the **`content.js`** script injected into the active ChatGPT tab.\n* `content.js` simulates user interaction on the ChatGPT webpage (e.g., typing text, clicking buttons).\n* `content.js` sends a response/status back to `background.js`.\n* `background.js` sends this response back to the **Native Messaging Host**.\n* The **Native Messaging Host** sends this response back as an HTTP response to `cli.js`.\n* `cli.js` prints the response to the terminal.\n\n## Prerequisites\n\n* [Node.js](https://nodejs.org/) installed (for the CLI tool and Native Host).\n* Google Chrome browser.\n* Windows Operating System (as the installation scripts are primarily for Windows).\n\n## Installation\n\nFollow the instructions in [INSTALL.md](./INSTALL.md). \n\n## Usage\n\nOnce installed, you can use the `chatgpt-cli` command from any command prompt. Ensure a ChatGPT tab (`https://chatgpt.com/`) is open in Chrome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovebirdsx%2Fchatgpt-cli-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovebirdsx%2Fchatgpt-cli-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovebirdsx%2Fchatgpt-cli-extension/lists"}