Skip to main content

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

opencode_chat_exporter-1.0.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencode_chat_exporter-1.0.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

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

Hashes for opencode_chat_exporter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dd913a370a77fd8553079411743b03d69af8287d956ca291bc77aa02efc13f7f
MD5 cb0026bd6eed1fe664e96d74a700519e
BLAKE2b-256 26370d13ebb6d2a081cf3042197987d4fef747f01dc1bb4f9a9dd1f2876ffb86

See more details on using hashes here.

File details

Details for the file opencode_chat_exporter-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opencode_chat_exporter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 846920b4103d3c7af305f31c4c4528384952cb006fe9c998d280876a0ae77c1b
MD5 5dc73e603214b644a21e2ecb91fee0f7
BLAKE2b-256 8380921571bcb64a132b85565c7ace918dad163f36fd715af17781a1f3e852e2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page