https://github.com/laike9m/logseq-chatgpt
Talk to ChatGPT directly from Logseq
https://github.com/laike9m/logseq-chatgpt
chatgpt logseq logseq-plugin
Last synced: 2 months ago
JSON representation
Talk to ChatGPT directly from Logseq
- Host: GitHub
- URL: https://github.com/laike9m/logseq-chatgpt
- Owner: laike9m
- License: mit
- Created: 2022-12-27T08:29:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-12T05:18:28.000Z (about 2 years ago)
- Last Synced: 2025-04-13T10:31:06.916Z (2 months ago)
- Topics: chatgpt, logseq, logseq-plugin
- Language: JavaScript
- Homepage:
- Size: 180 KB
- Stars: 37
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**UPDATE: Project not maintained. Please use [logseq-plugin-gpt3-openai](https://github.com/briansunter/logseq-plugin-gpt3-openai)**
**DISCLAIMER: The code needs some serious testing and polishing, and it's far from feature complete. All feedbacks welcome.** I'll submit it to the marketplace once it becomes more mature.
# logseq-chatgpt
logseq-chatgpt is a [Logseq](https://github.com/logseq/logseq) plugin that lets you interact with [ChatGPT](https://chat.openai.com/chat) directly from Logseq, similar to the [Logseq GPT3 plugin](https://github.com/briansunter/logseq-plugin-gpt3-openai).
## Usage
In Logseq, enable developer mode in `Settings > Advanced`. [Download](https://github.com/laike9m/logseq-chatgpt/archive/refs/heads/main.zip) the repo, unzip it, and load the plugin manually by choosing the "logseq-chatgpt" folder.

In Logseq, type `/` to find and run the `chatgpt-reply` command, then wait for the response from ChatGPT to show up. Here's a demo:

The plugin only works for Chrome (probably other Chromium-based browsers as well) at the moment.
## Setup
To use this plugin, some setup is needed, but I assure you it's very simple:
* Close Chrome, and launch it with a command line argument `--remote-debugging-port=9222`
It's recommended to create a shortcut to always run Chrome with this option, see the [guidance](https://stackoverflow.com/a/58457229/2142577), but you can also do it manually:* Windows
```
/path/to/chrome.exe --remote-debugging-port=9222
```* Mac
```
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
```* Linux
```
chrome --remote-debugging-port=9222
```- Login to ChatGPT and keep tab open
https://chat.openai.com/chat
Make sure you're logged in while using this plugin (refresh the page if the session expires).
## How it works
As I'm writing this, there's no official API for ChatGPT. Though there are some reverse-engineered APIs out there, there's no guarantee that they'll always work reliably, as I've seen OpenAI trying very hard to kill some of these efforts.
Therefore, logseq-chatgpt takes a different yet more straightforward approach: it assumes users have already logged into ChatGPT, so it only needs to automate the process of entering inputs, and fetching responses. I use [puppeteer-web](https://github.com/entrptaher/puppeteer-web) to do it, the communication is done via the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), and that's we need to run Chrome with `--remote-debugging-port`.