Skip to main content

Export Codex Desktop session files as shareable HTML pages

Project description

codex-export

English | 简体中文

Export Codex Desktop session records as browsable, shareable HTML pages. codex-export supports local exports, batch archives, and GitHub Gist uploads with ready-to-share preview links. The overall interaction model is inspired by simonw/claude-code-transcripts, but the parser is adapted to the real Codex session format.

Install

Install from PyPI:

uv tool install codex-export

Then run:

codex-export --help

If codex-export is not found, you may need to add ~/.local/bin to your PATH:

uv tool update-shell

For local development:

git clone git@github.com:allojohn/codex-export.git
cd codex-export
uv sync
uv run codex-export --help

For Agents

You can give this prompt to an agent:

Read https://github.com/allojohn/codex-export/blob/main/README.md and use it to operate codex-export for me. First ask which Codex session I want to export. Then ask whether I want local HTML files, a shareable GitHub Gist preview link, a full archive, or the original session JSONL copied into the output directory. Next, run the correct command and tell me the output path or share link.

Share First

codex-export is especially useful for two things:

  1. Exporting a Codex conversation into browsable HTML
  2. Uploading it to GitHub Gist and getting a shareable preview link

Most common sharing command:

codex-export json ~/.codex/sessions/2026/03/31/rollout-xxxx.jsonl --gist

Or pick a recent local session and upload it directly:

codex-export --gist

On success, the command prints:

  • The Gist URL
  • A gisthost.github.io preview URL

That means other people can open the exported page directly without running the tool locally.

Common Commands

Pick from recent local sessions:

codex-export
codex-export local

Export a specific session file:

codex-export json ~/.codex/sessions/2026/03/31/rollout-xxxx.jsonl -o ./output
codex-export json ~/.codex/sessions/2026/03/31/rollout-xxxx.jsonl --open

Export from a remote JSON/JSONL URL:

codex-export json https://example.com/session.jsonl -o ./output

Upload to GitHub Gist and get a preview link:

codex-export json ~/.codex/sessions/2026/03/31/rollout-xxxx.jsonl --gist
codex-export --gist

Generate a full archive:

codex-export all -o ./codex-archive
codex-export all --dry-run

If you do not pass -o/--output, both local and json write to a temporary directory by default. If you do not pass -o, do not enable --gist, and do not enable -a/--output-auto, the result page opens automatically.

Commands

  • local or the default command: read recent local sessions from ~/.codex/sessions
  • json: export a specific .json / .jsonl file, or a remote URL
  • all: export all local sessions into a browsable archive

Codex does not currently have an equivalent of the Claude project's web session import API, so this project does not implement a web command.

Output Options

local and json support:

  • -o, --output DIRECTORY: output directory; defaults to a temporary directory
  • -a, --output-auto: automatically create a subdirectory based on the session filename
  • --source PATH: local only, override the local session directory
  • --limit INTEGER: local only, control how many recent sessions appear in the picker
  • --open: open index.html after export
  • --gist: upload HTML to GitHub Gist and print a gisthost.github.io preview link
  • --json: copy the original session file into the output directory

Generated output is structured like this:

  • index.html: index page with one summary entry per turn
  • page-001.html, page-002.html, ...: paginated full content including assistant messages, tool calls, tool results, commentary, and more

Batch Archive

The all command generates a three-level archive:

  • A top-level index of all workspaces
  • One index page per workspace
  • One export page per session

Agent and subagent sessions are excluded by default. Add --include-agents to include them.

all supports:

  • --source DIRECTORY: source directory, default ~/.codex/sessions
  • -o, --output DIRECTORY: output directory, default ./codex-archive
  • --include-agents: include agent and subagent sessions
  • --dry-run: show what would be exported without writing files
  • --open: open the archive index after generation
  • -q, --quiet: only print errors

Current Features

  • local: interactive picker for recent local sessions
  • json: export local or remote .json / .jsonl
  • all: generate a workspace-grouped archive
  • -a / --output-auto
  • --json
  • --open
  • --gist: upload generated HTML to GitHub Gist and print a shareable preview link
  • Multi-page exports: paginated by Codex turn
  • Gist preview fixups: automatically inject relative-link fixes for gisthost.github.io

Limitations

  • local and all currently scan Codex local .jsonl session directories only; they do not read the SQLite history store
  • reasoning.encrypted_content is not decrypted; only visible summaries are shown
  • Some event_msg items mirror response_item entries; the rendered page de-duplicates these and prefers the final readable form
  • --gist requires gh to be installed and authenticated with gh auth login
  • No web command is implemented because Codex does not currently expose a corresponding web-session import interface

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

codex_export-0.1.4.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

codex_export-0.1.4-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file codex_export-0.1.4.tar.gz.

File metadata

  • Download URL: codex_export-0.1.4.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codex_export-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8278b5831bf08b041a714ab1889e26c8e97b75703de5bcf03a3b47992cb90743
MD5 823df66e64c7ab56e6c3c37a7d1e9799
BLAKE2b-256 ff45301970ffa601328062047ef587757117fb13aa8cb7b2233b042055913088

See more details on using hashes here.

File details

Details for the file codex_export-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: codex_export-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codex_export-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1132aa4fc73e6126365bba10508d2ec36cfb2c05b32543aa0c13d41e64bca279
MD5 0ba9db4953e64352af71cc1d3c68bdd6
BLAKE2b-256 0a4bf5053fbdb329e407b9da8e109f8707a6d27978b22938728535e9f5a75c42

See more details on using hashes here.

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