r/coolgithubprojects • u/Middle_Wing5512 • 9h ago
[Go] ChatPort - Export the active branch of a ChatGPT conversation to Markdown
I built ChatPort to turn ChatGPT exports into Markdown files for project context. When the export contains several branches of a conversation, ChatPort picks the branch the export marks as current.
In a synthetic export, the prompt “Which database?” has two branches. One answer says “Use SQLite.” and the other says “Use PostgreSQL.” The export's current_node points to an image-only turn after the PostgreSQL answer. ChatPort follows the parent links from that turn back to the root, then writes the text in conversation order. The Database section keeps “Use PostgreSQL.” and omits the image.
I changed only current_node in the Database conversation to point to the SQLite answer and ran the conversion again. The only line that changed in atlas/part-1.md was the answer, which became “Use SQLite.” The second conversation in the file stayed the same.
The converter produces Markdown files and an index for manual use as context. I tested the conversion locally with synthetic data. The Go source and a bundled example are at https://github.com/SuperMarioYL/chatport
If you were handing that context pack to another assistant, would you keep the alternate branches in a separate file, or carry over only the branch you were working on?

