{"id":51026875,"url":"https://github.com/gitstq/codesprint","last_synced_at":"2026-06-21T20:02:28.369Z","repository":{"id":356781496,"uuid":"1234044363","full_name":"gitstq/codesprint","owner":"gitstq","description":"🚀 CodeSprint - Lightweight Multi-Language Code Snippet Intelligent Runner CLI | 轻量级多语言代码片段智能运行器 - Zero dependencies, auto language detection, sandbox execution, beautiful TUI output","archived":false,"fork":false,"pushed_at":"2026-05-09T17:18:13.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T19:24:46.763Z","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-09T17:17:25.000Z","updated_at":"2026-05-09T17:18:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gitstq/codesprint","commit_stats":null,"previous_names":["gitstq/codesprint"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/gitstq/codesprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Fcodesprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Fcodesprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Fcodesprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Fcodesprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitstq","download_url":"https://codeload.github.com/gitstq/codesprint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Fcodesprint/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:27.565Z","updated_at":"2026-06-21T20:02:28.364Z","avatar_url":"https://github.com/gitstq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Multi-language README for CodeSprint --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#english\"\u003eEnglish\u003c/a\u003e •\n  \u003ca href=\"#简体中文\"\u003e简体中文\u003c/a\u003e •\n  \u003ca href=\"#繁體中文\"\u003e繁體中文\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\u003ca name=\"english\"\u003e\u003c/a\u003e\n# 🚀 CodeSprint\n\n\u003cdiv align=\"center\"\u003e\n\n**Lightweight Multi-Language Code Snippet Intelligent Runner CLI**\n\n*Zero Dependencies • Auto Language Detection • Sandbox Execution • Beautiful TUI Output*\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\u003c/div\u003e\n\n---\n\n## 🎉 Introduction\n\n**CodeSprint** is a lightweight, zero-dependency CLI tool that lets you **run code snippets in 18+ programming languages** directly from your terminal. No more switching between different IDEs or installing heavy-weight tools - just write and run!\n\n### Why CodeSprint?\n\n- ❌ **Tired of** switching between different IDEs for different languages?\n- ❌ **Frustrated with** heavy-weight tools just to test a simple snippet?\n- ❌ **Annoyed by** complex setup processes for code playgrounds?\n\n**CodeSprint solves all these problems!** ✅\n\n### 🌟 Key Features\n\n| Feature | Description |\n|---------|-------------|\n| 🔍 **Auto Language Detection** | Automatically detects language from file extension, shebang, or code patterns |\n| 🚀 **18+ Languages** | Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, Ruby, PHP, Bash, Perl, Lua, R, Kotlin, Swift, Scala, and more |\n| 🔒 **Sandbox Execution** | Safe, isolated execution with timeout protection |\n| 📊 **Beautiful TUI Output** | Colorful, syntax-highlighted output with execution statistics |\n| 📚 **History Management** | Track all executions, mark favorites, search and export |\n| 💻 **Interactive REPL Mode** | Quick code testing in an interactive environment |\n| 🔄 **Batch Execution** | Run multiple files or code snippets at once |\n| ⚡ **Zero Dependencies** | Pure Python, no external dependencies required |\n\n---\n\n## 🚀 Quick Start\n\n### Requirements\n\n- Python 3.8 or higher\n- Language runtimes for the languages you want to execute (e.g., `node` for JavaScript, `go` for Go)\n\n### Installation\n\n```bash\n# Install from PyPI\npip install codesprint\n\n# Or install from source\ngit clone https://github.com/gitstq/codesprint.git\ncd codesprint\npip install -e .\n```\n\n### Basic Usage\n\n```bash\n# Run a file\ncodesprint script.py\n\n# Run inline code\ncodesprint -c \"print('Hello, World!')\"\n\n# Specify language explicitly\ncodesprint -l javascript -c \"console.log('Hello!')\"\n\n# Interactive mode\ncodesprint -i\n\n# List available runtimes\ncodesprint -L\n```\n\n---\n\n## 📖 Detailed Usage Guide\n\n### Running Files\n\n```bash\n# Run Python file\ncodesprint main.py\n\n# Run JavaScript file\ncodesprint app.js\n\n# Run Go file\ncodesprint main.go\n\n# Run with custom timeout (seconds)\ncodesprint --timeout 60 slow_script.py\n```\n\n### Inline Code Execution\n\n```bash\n# Python\ncodesprint -c \"import sys; print(sys.version)\"\n\n# JavaScript\ncodesprint -l js -c \"console.log(process.version)\"\n\n# Ruby\ncodesprint -l ruby -c \"puts RUBY_VERSION\"\n```\n\n### Interactive REPL Mode\n\n```bash\ncodesprint -i\n```\n\n```\n🚀 CodeSprint Interactive Mode\n════════════════════════════════════════════════════════════════\nType code and press Enter to execute. Type 'exit' or 'quit' to exit.\n\n\u003e\u003e\u003e print('Hello, World!')\n\n✅ SUCCESS  PYTHON  ⏱ 0.012s\n──────────────────────────────────────────────────\n\n📤 Output:\n  Hello, World!\n```\n\n### History Management\n\n```bash\n# Show history\ncodesprint -H\n\n# Show statistics\ncodesprint -s\n\n# Clear history\ncodesprint --clear-history\n```\n\n### JSON Output (for scripting)\n\n```bash\ncodesprint --json -c \"print('hello')\"\n```\n\n```json\n{\n  \"success\": true,\n  \"output\": \"hello\\n\",\n  \"error\": \"\",\n  \"exit_code\": 0,\n  \"execution_time\": 0.015,\n  \"language\": \"python\"\n}\n```\n\n---\n\n## 💡 Design Philosophy \u0026 Roadmap\n\n### Design Philosophy\n\nCodeSprint was built with these principles in mind:\n\n1. **Zero Dependencies** - No external dependencies means faster installation and fewer conflicts\n2. **Security First** - Sandbox execution with timeout protection prevents runaway code\n3. **Developer Experience** - Beautiful output, helpful error messages, intuitive CLI\n4. **Extensibility** - Easy to add new languages and features\n\n### Roadmap\n\n- [ ] Add more language support (Dart, Elixir, Haskell, etc.)\n- [ ] Web-based playground mode\n- [ ] VS Code extension integration\n- [ ] Docker container execution\n- [ ] AI-powered code suggestions\n\n---\n\n## 📦 Build \u0026 Deployment\n\n### Building from Source\n\n```bash\n# Clone repository\ngit clone https://github.com/gitstq/codesprint.git\ncd codesprint\n\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Build package\npython -m build\n```\n\n### Supported Environments\n\n- **Operating Systems**: Linux, macOS, Windows\n- **Python Versions**: 3.8, 3.9, 3.10, 3.11, 3.12\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how to get started:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nPlease read our [Contributing Guide](CONTRIBUTING.md) for details.\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by SOLO Agent\n\u003c/p\u003e\n\n---\n\n\u003ca name=\"简体中文\"\u003e\u003c/a\u003e\n# 🚀 CodeSprint\n\n\u003cdiv align=\"center\"\u003e\n\n**轻量级多语言代码片段智能运行器 CLI**\n\n*零依赖 • 自动语言检测 • 沙箱执行 • 精美TUI输出*\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n\n\u003c/div\u003e\n\n---\n\n## 🎉 项目介绍\n\n**CodeSprint** 是一款轻量级、零依赖的命令行工具，让您可以直接在终端中**运行 18+ 种编程语言的代码片段**。无需在不同 IDE 之间切换，无需安装重型工具——只需编写并运行！\n\n### 为什么选择 CodeSprint？\n\n- ❌ **厌倦了** 为不同语言切换不同的 IDE？\n- ❌ **苦恼于** 仅仅测试简单代码片段就要安装重型工具？\n- ❌ **厌烦了** 复杂的代码游乐场设置流程？\n\n**CodeSprint 解决所有这些问题！** ✅\n\n### 🌟 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 🔍 **自动语言检测** | 自动从文件扩展名、shebang 或代码模式检测语言 |\n| 🚀 **18+ 种语言** | Python、JavaScript、TypeScript、Go、Rust、Java、C、C++、Ruby、PHP、Bash、Perl、Lua、R、Kotlin、Swift、Scala 等 |\n| 🔒 **沙箱执行** | 安全隔离执行，带超时保护 |\n| 📊 **精美 TUI 输出** | 彩色语法高亮输出，含执行统计 |\n| 📚 **历史管理** | 追踪所有执行记录，标记收藏，搜索和导出 |\n| 💻 **交互式 REPL 模式** | 在交互环境中快速测试代码 |\n| 🔄 **批量执行** | 一次运行多个文件或代码片段 |\n| ⚡ **零依赖** | 纯 Python 实现，无需外部依赖 |\n\n---\n\n## 🚀 快速开始\n\n### 环境要求\n\n- Python 3.8 或更高版本\n- 您想执行的语言运行时（如 JavaScript 需要 `node`，Go 需要 `go`）\n\n### 安装\n\n```bash\n# 从 PyPI 安装\npip install codesprint\n\n# 或从源码安装\ngit clone https://github.com/gitstq/codesprint.git\ncd codesprint\npip install -e .\n```\n\n### 基本用法\n\n```bash\n# 运行文件\ncodesprint script.py\n\n# 运行内联代码\ncodesprint -c \"print('Hello, World!')\"\n\n# 显式指定语言\ncodesprint -l javascript -c \"console.log('Hello!')\"\n\n# 交互模式\ncodesprint -i\n\n# 列出可用运行时\ncodesprint -L\n```\n\n---\n\n## 📖 详细使用指南\n\n### 运行文件\n\n```bash\n# 运行 Python 文件\ncodesprint main.py\n\n# 运行 JavaScript 文件\ncodesprint app.js\n\n# 运行 Go 文件\ncodesprint main.go\n\n# 设置自定义超时（秒）\ncodesprint --timeout 60 slow_script.py\n```\n\n### 内联代码执行\n\n```bash\n# Python\ncodesprint -c \"import sys; print(sys.version)\"\n\n# JavaScript\ncodesprint -l js -c \"console.log(process.version)\"\n\n# Ruby\ncodesprint -l ruby -c \"puts RUBY_VERSION\"\n```\n\n### 交互式 REPL 模式\n\n```bash\ncodesprint -i\n```\n\n```\n🚀 CodeSprint 交互模式\n════════════════════════════════════════════════════════════════\n输入代码并按回车执行。输入 'exit' 或 'quit' 退出。\n\n\u003e\u003e\u003e print('你好，世界！')\n\n✅ 成功  PYTHON  ⏱ 0.012秒\n──────────────────────────────────────────────────\n\n📤 输出：\n  你好，世界！\n```\n\n### 历史管理\n\n```bash\n# 显示历史\ncodesprint -H\n\n# 显示统计\ncodesprint -s\n\n# 清除历史\ncodesprint --clear-history\n```\n\n### JSON 输出（用于脚本）\n\n```bash\ncodesprint --json -c \"print('hello')\"\n```\n\n```json\n{\n  \"success\": true,\n  \"output\": \"hello\\n\",\n  \"error\": \"\",\n  \"exit_code\": 0,\n  \"execution_time\": 0.015,\n  \"language\": \"python\"\n}\n```\n\n---\n\n## 💡 设计思路与迭代规划\n\n### 设计理念\n\nCodeSprint 基于以下原则构建：\n\n1. **零依赖** - 无外部依赖意味着更快的安装和更少的冲突\n2. **安全优先** - 沙箱执行带超时保护，防止代码失控\n3. **开发者体验** - 精美输出、有用的错误信息、直观的 CLI\n4. **可扩展性** - 易于添加新语言和功能\n\n### 迭代规划\n\n- [ ] 添加更多语言支持（Dart、Elixir、Haskell 等）\n- [ ] Web 版游乐场模式\n- [ ] VS Code 扩展集成\n- [ ] Docker 容器执行\n- [ ] AI 驱动的代码建议\n\n---\n\n## 📦 打包与部署\n\n### 从源码构建\n\n```bash\n# 克隆仓库\ngit clone https://github.com/gitstq/codesprint.git\ncd codesprint\n\n# 安装开发依赖\npip install -e \".[dev]\"\n\n# 运行测试\npytest\n\n# 构建包\npython -m build\n```\n\n### 支持环境\n\n- **操作系统**：Linux、macOS、Windows\n- **Python 版本**：3.8、3.9、3.10、3.11、3.12\n\n---\n\n## 🤝 贡献指南\n\n欢迎贡献！以下是开始方式：\n\n1. Fork 本仓库\n2. 创建功能分支 (`git checkout -b feature/amazing-feature`)\n3. 提交更改 (`git commit -m 'feat: add amazing feature'`)\n4. 推送到分支 (`git push origin feature/amazing-feature`)\n5. 提交 Pull Request\n\n请阅读我们的[贡献指南](CONTRIBUTING.md)了解详情。\n\n---\n\n## 📄 开源协议\n\n本项目采用 MIT 协议开源 - 详情请查看 [LICENSE](LICENSE) 文件。\n\n---\n\n\u003cp align=\"center\"\u003e\n  由 SOLO Agent 用 ❤️ 制作\n\u003c/p\u003e\n\n---\n\n\u003ca name=\"繁體中文\"\u003e\u003c/a\u003e\n# 🚀 CodeSprint\n\n\u003cdiv align=\"center\"\u003e\n\n**輕量級多語言程式碼片段智慧執行器 CLI**\n\n*零依賴 • 自動語言偵測 • 沙箱執行 • 精美TUI輸出*\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n\n\u003c/div\u003e\n\n---\n\n## 🎉 專案介紹\n\n**CodeSprint** 是一款輕量級、零依賴的命令列工具，讓您可以直接在終端機中**執行 18+ 種程式語言的程式碼片段**。無需在不同 IDE 之間切換，無需安裝重型工具——只需編寫並執行！\n\n### 為什麼選擇 CodeSprint？\n\n- ❌ **厭倦了** 為不同語言切換不同的 IDE？\n- ❌ **苦惱於** 僅僅測試簡單程式碼片段就要安裝重型工具？\n- ❌ **厭煩了** 複雜的程式碼遊樂場設定流程？\n\n**CodeSprint 解決所有這些問題！** ✅\n\n### 🌟 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 🔍 **自動語言偵測** | 自動從副檔名、shebang 或程式碼模式偵測語言 |\n| 🚀 **18+ 種語言** | Python、JavaScript、TypeScript、Go、Rust、Java、C、C++、Ruby、PHP、Bash、Perl、Lua、R、Kotlin、Swift、Scala 等 |\n| 🔒 **沙箱執行** | 安全隔離執行，帶逾時保護 |\n| 📊 **精美 TUI 輸出** | 彩色語法高亮輸出，含執行統計 |\n| 📚 **歷史管理** | 追蹤所有執行記錄，標記收藏，搜尋和匯出 |\n| 💻 **互動式 REPL 模式** | 在互動環境中快速測試程式碼 |\n| 🔄 **批次執行** | 一次執行多個檔案或程式碼片段 |\n| ⚡ **零依賴** | 純 Python 實作，無需外部依賴 |\n\n---\n\n## 🚀 快速開始\n\n### 環境需求\n\n- Python 3.8 或更高版本\n- 您想執行的語言執行環境（如 JavaScript 需要 `node`，Go 需要 `go`）\n\n### 安裝\n\n```bash\n# 從 PyPI 安裝\npip install codesprint\n\n# 或從原始碼安裝\ngit clone https://github.com/gitstq/codesprint.git\ncd codesprint\npip install -e .\n```\n\n### 基本用法\n\n```bash\n# 執行檔案\ncodesprint script.py\n\n# 執行內聯程式碼\ncodesprint -c \"print('Hello, World!')\"\n\n# 明確指定語言\ncodesprint -l javascript -c \"console.log('Hello!')\"\n\n# 互動模式\ncodesprint -i\n\n# 列出可用執行環境\ncodesprint -L\n```\n\n---\n\n## 📖 詳細使用指南\n\n### 執行檔案\n\n```bash\n# 執行 Python 檔案\ncodesprint main.py\n\n# 執行 JavaScript 檔案\ncodesprint app.js\n\n# 執行 Go 檔案\ncodesprint main.go\n\n# 設定自訂逾時（秒）\ncodesprint --timeout 60 slow_script.py\n```\n\n### 內聯程式碼執行\n\n```bash\n# Python\ncodesprint -c \"import sys; print(sys.version)\"\n\n# JavaScript\ncodesprint -l js -c \"console.log(process.version)\"\n\n# Ruby\ncodesprint -l ruby -c \"puts RUBY_VERSION\"\n```\n\n### 互動式 REPL 模式\n\n```bash\ncodesprint -i\n```\n\n```\n🚀 CodeSprint 互動模式\n════════════════════════════════════════════════════════════════\n輸入程式碼並按 Enter 執行。輸入 'exit' 或 'quit' 離開。\n\n\u003e\u003e\u003e print('你好，世界！')\n\n✅ 成功  PYTHON  ⏱ 0.012秒\n──────────────────────────────────────────────────\n\n📤 輸出：\n  你好，世界！\n```\n\n### 歷史管理\n\n```bash\n# 顯示歷史\ncodesprint -H\n\n# 顯示統計\ncodesprint -s\n\n# 清除歷史\ncodesprint --clear-history\n```\n\n### JSON 輸出（用於腳本）\n\n```bash\ncodesprint --json -c \"print('hello')\"\n```\n\n```json\n{\n  \"success\": true,\n  \"output\": \"hello\\n\",\n  \"error\": \"\",\n  \"exit_code\": 0,\n  \"execution_time\": 0.015,\n  \"language\": \"python\"\n}\n```\n\n---\n\n## 💡 設計思路與迭代規劃\n\n### 設計理念\n\nCodeSprint 基於以下原則建構：\n\n1. **零依賴** - 無外部依賴意味著更快的安裝和更少的衝突\n2. **安全優先** - 沙箱執行帶逾時保護，防止程式碼失控\n3. **開發者體驗** - 精美輸出、有用的錯誤訊息、直觀的 CLI\n4. **可擴展性** - 易於新增新語言和功能\n\n### 迭代規劃\n\n- [ ] 新增更多語言支援（Dart、Elixir、Haskell 等）\n- [ ] Web 版遊樂場模式\n- [ ] VS Code 擴充功能整合\n- [ ] Docker 容器執行\n- [ ] AI 驅動的程式碼建議\n\n---\n\n## 📦 打包與部署\n\n### 從原始碼建構\n\n```bash\n# 複製儲存庫\ngit clone https://github.com/gitstq/codesprint.git\ncd codesprint\n\n# 安裝開發依賴\npip install -e \".[dev]\"\n\n# 執行測試\npytest\n\n# 建構套件\npython -m build\n```\n\n### 支援環境\n\n- **作業系統**：Linux、macOS、Windows\n- **Python 版本**：3.8、3.9、3.10、3.11、3.12\n\n---\n\n## 🤝 貢獻指南\n\n歡迎貢獻！以下是開始方式：\n\n1. Fork 本儲存庫\n2. 建立功能分支 (`git checkout -b feature/amazing-feature`)\n3. 提交變更 (`git commit -m 'feat: add amazing feature'`)\n4. 推送到分支 (`git push origin feature/amazing-feature`)\n5. 提出 Pull Request\n\n請閱讀我們的[貢獻指南](CONTRIBUTING.md)了解詳情。\n\n---\n\n## 📄 開源授權\n\n本專案採用 MIT 授權條款開源 - 詳情請查看 [LICENSE](LICENSE) 檔案。\n\n---\n\n\u003cp align=\"center\"\u003e\n  由 SOLO Agent 用 ❤️ 製作\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Fcodesprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitstq%2Fcodesprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Fcodesprint/lists"}