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:
- The tool checks whether Edge is already listening on port 9222.
- If not, it asks:
Press Enter (orMSEdge not found on port 9222. Start it now? [Y/n]Y) to launch Edge automatically with remote debugging enabled. - Edge opens at
chat.cloud.microsoft. Sign in if needed, then press Enter in the terminal. - 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]: - Press Enter to accept the default (most recent) or type a number.
- 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/## Copilotheaders 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:
- Open
chat.cloud.microsoftin Edge or Chrome - Open DevTools → Network tab
- Start a conversation or reload the page
- Filter requests by
conversation— look for aGETrequest to
https://m365.cloud.microsoft/chat/conversation/<uuid> - Right-click the request → Copy → Copy response
- Paste into a
.jsonfile and runcopilot-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file copilot_chat_transcribe-1.0.1.tar.gz.
File metadata
- Download URL: copilot_chat_transcribe-1.0.1.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
148bf7cb5b29c32c5025fd2202a98656f523d9c3b14fb3c57e12c7a1f1d934e9
|
|
| MD5 |
783ae00a153140e264359f00f10aad06
|
|
| BLAKE2b-256 |
732ca84429c6225541a9276a11d0336bf6fe3b0ed76aacc3d469aa4c993bda18
|
Provenance
The following attestation bundles were made for copilot_chat_transcribe-1.0.1.tar.gz:
Publisher:
publish.yml on divyavanmahajan/copilot-chat-transcribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
copilot_chat_transcribe-1.0.1.tar.gz -
Subject digest:
148bf7cb5b29c32c5025fd2202a98656f523d9c3b14fb3c57e12c7a1f1d934e9 - Sigstore transparency entry: 1195134615
- Sigstore integration time:
-
Permalink:
divyavanmahajan/copilot-chat-transcribe@a0eac04119d4f80a4d3a6e3482afe19f9e145e38 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/divyavanmahajan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0eac04119d4f80a4d3a6e3482afe19f9e145e38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file copilot_chat_transcribe-1.0.1-py3-none-any.whl.
File metadata
- Download URL: copilot_chat_transcribe-1.0.1-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1609ef41e938268fe728ccbb276fb535389228603d33cd1678c3368123115dd
|
|
| MD5 |
9c8b3384c1432ddd98cd4e0021d64c3a
|
|
| BLAKE2b-256 |
56a0aea6bdd43fe5fbcdc31606b8fdf49541ab9dc8c34df06b8c38bd7c028cd7
|
Provenance
The following attestation bundles were made for copilot_chat_transcribe-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on divyavanmahajan/copilot-chat-transcribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
copilot_chat_transcribe-1.0.1-py3-none-any.whl -
Subject digest:
a1609ef41e938268fe728ccbb276fb535389228603d33cd1678c3368123115dd - Sigstore transparency entry: 1195134654
- Sigstore integration time:
-
Permalink:
divyavanmahajan/copilot-chat-transcribe@a0eac04119d4f80a4d3a6e3482afe19f9e145e38 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/divyavanmahajan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0eac04119d4f80a4d3a6e3482afe19f9e145e38 -
Trigger Event:
push
-
Statement type: