A small macOS command line tool that turns the ChatGPT desktop app's normal Copy button pasteboard HTML into practical GitHub Flavored Markdown.
Current ChatGPT macOS app versions can expose a built-in Markdown copy path: right-click the response Copy button and choose "Copy as Markdown".
Use that first when it is available. This tool is a fallback for cases where you used the normal Copy button, need a repeatable clipboard post-processing step, or want to normalize already-captured pasteboard HTML.
The ChatGPT web app and the macOS ChatGPT app can copy different text for the same response.
In the macOS app, pressing a response's normal Copy button may place a pasteboard payload that looks like Markdown but does not behave like the web app's Markdown copy output. Observed artifacts include blockquotes copied as plain paragraphs, raw HTML tags or tables left in the copied text, and fragmented section headings.
I built this before noticing the right-click "Copy as Markdown" option, so the
main built-in path should be preferred. This tool remains useful as a
pasteboard-only fallback for the normal Copy button path, not as a replacement
for the built-in option. The original motivation was also raised publicly in an
X post from @bakemocho to @sama:
https://x.com/bakemocho/status/2006376232766820740.
- Reads the current macOS pasteboard
public.htmlpayload. - Converts it to GitHub Flavored Markdown with
pandoc. - Repairs observed ChatGPT app copy artifacts, including lost blockquotes, lingering raw HTML tables, escaped Markdown markers, and fragmented headings.
- Writes the normalized Markdown back to the pasteboard, unless
--dry-runis used.
- It does not patch, modify, or reverse engineer the ChatGPT app.
- It does not read ChatGPT local cache, Keychain data, cookies, authenticated storage, or conversation databases.
- It is not affiliated with OpenAI.
If you want to report the default Copy button behavior or discoverability of the built-in Markdown copy option, see docs/upstream-issue-draft.md. It is an evidence-first draft, not a submitted report.
- macOS
swiftcommand line toolpandoc
Install pandoc with Homebrew:
brew install pandocInstall the CLI:
make installAfter copying a response with the ChatGPT app's normal Copy button:
bin/chatgpt-app-copy-normalizer normalizeInspect the pasteboard payload types:
bin/chatgpt-app-copy-normalizer inspectCheck dependencies:
bin/chatgpt-app-copy-normalizer doctorConvert an HTML fixture or captured pasteboard HTML without touching the pasteboard:
bin/chatgpt-app-copy-normalizer convert-html fixtures/quote-loss.htmlPolish an existing Markdown file that still contains raw HTML tables or common copy artifacts:
bin/chatgpt-app-copy-normalizer polish-file notes.mdIf a user says they copied a ChatGPT app response, an agent can run:
bin/chatgpt-app-copy-normalizer normalize --jsonThen the agent should read the clipboard as Markdown. This route intentionally uses only the current pasteboard payload; it should not infer the latest conversation by reading ChatGPT app cache files.
Run fixture tests:
bash tests/run-fixtures.shUse environment variables to override tool paths:
CHATGPT_APP_COPY_NORMALIZER_PANDOC_BIN=/opt/homebrew/bin/pandoc \
CHATGPT_APP_COPY_NORMALIZER_SWIFT_BIN=/usr/bin/swift \
bin/chatgpt-app-copy-normalizer doctor