Skip to main content

Convert Microsoft 365 Copilot chat exports to readable HTML and Markdown transcripts

Project description

copilot-chat-transcribe

Convert Microsoft 365 Copilot chat sessions into clean, readable transcripts — a styled HTML file you can open in any browser, and a plain Markdown file for note-taking apps.

Two modes:

Mode When to use
File mode You already have a JSON export from the browser
--connect mode Let the tool fetch the conversation live from your signed-in Edge browser

Installation

pip install copilot-chat-transcribe

For --connect mode (live browser download via Playwright):

pip install "copilot-chat-transcribe[connect]"
playwright install msedge

No-install option (uv / uvx)

# one-off run
uvx --from copilot-chat-transcribe copilot-chat-transcribe --help

# with --connect support
uvx --from "copilot-chat-transcribe[connect]" copilot-chat-transcribe --connect

Quick start

Mode 1 — convert a JSON file

copilot-chat-transcribe conversation.json

You will be asked for an output folder name (the filename stem is suggested as the default). Skip the prompt by passing -o:

copilot-chat-transcribe conversation.json -o my-chat

Three files are written into the folder:

my-chat/
├── transcript.html    ← open in any browser
├── transcript.md      ← paste into Obsidian, Notion, etc.
└── conversation.json  ← original export, archived alongside

Open the HTML automatically when done:

copilot-chat-transcribe conversation.json -o my-chat --open

Mode 2 — live download (--connect)

This mode connects to your already-running Microsoft Edge browser using its remote debugging interface, so it can read your signed-in Copilot session without you needing to copy any cookies or tokens.

copilot-chat-transcribe --connect

Step-by-step walkthrough:

  1. The tool checks whether Edge is already listening on port 9222.
  2. If not, it asks:
    MSEdge not found on port 9222. Start it now? [Y/n]
    
    Press Enter (or Y) to launch Edge automatically with remote debugging enabled.
  3. Edge opens at chat.cloud.microsoft. Sign in if needed, then press Enter in the terminal.
  4. The tool fetches your latest 10 conversations and shows a numbered list:
    Latest 10 conversations:
     1. Python data pipeline question  (2026-03-28 14:32)
     2. Draft email to team            (2026-03-27 09:11)
     ...
    Select conversation [1]: 
    
  5. Press Enter to accept the default (most recent) or type a number.
  6. The conversation is downloaded, parsed, and written to the output folder.

Specify the output folder and open immediately:

copilot-chat-transcribe --connect -o my-chat --open

Starting Edge manually instead

If you prefer to start Edge yourself before running the tool:

Windows:

& "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222

macOS:

/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --remote-debugging-port=9222

Then run copilot-chat-transcribe --connect as normal.


All options

copilot-chat-transcribe [-h] [--connect | input] [-o FOLDER] [--cdp-url URL] [--open] [--version]
Flag Default Description
input (positional) Path to a M365 Copilot JSON export file
--connect Enable live browser download mode
-o / --output FOLDER (prompted) Output folder path
--cdp-url URL http://localhost:9222 Chrome DevTools Protocol endpoint
--open off Open transcript.html in the default browser when done
--version Print version and exit

input and --connect are mutually exclusive — use one or the other.


Output format

transcript.html

  • Self-contained — one file, no internet connection needed, works offline
  • User messages — right-aligned blue speech bubbles
  • Copilot responses — left-aligned, rendered Markdown (headings, tables, code blocks with syntax highlighting)
  • Images — attached files embedded as inline base64 <img> tags
  • Timestamps — stored as UTC in the HTML, converted to your local time by the browser

transcript.md

  • ## You / ## Copilot headers separate each turn
  • Copilot responses are reproduced in their original Markdown
  • Images are not embedded (the filename is noted as a placeholder)
  • Suitable for pasting into Obsidian, Notion, Confluence, or any Markdown editor

Where does the JSON come from? (File mode)

If you want to export a conversation yourself without --connect:

  1. Open chat.cloud.microsoft in Edge or Chrome
  2. Open DevTools → Network tab
  3. Start a conversation or reload the page
  4. Filter requests by conversation — look for a GET request to
    https://m365.cloud.microsoft/chat/conversation/<uuid>
  5. Right-click the request → Copy → Copy response
  6. Paste into a .json file and run copilot-chat-transcribe that-file.json

Troubleshooting

Error: Playwright is required for --connect mode

Install the connect extra:

pip install "copilot-chat-transcribe[connect]"
playwright install msedge

Edge opens but the tool can't connect

Make sure Edge was launched with the debugging flag.
If Edge was already running before you ran the tool, close it fully (check the system tray) and let the tool start it, or start it manually with --remote-debugging-port=9222.

UnicodeEncodeError on Windows

Set the terminal encoding before running:

$env:PYTHONIOENCODING = "utf-8"
copilot-chat-transcribe conversation.json -o out

Or permanently in your PowerShell profile.

The conversation list is empty

The tool fetches the 10 most recent conversations from the Copilot nav pane API. Make sure you are signed in to chat.cloud.microsoft in the browser window that Edge opened.


Development

git clone https://github.com/your-org/copilot-chat-transcribe
cd copilot-chat-transcribe
uv venv
uv pip install -e ".[connect]"
playwright install msedge
copilot-chat-transcribe --help

Run against a sample file:

copilot-chat-transcribe path/to/export.json -o test-out --open

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copilot_chat_transcribe-1.0.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

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

copilot_chat_transcribe-1.0.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file copilot_chat_transcribe-1.0.0.tar.gz.

File metadata

  • Download URL: copilot_chat_transcribe-1.0.0.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for copilot_chat_transcribe-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6bc6cebe7a2407615e91ced51426c201a4d8f776623d4110633ca1fb8095ce74
MD5 98021d0fe36bedd4a754bcd88a97be65
BLAKE2b-256 de9793638f30f1298e1ab38a298121e13d56fd86f0bd8d13cccd0ea2b2c39de4

See more details on using hashes here.

Provenance

The following attestation bundles were made for copilot_chat_transcribe-1.0.0.tar.gz:

Publisher: publish.yml on divyavanmahajan/copilot-chat-transcribe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for copilot_chat_transcribe-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bb5ef2997daafa17fb275ebf3e1001ae2a2e9111dc5d717f98d9d9548629f11
MD5 5f424d68b4a4adfad948740d08216bfa
BLAKE2b-256 37c19b1a1a40b3bba4f7fcbbb9959ebc54771f41a02edcf9e038e0579f256107

See more details on using hashes here.

Provenance

The following attestation bundles were made for copilot_chat_transcribe-1.0.0-py3-none-any.whl:

Publisher: publish.yml on divyavanmahajan/copilot-chat-transcribe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page