A command-line tool to download and convert AI chat conversations to markdown format. It allows you to save and share conversations from popular AI platforms in a readable, portable format.
Feature | ChatGPT | Claude | Grok |
---|---|---|---|
Code Blocks | ✅ | ✅ | ✅ |
Web Citations | ✅ (content refs) | ❌ | ✅ (tweets, web) |
Artifacts | ❌ | ✅ | ❌ |
REPL | ❌ | ✅ | ❌ |
Reasoning | ❌ | ❌ | ✅ (thinking trace) |
Enterprise | ✅ | ❌ | ❌ |
No installation is required, you can run the CLI directly using npx
:
# Output to stdout (default)
npx chat-dl <url>
# Save to file
npx chat-dl --output chat.md <url>
The CLI supports three main commands:
url2md
: Convert chat URL directly to markdown (default)url2json
: Download chat data as JSONjson2md
: Convert JSON to markdown
# Basic usage - outputs to console
npx chat-dl https://chatgpt.com/share/feacac46-4201-48c5-9fb6-e3109475c8c8
# Two-step process with intermediate JSON
npx chat-dl url2json --output chat.json https://x.com/i/grok/share/ntS9ACoPKa2XcPwFnFYT2uUiL
cat chat.json | npx chat-dl json2md --output chat.md
These links are not publicly accessible and require authentication. The tool provides two methods to handle these links:
- Start Chrome with remote debugging enabled:
# On macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
# On Windows
"C:\Program Files\Google Chrome\chrome.exe" --remote-debugging-port=9222
# On Linux
google-chrome --remote-debugging-port=9222
- Set the environment variable to connect to the debugger:
export PUPPETEER_BROWSER_WS_ENDPOINT=ws://127.0.0.1:9222/devtools/browser
- Run the tool normally:
npx chat-dl <enterprise-share-url>
If you can't run Chrome in debug mode, you can:
- Open the shared link in your browser
- Open the browser's Developer Tools (F12 or Cmd+Option+I)
- Paste the extraction code in the Console tab (the tool will show you the exact code)
- Copy the output
- Paste it back to the tool when prompted
npm install
npm start -- <url>