opencode-chat-exporter 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opencode_chat_exporter-1.0.0/LICENSE +21 -0
- opencode_chat_exporter-1.0.0/PKG-INFO +109 -0
- opencode_chat_exporter-1.0.0/README.md +82 -0
- opencode_chat_exporter-1.0.0/chat_exporter/__init__.py +2 -0
- opencode_chat_exporter-1.0.0/chat_exporter/__main__.py +16 -0
- opencode_chat_exporter-1.0.0/chat_exporter/antigravity.py +599 -0
- opencode_chat_exporter-1.0.0/chat_exporter/cli.py +194 -0
- opencode_chat_exporter-1.0.0/chat_exporter/db.py +149 -0
- opencode_chat_exporter-1.0.0/chat_exporter/gui.py +546 -0
- opencode_chat_exporter-1.0.0/chat_exporter/render.py +272 -0
- opencode_chat_exporter-1.0.0/opencode_chat_exporter.egg-info/PKG-INFO +109 -0
- opencode_chat_exporter-1.0.0/opencode_chat_exporter.egg-info/SOURCES.txt +16 -0
- opencode_chat_exporter-1.0.0/opencode_chat_exporter.egg-info/dependency_links.txt +1 -0
- opencode_chat_exporter-1.0.0/opencode_chat_exporter.egg-info/entry_points.txt +2 -0
- opencode_chat_exporter-1.0.0/opencode_chat_exporter.egg-info/requires.txt +1 -0
- opencode_chat_exporter-1.0.0/opencode_chat_exporter.egg-info/top_level.txt +1 -0
- opencode_chat_exporter-1.0.0/pyproject.toml +42 -0
- opencode_chat_exporter-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nasro2123
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opencode-chat-exporter
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Export OpenCode / AntiGravity local chats to a single connected Markdown file (GUI + CLI)
|
|
5
|
+
Author: nasro2123
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nasro2123/chat-exporter
|
|
8
|
+
Project-URL: Repository, https://github.com/nasro2123/chat-exporter
|
|
9
|
+
Project-URL: Issues, https://github.com/nasro2123/chat-exporter/issues
|
|
10
|
+
Keywords: opencode,antigravity,chat,export,markdown,cli
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: customtkinter==5.2.2
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# Chat Exporter
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **Two chat sources**: OpenCode or AntiGravity (switch from the GUI or CLI)
|
|
35
|
+
- **Simple, clean GUI** (CustomTkinter) to browse and preview conversations
|
|
36
|
+
- **Live preview** with color-coded messages (you / assistant / tools)
|
|
37
|
+
- **Full export** of each conversation into one connected Markdown file — not separate sections
|
|
38
|
+
- Export all conversations to a folder, or everything into a single file
|
|
39
|
+
- **Live watch mode**: automatically re-export when the source updates
|
|
40
|
+
- Fully equivalent command-line interface
|
|
41
|
+
|
|
42
|
+
## Requirements
|
|
43
|
+
|
|
44
|
+
- Python 3.10+
|
|
45
|
+
|
|
46
|
+
## Building the EXE
|
|
47
|
+
|
|
48
|
+
**Easiest way:** double-click `build.bat`
|
|
49
|
+
|
|
50
|
+
Or from PowerShell:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
.\build.ps1 # onedir build (faster startup)
|
|
54
|
+
.\build.ps1 -OneFile # single-file exe (easier to share)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The script handles everything automatically: creating a `.venv`, installing dependencies, then building with PyInstaller. Output goes to `dist\`.
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
pip install -r requirements.txt
|
|
63
|
+
|
|
64
|
+
# GUI
|
|
65
|
+
python run.py
|
|
66
|
+
|
|
67
|
+
# CLI — OpenCode (default)
|
|
68
|
+
python -m chat_exporter --cli list
|
|
69
|
+
python -m chat_exporter --cli export --latest
|
|
70
|
+
|
|
71
|
+
# CLI — AntiGravity
|
|
72
|
+
python -m chat_exporter --cli --source antigravity list
|
|
73
|
+
python -m chat_exporter --cli --source antigravity export --latest
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Default locations
|
|
77
|
+
|
|
78
|
+
| Source | Path |
|
|
79
|
+
|---|---|
|
|
80
|
+
| OpenCode | `%USERPROFILE%\.local\share\opencode\opencode.db` |
|
|
81
|
+
| AntiGravity | `%USERPROFILE%\.gemini\antigravity` |
|
|
82
|
+
|
|
83
|
+
The path can be changed from the "…" button in the GUI or via `--db` (for AntiGravity, pass the `antigravity` folder containing `conversations\` and `brain\`).
|
|
84
|
+
|
|
85
|
+
### How does AntiGravity reading work?
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
## Project structure
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Chat Exporter/
|
|
93
|
+
├── chat_exporter/
|
|
94
|
+
│ ├── db.py # OpenCode database reader (sessions / messages / parts) + factory
|
|
95
|
+
│ ├── antigravity.py # AntiGravity reader (transcript.jsonl + protobuf fallback)
|
|
96
|
+
│ ├── render.py # Conversation -> full Markdown renderer
|
|
97
|
+
│ ├── gui.py # Graphical interface
|
|
98
|
+
│ ├── cli.py # Command-line interface
|
|
99
|
+
│ └── __main__.py
|
|
100
|
+
├── run.py # Launch the GUI
|
|
101
|
+
├── run_gui.py
|
|
102
|
+
├── build.bat # One-click EXE build
|
|
103
|
+
├── build.ps1 # Build script (auto venv + PyInstaller)
|
|
104
|
+
└── requirements.txt
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Privacy
|
|
108
|
+
|
|
109
|
+
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.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Chat Exporter
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Two chat sources**: OpenCode or AntiGravity (switch from the GUI or CLI)
|
|
8
|
+
- **Simple, clean GUI** (CustomTkinter) to browse and preview conversations
|
|
9
|
+
- **Live preview** with color-coded messages (you / assistant / tools)
|
|
10
|
+
- **Full export** of each conversation into one connected Markdown file — not separate sections
|
|
11
|
+
- Export all conversations to a folder, or everything into a single file
|
|
12
|
+
- **Live watch mode**: automatically re-export when the source updates
|
|
13
|
+
- Fully equivalent command-line interface
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Python 3.10+
|
|
18
|
+
|
|
19
|
+
## Building the EXE
|
|
20
|
+
|
|
21
|
+
**Easiest way:** double-click `build.bat`
|
|
22
|
+
|
|
23
|
+
Or from PowerShell:
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
.\build.ps1 # onedir build (faster startup)
|
|
27
|
+
.\build.ps1 -OneFile # single-file exe (easier to share)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The script handles everything automatically: creating a `.venv`, installing dependencies, then building with PyInstaller. Output goes to `dist\`.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
pip install -r requirements.txt
|
|
36
|
+
|
|
37
|
+
# GUI
|
|
38
|
+
python run.py
|
|
39
|
+
|
|
40
|
+
# CLI — OpenCode (default)
|
|
41
|
+
python -m chat_exporter --cli list
|
|
42
|
+
python -m chat_exporter --cli export --latest
|
|
43
|
+
|
|
44
|
+
# CLI — AntiGravity
|
|
45
|
+
python -m chat_exporter --cli --source antigravity list
|
|
46
|
+
python -m chat_exporter --cli --source antigravity export --latest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Default locations
|
|
50
|
+
|
|
51
|
+
| Source | Path |
|
|
52
|
+
|---|---|
|
|
53
|
+
| OpenCode | `%USERPROFILE%\.local\share\opencode\opencode.db` |
|
|
54
|
+
| AntiGravity | `%USERPROFILE%\.gemini\antigravity` |
|
|
55
|
+
|
|
56
|
+
The path can be changed from the "…" button in the GUI or via `--db` (for AntiGravity, pass the `antigravity` folder containing `conversations\` and `brain\`).
|
|
57
|
+
|
|
58
|
+
### How does AntiGravity reading work?
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
## Project structure
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Chat Exporter/
|
|
66
|
+
├── chat_exporter/
|
|
67
|
+
│ ├── db.py # OpenCode database reader (sessions / messages / parts) + factory
|
|
68
|
+
│ ├── antigravity.py # AntiGravity reader (transcript.jsonl + protobuf fallback)
|
|
69
|
+
│ ├── render.py # Conversation -> full Markdown renderer
|
|
70
|
+
│ ├── gui.py # Graphical interface
|
|
71
|
+
│ ├── cli.py # Command-line interface
|
|
72
|
+
│ └── __main__.py
|
|
73
|
+
├── run.py # Launch the GUI
|
|
74
|
+
├── run_gui.py
|
|
75
|
+
├── build.bat # One-click EXE build
|
|
76
|
+
├── build.ps1 # Build script (auto venv + PyInstaller)
|
|
77
|
+
└── requirements.txt
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Privacy
|
|
81
|
+
|
|
82
|
+
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.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Entry point: `python -m chat_exporter` launches the GUI, `--cli` runs the console tool."""
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
from .cli import main as cli_main
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
if len(sys.argv) > 1 and sys.argv[1] in ("--cli", "export", "list", "export-all", "watch"):
|
|
9
|
+
sys.argv = sys.argv[:1] + [a for a in sys.argv[1:] if a != "--cli"]
|
|
10
|
+
sys.exit(cli_main())
|
|
11
|
+
from .gui import main as gui_main
|
|
12
|
+
gui_main()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
main()
|