Share-conscious HTML exporter for AI coding-assistant conversations (Claude and Codex).
Project description
chat2html
Share-conscious HTML exporter for AI coding-assistant conversations (Claude and Codex).
Why chat2html?
- Four formats, one tool — Auto-detects Claude Code JSONL, claude.ai exports, claude-chat-exporter Markdown, and OpenAI Codex CLI JSONL.
- Safer sharing defaults — Tool results are omitted and OAuth URLs (with
state,code,token, callback paths) are redacted by default. Use--fullonly when you need the full picture for yourself. - Self-contained output — One HTML file with light/dark themes, syntax highlighting, and collapsible thinking blocks and long pastes.
- Zero install —
uvx --from git+https://github.com/chezou/chat2html chat2html session.jsonl.
Supported input formats (auto-detected)
-
claude.ai export (
conversations.json/.jsonl)- Downloadable from Settings → Privacy → Export data (inside the ZIP).
- Contains multiple conversations — pick them by listing, searching, or index.
-
Claude Code session (
~/.claude/projects/<proj>/*.jsonl)- Line-based logs with
type/uuid/sessionId. - Renders tool-use history (Bash / Read / Edit / Agent, etc.).
thinkingblocks and longtool_resultoutputs are collapsed into<details>.
- Line-based logs with
-
claude-chat-exporter.js Markdown (
.md)- See https://github.com/agarwalvishal/claude-chat-exporter.
- Uses
## Human (date):/## Claude:headers.
-
OpenAI Codex CLI session (
~/.codex/sessions/*.jsonl)- Line-based logs with top-level
{timestamp, type, payload}. - Renders user / assistant text,
function_call+function_call_outputpairs (e.g.exec_command), andcustom_tool_call(e.g.apply_patch). - Encrypted reasoning is omitted; visible
reasoning.summaryis rendered as athinkingblock.
- Line-based logs with top-level
Quickstart
Run directly from the GitHub repository with uv — no install required:
uv run --from git+https://github.com/chezou/chat2html chat2html session.jsonl
The examples below use chat2html as shorthand for the command above.
Usage
# Auto-detect format (Claude Code JSONL / Markdown)
chat2html session.jsonl
chat2html conversation.md
chat2html session.jsonl -o out.html
# claude.ai export: list conversations
chat2html conversations.json
# claude.ai export: search by title
chat2html conversations.json -s "API"
# claude.ai export: convert by index
chat2html conversations.json -i 0,3,7 -d out/
# claude.ai export: convert all
chat2html conversations.json --all -d out/
# Batch multiple files (Markdown / Claude Code JSONL)
chat2html a.md b.jsonl -d out/
Options
| Option | Description |
|---|---|
-o, --output |
Output file path (single conversation only). |
-d, --outdir |
Output directory. |
-s, --search |
Search conversations by title (claude.ai export). |
-i, --index |
Comma-separated indices to convert (claude.ai export, e.g. 0,2,5). |
--all |
Convert all conversations (claude.ai export). |
--lang {ja,en} |
Output language (default: ja). |
--full |
Show full tool input/output. By default, tool_result is omitted and tool_use only shows description-like fields for safer sharing. OAuth-related URLs are always masked, even with --full. |
⚠️ What chat2html does NOT protect against
chat2html redacts OAuth URLs and omits tool results by default, but it is not a general-purpose secret scrubber. Before sharing any output, you should still review it for:
- API keys and tokens (e.g.,
sk-ant-...,ghp_...) that may appear in tool inputs or assistant text - Personal file paths (
/Users/yourname/...,C:\Users\...) - Internal hostnames, repository names, or IP addresses
- PII in pasted content (emails, phone numbers, etc.)
- Long pastes are collapsed into
<details>but still present in the HTML source — they're hidden visually, not removed.
If you need stronger guarantees, consider running a secret scanner (e.g., gitleaks, trufflehog) on the output before sharing.
Extra safety: scan the output before sharing
chat2html does not detect arbitrary secrets like API keys or tokens embedded in conversation content. If you're sharing with a wide audience, pipe the output through a dedicated secret scanner:
- gitleaks —
gitleaks dir out.html -v - trufflehog —
trufflehog filesystem out.html
Both are open-source CLIs available via Homebrew and most package managers.
Development
uv sync --all-groups # install runtime + dev dependencies
uv run pytest # run the test suite
uv run ruff check . # lint
CI runs the same ruff check + pytest on every push and PR (see .github/workflows/ci.yml).
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 chat2html-0.1.0.tar.gz.
File metadata
- Download URL: chat2html-0.1.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a8711466d1884e56ee06e7956ece58cac56948f38d063a7b21a7c38daf38db
|
|
| MD5 |
a1a42bca8d85569ed935fa110183d045
|
|
| BLAKE2b-256 |
afc992bc354c811722a42257111bb8be6b3ee16adfec322fd6601d877f399996
|
Provenance
The following attestation bundles were made for chat2html-0.1.0.tar.gz:
Publisher:
release.yml on chezou/chat2html
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chat2html-0.1.0.tar.gz -
Subject digest:
83a8711466d1884e56ee06e7956ece58cac56948f38d063a7b21a7c38daf38db - Sigstore transparency entry: 1395128773
- Sigstore integration time:
-
Permalink:
chezou/chat2html@54a47866d782c9b1da942bb5fc4f6b55660a426a -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/chezou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54a47866d782c9b1da942bb5fc4f6b55660a426a -
Trigger Event:
release
-
Statement type:
File details
Details for the file chat2html-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chat2html-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f69968ad41012c9c320ee30a41e6f4dbb4cf3eef6916635512e06d99470ae82
|
|
| MD5 |
878f5b6ecf2041f1e422d1b38eee281d
|
|
| BLAKE2b-256 |
90388c1da4187c1569fbe7b0b3dcc17ad737428dabd2c0e35d93a060a6d0c5d4
|
Provenance
The following attestation bundles were made for chat2html-0.1.0-py3-none-any.whl:
Publisher:
release.yml on chezou/chat2html
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chat2html-0.1.0-py3-none-any.whl -
Subject digest:
0f69968ad41012c9c320ee30a41e6f4dbb4cf3eef6916635512e06d99470ae82 - Sigstore transparency entry: 1395128886
- Sigstore integration time:
-
Permalink:
chezou/chat2html@54a47866d782c9b1da942bb5fc4f6b55660a426a -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/chezou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54a47866d782c9b1da942bb5fc4f6b55660a426a -
Trigger Event:
release
-
Statement type: