Skip to main content

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 --full only 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 installuvx --from git+https://github.com/chezou/chat2html chat2html session.jsonl.

Supported input formats (auto-detected)

  1. 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.
  2. Claude Code session (~/.claude/projects/<proj>/*.jsonl)

    • Line-based logs with type / uuid / sessionId.
    • Renders tool-use history (Bash / Read / Edit / Agent, etc.).
    • thinking blocks and long tool_result outputs are collapsed into <details>.
  3. claude-chat-exporter.js Markdown (.md)

  4. OpenAI Codex CLI session (~/.codex/sessions/*.jsonl)

    • Line-based logs with top-level {timestamp, type, payload}.
    • Renders user / assistant text, function_call + function_call_output pairs (e.g. exec_command), and custom_tool_call (e.g. apply_patch).
    • Encrypted reasoning is omitted; visible reasoning.summary is rendered as a thinking block.

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:

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


Download files

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

Source Distribution

chat2html-0.1.1rc1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

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

chat2html-0.1.1rc1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file chat2html-0.1.1rc1.tar.gz.

File metadata

  • Download URL: chat2html-0.1.1rc1.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chat2html-0.1.1rc1.tar.gz
Algorithm Hash digest
SHA256 8f081b7a9b18b808b09b0b086c8268934ec7c3850b1d86c0f81ab404f1211429
MD5 1070192fb8b820fae8740847bfc9bc39
BLAKE2b-256 e432c75aad92497bdb982dd07c126c3c9f8871c67489a4944aa349693e97b763

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat2html-0.1.1rc1.tar.gz:

Publisher: release.yml on chezou/chat2html

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

File details

Details for the file chat2html-0.1.1rc1-py3-none-any.whl.

File metadata

  • Download URL: chat2html-0.1.1rc1-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chat2html-0.1.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb7a4b8b05dabbc22abd4d7a3ff3512436a6a068cca7aeda36c900171bbddcb9
MD5 8bc1ed4817805c6a08e758dbc52f0309
BLAKE2b-256 05a359f3a2df9829347fd12be8d92da9310af17c5d430865d059620d96bd34ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat2html-0.1.1rc1-py3-none-any.whl:

Publisher: release.yml on chezou/chat2html

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