kambo/cctranscripts
Composer 安装命令:
composer require kambo/cctranscripts
包简介
Convert Claude Code session files to HTML transcripts (PHP port)
README 文档
README
Convert Claude Code session files (JSON/JSONL) to clean, mobile-friendly HTML transcripts with pagination.
This is a PHP port of claude-code-transcripts by Simon Willison.
Features
- Parse JSON and JSONL session files from Claude Code
- Generate paginated HTML transcripts (5 prompts per page)
- Render tool calls with syntax highlighting:
- Write - File creation with content preview
- Edit - Diff-style old/new display
- Bash - Command display with description
- TodoWrite - Task lists with status icons
- Generic tool calls with JSON formatting
- Auto-detect GitHub repository for commit links
- Search functionality across all pages
- Mobile-friendly responsive design
- Batch conversion of all local sessions
Installation
Option 1: Download Static Binary (Recommended)
No PHP required. Download the pre-built binary for your platform:
# Linux x86_64 curl -fsSL https://github.com/kambo-1st/php-cc-transcripts/releases/latest/download/claude-code-transcripts-linux-x86_64 -o claude-code-transcripts chmod +x claude-code-transcripts sudo mv claude-code-transcripts /usr/local/bin/ # macOS Apple Silicon curl -fsSL https://github.com/kambo-1st/php-cc-transcripts/releases/latest/download/claude-code-transcripts-macos-aarch64 -o claude-code-transcripts chmod +x claude-code-transcripts sudo mv claude-code-transcripts /usr/local/bin/
Option 2: Install with Composer (Global)
Requires PHP 8.1+.
composer global require kambo/cctranscripts
Make sure Composer's global bin directory is in your PATH:
# Add to your ~/.bashrc or ~/.zshrc export PATH="$HOME/.composer/vendor/bin:$PATH" # or for newer Composer versions: export PATH="$HOME/.config/composer/vendor/bin:$PATH"
Then run:
claude-code-transcripts --help
Option 3: Install with Composer (Project)
Add to your project:
composer require kambo/cctranscripts
Run via vendor bin:
./vendor/bin/claude-code-transcripts --help
Option 4: Install from Source
git clone https://github.com/kambo-1st/php-cc-transcripts.git
cd php-cc-transcripts
composer install
./bin/claude-code-transcripts --help
Usage
Convert a single session file
claude-code-transcripts json /path/to/session.jsonl -o ./output
Options:
-o, --output <dir>- Output directory (default: temp dir)--repo <owner/name>- GitHub repo for commit links (auto-detected if not specified)
Browse and convert local sessions
claude-code-transcripts local
This will scan ~/.claude/projects/ and let you select a session to convert.
Options:
-o, --output <dir>- Output directory--limit <n>- Maximum sessions to show (default: 10)
Convert all sessions to archive
claude-code-transcripts all -o ./claude-archive
Creates a browsable archive with:
- Master index listing all projects
- Per-project pages listing sessions
- Individual session transcripts
Options:
-s, --source <dir>- Source directory (default:~/.claude/projects)-o, --output <dir>- Output directory (default:./claude-archive)--include-agents- Include agent-* session files--dry-run- Show what would be converted without creating files
Output Structure
Single session:
output/
├── index.html # Overview with all prompts
├── page-001.html # First 5 prompts
├── page-002.html # Next 5 prompts
└── ...
Archive (all sessions):
claude-archive/
├── index.html # Master index
├── project-name/
│ ├── index.html # Project sessions list
│ ├── session-uuid/
│ │ ├── index.html
│ │ ├── page-001.html
│ │ └── ...
│ └── ...
└── ...
Programmatic Usage
<?php require 'vendor/autoload.php'; use ClaudeCodeTranscripts\ClaudeCodeTranscripts; $transcripts = new ClaudeCodeTranscripts(); // Convert a single session $transcripts->generateHtml('/path/to/session.jsonl', './output'); // Convert with GitHub repo for commit links $transcripts->generateHtml('/path/to/session.jsonl', './output', 'owner/repo'); // Find local sessions $sessions = $transcripts->findLocalSessions($_SERVER['HOME'] . '/.claude/projects', 10); // Generate batch archive $stats = $transcripts->generateBatchHtml( $_SERVER['HOME'] . '/.claude/projects', './archive', false, // include agents function($project, $session, $current, $total) { echo "Processing $current/$total...\n"; } );
Building from Source
To build static binaries locally:
# Build for current platform (Linux) ./build.sh linux # Build for macOS Intel ./build.sh macos # Build for macOS Apple Silicon ./build.sh macos-arm # Build all platforms ./build.sh all
Binaries will be created in the build/ directory.
License
Apache-2.0 (same as original project)
Credits
- Original Python version by Simon Willison
- PHP port created with Claude Code
kambo/cctranscripts 适用场景与选型建议
kambo/cctranscripts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「html」 「converter」 「claude」 「anthropic」 「claude-code」 「transcripts」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kambo/cctranscripts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kambo/cctranscripts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kambo/cctranscripts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Tools to convert between .NET and PHP date formats
Encode integer IDs using a preset or customized symbol set
HTML and form generation
Estimate AI API costs before making expensive calls
TCMB Currenct Converter
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2026-02-12