Chat Exporter
A Python tool that exports your local chats — from OpenCode (Desktop) or AntiGravity (Google) — into one single connected Markdown file, preserving every detail verbatim: user and assistant messages, CMD / PowerShell commands, tool outputs, file & search operations, and attachments.
Features
- Two chat sources: OpenCode or AntiGravity (switch from the GUI or CLI)
- Simple, clean GUI (CustomTkinter) to browse and preview conversations
- Live preview with color-coded messages (you / assistant / tools)
- Full export of each conversation into one connected Markdown file — not separate sections
- Export all conversations to a folder, or everything into a single file
- Live watch mode: automatically re-export when the source updates
- Fully equivalent command-line interface
Requirements
- Python 3.10+
Building the EXE
Easiest way: double-click build.bat
Or from PowerShell:
.\build.ps1 # onedir build (faster startup)
.\build.ps1 -OneFile # single-file exe (easier to share)
The script handles everything automatically: creating a .venv, installing dependencies, then building with PyInstaller. Output goes to dist\.
Usage
pip install -r requirements.txt
# GUI
python run.py
# CLI — OpenCode (default)
python -m chat_exporter --cli list
python -m chat_exporter --cli export --latest
# CLI — AntiGravity
python -m chat_exporter --cli --source antigravity list
python -m chat_exporter --cli --source antigravity export --latest
Default locations
| Source | Path |
|---|---|
| OpenCode | %USERPROFILE%\.local\share\opencode\opencode.db |
| AntiGravity | %USERPROFILE%\.gemini\antigravity |
The path can be changed from the "…" button in the GUI or via --db (for AntiGravity, pass the antigravity folder containing conversations\ and brain\).
How does AntiGravity reading work?
Conversations are stored in a SQLite database with a step_payload column encoded as protobuf. The reader first tries the plain-text transcript.jsonl generated by the app under brain\<uuid>\.system_generated\logs\ (easy and readable); if not found, it decodes the protobuf directly from the database. Both paths produce identical output.
Project structure
Chat Exporter/
├── chat_exporter/
│ ├── db.py # OpenCode database reader (sessions / messages / parts) + factory
│ ├── antigravity.py # AntiGravity reader (transcript.jsonl + protobuf fallback)
│ ├── render.py # Conversation -> full Markdown renderer
│ ├── gui.py # Graphical interface
│ ├── cli.py # Command-line interface
│ └── __main__.py
├── run.py # Launch the GUI
├── run_gui.py
├── build.bat # One-click EXE build
├── build.ps1 # Build script (auto venv + PyInstaller)
└── requirements.txt
Privacy
Everything runs locally — the tool reads data on your machine and writes Markdown files only. Nothing is sent to the internet. Review exported files before sharing them; they may contain sensitive paths and data from your sessions.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencode_chat_exporter-1.0.0.tar.gz.
File metadata
- Download URL: opencode_chat_exporter-1.0.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd913a370a77fd8553079411743b03d69af8287d956ca291bc77aa02efc13f7f
|
|
| MD5 |
cb0026bd6eed1fe664e96d74a700519e
|
|
| BLAKE2b-256 |
26370d13ebb6d2a081cf3042197987d4fef747f01dc1bb4f9a9dd1f2876ffb86
|
File details
Details for the file opencode_chat_exporter-1.0.0-py3-none-any.whl.
File metadata
- Download URL: opencode_chat_exporter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
846920b4103d3c7af305f31c4c4528384952cb006fe9c998d280876a0ae77c1b
|
|
| MD5 |
5dc73e603214b644a21e2ecb91fee0f7
|
|
| BLAKE2b-256 |
8380921571bcb64a132b85565c7ace918dad163f36fd715af17781a1f3e852e2
|