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 | Gemini | Grok |
|---|---|---|---|---|
| Code Blocks | ✅ | ✅ | ✅ | ✅ |
| Web Citations | ✅ (content refs) | ❌ | ❌ | ✅ (tweets, web) |
| Artifacts | ❌ | ✅ | ❌ | ❌ |
| REPL | ❌ | ✅ | ❌ | ❌ |
| Reasoning | ✅ (shared text) | ❌ | ❌ | ✅ (thinking trace) |
| Enterprise | ✅ | ❌ | ❌ | ❌ |
Gemini accepts both the share.gemini.google short link and the
gemini.google.com/share/<id> link it redirects to.
Local transcripts are supported for Antigravity, Claude Code, Codex CLI, Kiro,
and OpenCode.
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>'Available commands:
url2md: Convert a chat URL or local chat file directly to markdown (default)url2json: Download chat data from a URL or parse a local chat file as JSONjson2md: Convert JSON to markdowndir2md: Recursively convert supported local chat files in a directory to markdownopencode2md: Convert sessions from OpenCode's local SQLite database to markdown
# Basic usage - outputs to console
npx chat-dl https://chatgpt.com/share/feacac46-4201-48c5-9fb6-e3109475c8c8
# Gemini shared conversation
npx chat-dl https://share.gemini.google/3klxEXHcOBOl
# 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
# Convert local Claude Code JSONL transcripts
npx chat-dl dir2md ~/.claude/projects --output ./claude-transcripts
# Convert local Codex CLI JSONL transcripts
npx chat-dl dir2md ~/.codex/sessions --output ./codex-transcripts
# Convert local Kiro IDE session transcripts
npx chat-dl dir2md ~/.kiro/sessions --output ./kiro-transcripts
# Convert local Antigravity session databases
npx chat-dl dir2md ~/.gemini/antigravity/conversations --output ./antigravity-transcripts
# Find sessions by workspace or title
npx chat-dl dir2md ~/.gemini/antigravity/conversations --match my-workspace --output ./antigravity-transcripts
# Convert one Antigravity session (replace <uuid> with the session ID)
npx chat-dl url2md "$HOME/.gemini/antigravity/conversations/<uuid>.db"
# Export every top-level OpenCode session (grouped as <sanitized-full-path>/<YYYY-MM-DD>/<session-id>.md)
npx chat-dl opencode2md --output ./opencode-transcripts
# Same, filtered by update date and a directory/title substring
npx chat-dl opencode2md --since 2026-08-01 --match my-repo --output ./opencode-transcripts
# Export one OpenCode session
npx chat-dl opencode2md ses_... --output chat.mdMarkdown conversion of JSONL transcripts retains usable conversation around
invalid records and includes warnings when records are omitted or text is
recovered. It fails if no conversation can be recovered. url2json validates
JSONL records strictly. Bulk exports continue after individual failures and
return a nonzero exit status if any export fails.
Antigravity export supports SQLite conversation files (.db). Legacy .pb
sessions are skipped by directory export. Bulk exports group sessions by workspace
and creation date, and include subagent summaries in the parent transcript when
the parent is also selected. Markdown includes stored timestamps, model names,
token usage, reasoning, and local attachment references when available. Markdown
keeps usable steps around malformed records and reports warnings.
Supported Gemini models use Google API rates
for cost estimates. Published pricing changes use request dates in UTC.
Antigravity subscription billing is separate.
Use --skip-tool-outputs with any Markdown command to omit tool results while
keeping tool calls and their inputs. For example:
npx chat-dl --skip-tool-outputs --output chat.md '<url>'Markdown CLI exports scan human messages and tool outputs locally. When a
potential credential is detected, the whole message or output is replaced with
a redaction notice. Assistant messages and tool-call arguments are not scanned.
Detection can miss credentials and can also redact harmless text; review exports
before sharing them. JSON exports from url2json, cached source data, and direct
library rendering calls are not redacted.
Use --no-redact to disable Markdown redaction when an exact export is needed.
Some shared links are not publicly accessible and require authentication in your browser. Public links use the default Puppeteer browser path. For protected links, use your existing Chrome credentials by enabling Chrome's remote debugging UI and running the tool while Chrome is still open.
For the Chrome DevTools MCP-style auto-connect flow in Chrome 144+:
- Open
chrome://inspect/#remote-debugging - Allow incoming debugging connections
- Run the tool with
--existing-chrome:
npx chat-dl --existing-chrome '<protected-share-url>'Use a Node.js version allowed by engines.node in package.json.
The tsup esbuild override uses the project's direct esbuild dependency to
avoid the vulnerable 0.27 release line. Remove the override when tsup supports
the patched version in its own dependency range.
npm install
npm start -- '<url>'npm testRuns the offline regression suite against committed synthetic fixtures for
every supported provider — no network access or personal data required. See
tests/README.md for coverage details and the separate
live integration workflow.
Run npm test before preparing a package. npm pack runs the formatting and
lint checks and rebuilds the CLI, library, and type declarations before creating
the tarball. Install that tarball in a separate directory to check the published
CLI and library entry points. npm run public publishes to npm and runs the same
prepack checks.
To smoke-test the Claude Code parser and renderer against recent local transcripts:
npm run verify:claude-jsonlThe script checks recent .jsonl files under ~/.claude/projects by default.
You can override the source and count with CLAUDE_PROJECTS_DIR and
CLAUDE_JSONL_LIMIT.
To check the URL providers against a list of known shared conversations:
npm run verify:urlsEach fixture records the heading count its conversation should render, so a
provider that starts dropping turns fails instead of quietly returning less.
The run bypasses the download cache, defaults to headless Chrome, and exits non-zero
on any divergence. Pass provider names to narrow it (npm run verify:urls -- gemini),
--cached to reuse downloads, and --blocked to also attempt fixtures that
bot protection rejects in headless Chrome.
Fixtures recorded as broken or blocked document providers that are already
failing: expected failures do not fail the run. Unexpected successes are reported
as FIXED? and return a nonzero exit status so the fixture can be reassessed.
To regression-test that dir2md and opencode2md keep processing every
selected candidate but exit non-zero when any export fails:
npm run verify:bulk-exit-statusTo check the Puppeteer browser-ownership and cleanup logic:
npm run verify:puppeteerThe script mocks puppeteer.connect/puppeteer.launch and asserts that
borrowed browsers (connected via PUPPETEER_BROWSER_WS_ENDPOINT) are only
disconnected, never closed, while browsers launched by chat-dl itself are
always closed, including when setup or page cleanup fails.