{"id":51026848,"url":"https://github.com/gitstq/termcast-recorder","last_synced_at":"2026-06-21T20:02:26.150Z","repository":{"id":357741365,"uuid":"1238345714","full_name":"gitstq/termcast-recorder","owner":"gitstq","description":"🎬 TermCast - Lightweight Terminal Session Recording \u0026 Smart Replay Engine | 轻量级终端会话录制与智能回放引擎","archived":false,"fork":false,"pushed_at":"2026-05-14T03:26:11.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-14T05:25:09.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitstq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-14T03:23:08.000Z","updated_at":"2026-05-14T03:26:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gitstq/termcast-recorder","commit_stats":null,"previous_names":["gitstq/termcast-recorder"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/gitstq/termcast-recorder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Ftermcast-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Ftermcast-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Ftermcast-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Ftermcast-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitstq","download_url":"https://codeload.github.com/gitstq/termcast-recorder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Ftermcast-recorder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34623906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T20:02:25.297Z","updated_at":"2026-06-21T20:02:26.143Z","avatar_url":"https://github.com/gitstq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎬 TermCast\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3.8+-blue.svg\" alt=\"Python 3.8+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"MIT License\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Zero-Dependencies-brightgreen.svg\" alt=\"Zero Dependencies\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20WSL-orange.svg\" alt=\"Platform\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e🎬 TermCast - Lightweight Terminal Session Recording \u0026 Smart Replay Engine\u003c/b\u003e\u003cbr\u003e\n  \u003cb\u003e轻量级终端会话录制与智能回放引擎\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#简体中文\"\u003e简体中文\u003c/a\u003e |\n  \u003ca href=\"#繁體中文\"\u003e繁體中文\u003c/a\u003e |\n  \u003ca href=\"#english\"\u003eEnglish\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## 简体中文\n\n### 🎉 项目介绍\n\nTermCast 是一款轻量级终端会话录制与智能回放引擎，专为开发者设计，解决教学演示、故障排查、操作审计等场景下终端操作记录与分享的痛点。\n\n**核心灵感来源**：在日常开发工作中，我们经常需要向同事展示某个命令的执行过程、记录部署步骤用于文档、或者复盘故障排查过程。传统的屏幕录制工具文件体积大、编辑困难，而简单的文本复制又丢失了操作的时序和上下文。TermCast 正是为解决这一痛点而生。\n\n**自研差异化亮点**：\n- 🎯 **零依赖设计**：仅使用 Python 标准库，无需安装任何第三方包\n- 🧠 **智能命令分类**：自动识别 10+ 类命令（Git、Docker、构建、测试等）\n- 📊 **会话统计分析**：可视化展示命令分布、执行成功率、常用命令排行\n- 🎮 **交互式回放**：支持步进、跳转、查看详情的交互式回放模式\n- 📤 **多格式导出**：支持文本、Asciinema、JSON 等多种格式导出\n- 🚀 **双模式录制**：支持系统 `script` 命令录制和纯 Python 实现的双模式\n\n### ✨ 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 🎬 **会话录制** | 完整记录终端命令输入和输出，保留时序信息 |\n| 🧠 **智能分类** | 自动识别命令类型：Git、Docker、构建、测试、部署等 |\n| 📊 **统计分析** | 命令分类占比、执行成功率、Top 命令排行 |\n| 🎮 **交互回放** | 支持自动播放和交互式步进回放 |\n| 📤 **格式导出** | 文本、Asciinema、JSON 多格式支持 |\n| 🎯 **零依赖** | 纯 Python 标准库实现，开箱即用 |\n| 🔒 **隐私安全** | 本地录制，数据不上传云端 |\n\n### 🚀 快速开始\n\n#### 环境要求\n\n- Python 3.8+\n- Linux / macOS / WSL\n- `script` 命令（可选，用于增强录制模式）\n\n#### 安装\n\n```bash\n# 方式一：直接下载使用\ngit clone https://github.com/gitstq/termcast-recorder.git\ncd termcast-recorder\npython3 termcast.py --help\n\n# 方式二：安装到系统\npip install .\n# 或\npython3 setup.py install\n```\n\n#### 快速使用\n\n```bash\n# 开始录制会话\ntermcast record\n\n# 使用自定义输出文件名\ntermcast record -o my_session.json\n\n# 播放录制的会话\ntermcast play session.json\n\n# 交互式回放\ntermcast play session.json -i\n\n# 查看会话统计\ntermcast stats session.json\n\n# 导出为文本格式\ntermcast export session.json -t text -o output.txt\n\n# 导出为 Asciinema 格式\ntermcast export session.json -t asciinema -o output.cast\n\n# 列出所有录制的会话\ntermcast list\n```\n\n### 📖 详细使用指南\n\n#### 录制会话\n\n```bash\n$ termcast record -o deploy_session.json\n🎬 TermCast Recording Started\n   Session ID: session_1754728394\n   Output: deploy_session.json\n   Working Dir: /home/user/myproject\n   Type commands below. Enter 'exit' or press Ctrl+C to stop.\n\nuser@hostname:/home/user/myproject$ git status\nOn branch main\nYour branch is up to date with 'origin/main'.\n\nuser@hostname:/home/user/myproject$ docker build -t myapp .\n[... docker build output ...]\n\nuser@hostname:/home/user/myproject$ exit\n\n✅ Recording Stopped\n   Commands recorded: 3\n   Duration: 45.2s\n   Saved to: deploy_session.json\n```\n\n#### 交互式回放\n\n```bash\n$ termcast play deploy_session.json -i\n🎬 Playing Session: session_1754728394\n   Recorded: 2025-05-14T10:30:00\n   Commands: 3\n   Speed: 1.0x\n\n────────────────────────────────────────────────────────────\n[1/3] $ git status\nCategory: 🌿 Version Control\n────────────────────────────────────────────────────────────\nOn branch main\nYour branch is up to date with 'origin/main'.\n\n[Enter: Next | b: Back | q: Quit | j: Jump | s: Stats]\n\u003e \n```\n\n#### 会话统计示例\n\n```bash\n$ termcast stats deploy_session.json\n\n📊 Session Statistics\n──────────────────────────────────────────────────\nSession ID: session_1754728394\nRecorded: 2025-05-14T10:30:00\nUser: user@hostname\nShell: /bin/bash\nWorking Directory: /home/user/myproject\nTerminal Size: 120x30\n\nTotal Commands: 3\nTotal Duration: 45.2s\n\n📈 Command Categories:\n   🌿 Version Control: ████████ 1 (33.3%)\n   🐳 Container Operations: ████████ 1 (33.3%)\n   📁 File Operations: ████████ 1 (33.3%)\n\n🔝 Top Commands:\n   git          ● 1\n   docker       ● 1\n   ls           ● 1\n\n✅ Success Rate: 100.0% (3/3)\n```\n\n### 💡 设计思路与迭代规划\n\n#### 技术选型原因\n\n- **纯 Python 标准库**：确保零依赖，任何 Python 环境都能直接运行\n- **JSON 格式存储**：人类可读，便于版本控制和后续处理\n- **正则表达式分类**：轻量级命令识别，无需机器学习依赖\n- **模块化架构**：Recorder、Player、Classifier 独立，便于扩展\n\n#### 后续功能迭代计划\n\n- [ ] 🎨 **GIF/视频导出**：支持导出为可分享的 GIF 或 MP4\n- [ ] 🔍 **全文搜索**：支持在会话历史中搜索命令和输出\n- [ ] 🏷️ **标签系统**：为会话添加自定义标签和备注\n- [ ] 🔐 **敏感信息过滤**：自动检测并脱敏密码、密钥等信息\n- [ ] 📤 **云端同步**：可选的加密云端备份功能\n- [ ] 🎙️ **语音注释**：录制时添加语音说明\n\n### 📦 打包与部署指南\n\n#### 打包为可执行文件\n\n```bash\n# 安装 PyInstaller\npip install pyinstaller\n\n# 打包为单文件可执行程序\npyinstaller --onefile --name termcast termcast.py\n\n# 打包后的可执行文件位于 dist/termcast\n```\n\n#### Docker 部署\n\n```dockerfile\nFROM python:3.11-slim\n\nWORKDIR /app\nCOPY termcast.py .\n\nENTRYPOINT [\"python3\", \"termcast.py\"]\n```\n\n```bash\ndocker build -t termcast .\ndocker run -it -v $(pwd):/recordings termcast record -o /recordings/session.json\n```\n\n### 🤝 贡献指南\n\n欢迎提交 Issue 和 Pull Request！\n\n**提交规范**：\n- `feat:` 新增功能\n- `fix:` 修复问题\n- `docs:` 文档更新\n- `refactor:` 代码重构\n- `test:` 测试相关\n\n### 📄 开源协议\n\n本项目采用 [MIT License](LICENSE) 开源协议。\n\n---\n\n## 繁體中文\n\n### 🎉 專案介紹\n\nTermCast 是一款輕量級終端機工作階段錄製與智慧回放引擎，專為開發者設計，解決教學演示、故障排查、操作稽核等場景下終端機操作記錄與分享的痛點。\n\n**核心差異化亮點**：\n- 🎯 **零依賴設計**：僅使用 Python 標準函式庫，無需安裝任何第三方套件\n- 🧠 **智慧命令分類**：自動識別 10+ 類命令（Git、Docker、建置、測試等）\n- 📊 **工作階段統計分析**：視覺化展示命令分佈、執行成功率、常用命令排行\n- 🎮 **互動式回放**：支援步進、跳轉、查看詳情的互動式回放模式\n- 📤 **多格式匯出**：支援文字、Asciinema、JSON 等多種格式匯出\n\n### ✨ 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 🎬 **工作階段錄製** | 完整記錄終端機命令輸入和輸出，保留時序資訊 |\n| 🧠 **智慧分類** | 自動識別命令類型：Git、Docker、建置、測試、部署等 |\n| 📊 **統計分析** | 命令分類佔比、執行成功率、Top 命令排行 |\n| 🎮 **互動回放** | 支援自動播放和互動式步進回放 |\n| 📤 **格式匯出** | 文字、Asciinema、JSON 多格式支援 |\n| 🎯 **零依賴** | 純 Python 標準函式庫實作，開箱即用 |\n\n### 🚀 快速開始\n\n#### 安裝\n\n```bash\ngit clone https://github.com/gitstq/termcast-recorder.git\ncd termcast-recorder\npython3 termcast.py --help\n```\n\n#### 快速使用\n\n```bash\n# 開始錄製工作階段\ntermcast record\n\n# 播放錄製的工作階段\ntermcast play session.json\n\n# 互動式回放\ntermcast play session.json -i\n\n# 查看工作階段統計\ntermcast stats session.json\n\n# 匯出為文字格式\ntermcast export session.json -t text -o output.txt\n```\n\n### 📄 開源協議\n\n本專案採用 [MIT License](LICENSE) 開源協議。\n\n---\n\n## English\n\n### 🎉 Project Introduction\n\nTermCast is a lightweight terminal session recording and intelligent replay engine designed for developers. It solves the pain points of recording and sharing terminal operations in scenarios such as teaching demonstrations, troubleshooting, and operation auditing.\n\n**Core Inspiration**: In daily development work, we often need to show colleagues the execution process of a command, record deployment steps for documentation, or review troubleshooting processes. Traditional screen recording tools produce large files that are difficult to edit, while simple text copying loses the timing and context of operations. TermCast was born to solve this pain point.\n\n**Key Differentiators**:\n- 🎯 **Zero Dependencies**: Uses only Python standard library, no third-party packages required\n- 🧠 **Intelligent Command Classification**: Automatically identifies 10+ command categories (Git, Docker, Build, Test, etc.)\n- 📊 **Session Statistics**: Visualize command distribution, success rates, and top commands\n- 🎮 **Interactive Replay**: Step-by-step playback with jump and detail view capabilities\n- 📤 **Multi-format Export**: Supports Text, Asciinema, and JSON export formats\n- 🚀 **Dual Recording Modes**: Supports both system `script` command and pure Python implementation\n\n### ✨ Core Features\n\n| Feature | Description |\n|---------|-------------|\n| 🎬 **Session Recording** | Complete recording of terminal commands and outputs with timing information |\n| 🧠 **Smart Classification** | Auto-detect command types: Git, Docker, Build, Test, Deploy, etc. |\n| 📊 **Statistics** | Command category breakdown, success rate, top commands ranking |\n| 🎮 **Interactive Playback** | Auto-play and interactive step-by-step replay modes |\n| 📤 **Format Export** | Text, Asciinema, and JSON format support |\n| 🎯 **Zero Dependencies** | Pure Python standard library implementation, works out of the box |\n| 🔒 **Privacy First** | Local recording, data never uploaded to cloud |\n\n### 🚀 Quick Start\n\n#### Requirements\n\n- Python 3.8+\n- Linux / macOS / WSL\n- `script` command (optional, for enhanced recording mode)\n\n#### Installation\n\n```bash\n# Method 1: Direct download\ngit clone https://github.com/gitstq/termcast-recorder.git\ncd termcast-recorder\npython3 termcast.py --help\n\n# Method 2: Install to system\npip install .\n# or\npython3 setup.py install\n```\n\n#### Quick Usage\n\n```bash\n# Start recording session\ntermcast record\n\n# Use custom output filename\ntermcast record -o my_session.json\n\n# Play recorded session\ntermcast play session.json\n\n# Interactive playback\ntermcast play session.json -i\n\n# View session statistics\ntermcast stats session.json\n\n# Export to text format\ntermcast export session.json -t text -o output.txt\n\n# Export to Asciinema format\ntermcast export session.json -t asciinema -o output.cast\n\n# List all recorded sessions\ntermcast list\n```\n\n### 📖 Detailed Usage Guide\n\n#### Recording a Session\n\n```bash\n$ termcast record -o deploy_session.json\n🎬 TermCast Recording Started\n   Session ID: session_1754728394\n   Output: deploy_session.json\n   Working Dir: /home/user/myproject\n   Type commands below. Enter 'exit' or press Ctrl+C to stop.\n\nuser@hostname:/home/user/myproject$ git status\nOn branch main\nYour branch is up to date with 'origin/main'.\n\nuser@hostname:/home/user/myproject$ docker build -t myapp .\n[... docker build output ...]\n\nuser@hostname:/home/user/myproject$ exit\n\n✅ Recording Stopped\n   Commands recorded: 3\n   Duration: 45.2s\n   Saved to: deploy_session.json\n```\n\n#### Interactive Playback\n\n```bash\n$ termcast play deploy_session.json -i\n🎬 Playing Session: session_1754728394\n   Recorded: 2025-05-14T10:30:00\n   Commands: 3\n   Speed: 1.0x\n\n────────────────────────────────────────────────────────────\n[1/3] $ git status\nCategory: 🌿 Version Control\n────────────────────────────────────────────────────────────\nOn branch main\nYour branch is up to date with 'origin/main'.\n\n[Enter: Next | b: Back | q: Quit | j: Jump | s: Stats]\n\u003e \n```\n\n#### Session Statistics Example\n\n```bash\n$ termcast stats deploy_session.json\n\n📊 Session Statistics\n──────────────────────────────────────────────────\nSession ID: session_1754728394\nRecorded: 2025-05-14T10:30:00\nUser: user@hostname\nShell: /bin/bash\nWorking Directory: /home/user/myproject\nTerminal Size: 120x30\n\nTotal Commands: 3\nTotal Duration: 45.2s\n\n📈 Command Categories:\n   🌿 Version Control: ████████ 1 (33.3%)\n   🐳 Container Operations: ████████ 1 (33.3%)\n   📁 File Operations: ████████ 1 (33.3%)\n\n🔝 Top Commands:\n   git          ● 1\n   docker       ● 1\n   ls           ● 1\n\n✅ Success Rate: 100.0% (3/3)\n```\n\n### 💡 Design Philosophy \u0026 Roadmap\n\n#### Technical Choices\n\n- **Pure Python Standard Library**: Ensures zero dependencies, runs in any Python environment\n- **JSON Format Storage**: Human-readable, version-control friendly\n- **Regex-based Classification**: Lightweight command recognition without ML dependencies\n- **Modular Architecture**: Recorder, Player, and Classifier are independent for easy extension\n\n#### Roadmap\n\n- [ ] 🎨 **GIF/Video Export**: Export to shareable GIF or MP4 formats\n- [ ] 🔍 **Full-text Search**: Search command history for commands and outputs\n- [ ] 🏷️ **Tagging System**: Add custom tags and notes to sessions\n- [ ] 🔐 **Sensitive Data Filtering**: Auto-detect and mask passwords, keys, etc.\n- [ ] 📤 **Cloud Sync**: Optional encrypted cloud backup\n- [ ] 🎙️ **Voice Annotations**: Add voice explanations during recording\n\n### 📦 Packaging \u0026 Deployment\n\n#### Build as Executable\n\n```bash\n# Install PyInstaller\npip install pyinstaller\n\n# Build single-file executable\npyinstaller --onefile --name termcast termcast.py\n\n# Executable will be at dist/termcast\n```\n\n#### Docker Deployment\n\n```dockerfile\nFROM python:3.11-slim\n\nWORKDIR /app\nCOPY termcast.py .\n\nENTRYPOINT [\"python3\", \"termcast.py\"]\n```\n\n```bash\ndocker build -t termcast .\ndocker run -it -v $(pwd):/recordings termcast record -o /recordings/session.json\n```\n\n### 🤝 Contributing\n\nIssues and Pull Requests are welcome!\n\n**Commit Convention**:\n- `feat:` New feature\n- `fix:` Bug fix\n- `docs:` Documentation update\n- `refactor:` Code refactoring\n- `test:` Test related\n\n### 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by TermCast Team\u003cbr\u003e\n  \u003ca href=\"https://github.com/gitstq/termcast-recorder\"\u003eGitHub Repository\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Ftermcast-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitstq%2Ftermcast-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Ftermcast-recorder/lists"}