Skip to content

pepperpark/gpt-session-exporter

Repository files navigation

Chat Export as Markdown

Lightweight Chrome extension for saving ChatGPT conversations as clean Markdown. It injects a floating “Export chat as Markdown” button on chatgpt.com and can also be triggered from the extension icon. The export keeps role labels, cleans up repetitive UI strings, and prepends useful metadata (title, URL, timestamp).

Features

  • Converts rendered chat messages to Markdown via turndown + GFM plugin.
  • Deduplicates identical consecutive messages and strips noisy UI phrases.
  • Formats exports with per-role sections (user text quoted, assistant answers as blocks).
  • Downloads the Markdown file directly in the browser with a document title–based filename.
  • Works on chatgpt.com without extra configuration.

Getting Started

  1. Install dependencies (pnpm recommended):
    pnpm install
    # or: npm install
  2. Build the bundled background and content scripts (also packages a ZIP under deployment/):
    pnpm build
    Outputs land in dist/background.js, dist/contentScript.js, and a versioned archive in deployment/.

Load Into Chrome

  1. Open chrome://extensions.
  2. Toggle Developer mode.
  3. Click Load unpacked and select the dist/ folder (generated after running the build).
  4. Ensure the extension is enabled; rebuild + reload when you change code.

Usage

  • While on ChatGPT, click the browser action icon or use the injected button in the lower-right corner.
  • The content script collects messages ([data-message-author-role] nodes), converts them to Markdown, and triggers a download named after the conversation title.
  • User prompts are exported as blockquotes, assistant replies as standard Markdown, giving you a ready-to-share transcript.

Development Notes

  • Build tooling relies on esbuild (see package.json) with TypeScript sources under src/.
  • pnpm-workspace.yaml limits built dependencies to esbuild, keeping install size minimal.
  • The build copies manifest.json into dist/; load the extension from that folder or use the ZIP in deployment/ for distribution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors