{"id":40674810,"url":"https://github.com/zzy2210/stellarspec","last_synced_at":"2026-01-21T09:38:58.104Z","repository":{"id":298495162,"uuid":"999957523","full_name":"zzy2210/stellarspec","owner":"zzy2210","description":"🌟 基于 LLM 的智能本地代码审查工具，支持多语言，自动检测 Git 变更并生成专业审查报告","archived":false,"fork":false,"pushed_at":"2025-09-09T15:14:51.000Z","size":10866,"stargazers_count":32,"open_issues_count":5,"forks_count":7,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-13T20:30:06.326Z","etag":null,"topics":["code-review","eino","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzy2210.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-06-11T03:59:47.000Z","updated_at":"2025-10-10T13:27:08.000Z","dependencies_parsed_at":"2025-09-09T08:04:53.711Z","dependency_job_id":"f8229c7d-14ab-4cbc-89cb-044146a75378","html_url":"https://github.com/zzy2210/stellarspec","commit_stats":null,"previous_names":["zzy2210/stellarspec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zzy2210/stellarspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzy2210%2Fstellarspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzy2210%2Fstellarspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzy2210%2Fstellarspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzy2210%2Fstellarspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzy2210","download_url":"https://codeload.github.com/zzy2210/stellarspec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzy2210%2Fstellarspec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["code-review","eino","go"],"created_at":"2026-01-21T09:38:58.017Z","updated_at":"2026-01-21T09:38:58.088Z","avatar_url":"https://github.com/zzy2210.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StellarSpec\n\n[简体中文](README.md) | [English](README.en.md)\n\n🌟 **星鉴** - 智能代码审查助手\n\n一款基于 LLM 大模型的智能本地代码审查工具，采用 Go 语言开发，基于 [Eino 框架](https://github.com/cloudwego/eino) 构建。StellarSpec 能够自动检测 Git 仓库中的代码变更，并利用 AI 大模型进行深度代码审查，帮助开发者发现潜在问题、优化代码质量。\n\n## ✨ 特性概览\n\n已实现（当前可用）\n- 🔍 智能代码分析：基于 LLM 的代码审查\n- 🚀 并发处理：固定 10 并发执行\n- 📊 Git 集成：自动检测工作区与暂存区变更（相对 HEAD）\n- 🎯 多语言识别：按文件扩展名识别 20+ 语言类型\n- 🌐 国际化：支持中文/英文报告与提示词\n- 🛠️ 配置管理：API Server/模型/密钥/语言持久化到本地配置\n- 📝 报告输出：按文件生成 Markdown 追加式报告 `code-review.md`\n\n规划中（待完善/接线中）\n- ⏱ 并发上限可配：`--max-pool`（目前参数保留，未生效，默认 10）\n- 🔖 指定提交审查：`--commit-id`（目前未生效）\n- 🧠 思维链输出：`--thinking-chain`（目前未生效）\n- 📝 自定义 Prompt：`--prompt-file`（目前未生效）\n- 🎯 范围过滤：直接审查指定文件/子目录（当前仅按仓库变更进行审查）\n\n## 🚀 快速开始\n\n### 安装\n\n推荐使用 `Makefile` 进行构建：\n\n```bash\n# 克隆仓库\ngit clone https://github.com/your-username/stellarspec.git\ncd stellarspec\n\n# 构建（产物位于 build/stellar）\nmake build\n```\n\n构建完成后，二进制位于 `build/stellar`。如需全局使用，可复制到 `PATH` 目录，例如：\n\n```bash\nsudo cp build/stellar /usr/local/bin/stellar\n```\n\n### 配置\n\n首次使用需要配置 API 服务器、模型和密钥。请将 `stellar` 替换为你实际的二进制文件名（如果已更改）。\n\n```bash\n# 设置 API 服务器地址\nstellar --set-apiserver https://api.siliconflow.cn/v1/\n\n# 设置 LLM 模型\nstellar --set-model deepseek-chat\n\n# 设置 API 密钥\nstellar --set-key sk-xxxxxxxxxxxxx\n\n# 设置语言（可选，默认为中文）\nstellar --set-lang zh  # 中文\nstellar --set-lang en  # 英文\n```\n\n配置文件将自动保存到 `$HOME/.stellarspec/cnf`\n\n### 基础使用\n\n```bash\n# 审查当前 Git 仓库中的变更（相对 HEAD）\n./build/stellar review\n\n# 使用已安装的二进制\nstellar review\n\n# 查看帮助（或使用 make run）\nstellar --help\n```\n\n说明\n- 目前仅对“仓库变更”进行审查；传入 `review [path]` 将作为仓库路径尝试打开 Git 仓库。\n- 直接对“单个文件/子目录”进行精确审查尚未接线，规划中。\n- 审查完成后将在工作目录生成 `code-review.md` 报告文件。\n\n## 📖 详细使用说明\n\n### 配置管理\n\n```bash\n# 使用自定义配置文件\nstellar --conf /path/to/custom/config review\n\n# 一次性设置多个配置项\nstellar --set-apiserver https://api.openai.com/v1 \\\n           --set-model gpt-4 \\\n           --set-key sk-xxxxxx \\\n           --set-lang en\n\n# 切换语言设置\nstellar --set-lang zh  # 切换为中文\nstellar --set-lang en  # 切换为英文\n```\n\n### 审查选项（占位，规划中）\n\n以下选项已在 CLI 中预留，但暂未在引擎内生效，接线后方可使用：\n\n```bash\n# 指定并发数量（默认 10）\nstellar review . --max-pool 20\n\n# 审查特定 commit 的变更\nstellar review --commit-id 1bacd3f\n\n# 启用思维链模式，查看详细分析过程\nstellar review --thinking-chain\n\n# 使用自定义 prompt 模板\nstellar review --prompt-file custom_prompt.txt\n```\n\n### 支持的文件类型\n\nStellarSpec 支持以下编程语言的代码审查：\n\n| 语言 | 扩展名 | 语言 | 扩展名 |\n|------|--------|------|--------|\n| Go | `.go` | Python | `.py` |\n| JavaScript | `.js`, `.jsx` | Java | `.java` |\n| TypeScript | `.ts`, `.tsx` | C/C++ | `.c`, `.cpp`, `.cc` |\n| Rust | `.rs` | PHP | `.php` |\n| Ruby | `.rb` | Swift | `.swift` |\n| Kotlin | `.kt` | Scala | `.scala` |\n| Shell | `.sh` | SQL | `.sql` |\n| HTML | `.html`, `.htm` | CSS | `.css` |\n| YAML | `.yaml`, `.yml` | JSON | `.json` |\n| XML | `.xml` | Markdown | `.md` |\n\n## 🔧 高级功能\n\n### 并发处理\n\n当前并发度固定为 10。`--max-pool` 选项已预留，接线后支持自定义并发上限。\n\n### 思维链分析\n\n`--thinking-chain` 预留中，未来可查看模型更详细的分析过程（默认关闭）。\n\n### 自定义 Prompt\n\n`--prompt-file` 预留中，后续将支持通过文件自定义审查提示词与重点。\n\n## 📊 审查报告\n\n报告文件为 `code-review.md`，按文件输出包含：\n\n- 文件信息：路径、识别的语言类型、时间戳\n- 审查结果：模型给出的结论文本（按语言切换模板）\n\n说明：示例中的“发现的问题/改进建议/修改方案”等分节由模型生成文本中承载，模板暂未强制分节。\n\n## 🛠️ 技术架构\n\n### 核心组件\n\n- **Eino 框架**: 提供 LLM 模型集成和工作流编排\n- **Git 集成**: 基于 go-git 库实现版本控制集成\n- **并发处理**: 使用 goroutine 和信号量实现高效并发\n- **配置管理**: 基于 INI 格式的灵活配置系统\n\n### 项目结构\n\n```\nstellarspec/\n├── cmd/                    # Cobra CLI 入口\n│   └── stellarspec.go\n├── internal/\n│   ├── model/\n│   │   └── conf/          # INI 配置读写\n│   └── reviewer/          # 变更收集 / 并发执行 / 报告输出\n├── build/                 # 构建产物（git 忽略）\n├── go.mod\n├── go.sum\n└── README.md\n```\n\n## 🤝 贡献指南\n\n欢迎贡献代码！请遵循以下步骤：\n\n1. Fork 本仓库\n2. 创建特性分支: `git checkout -b feature/amazing-feature`\n3. 提交更改: `git commit -m 'Add amazing feature'`\n4. 推送分支: `git push origin feature/amazing-feature`\n5. 提交 Pull Request\n\n## 📄 许可证\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情\n\n## 🙏 致谢\n\n- [Eino](https://github.com/cloudwego/eino) - 强大的 LLM 应用框架\n- [Cobra](https://github.com/spf13/cobra) - Go CLI 库\n- [go-git](https://github.com/go-git/go-git) - Git 实现\n- [go-diff](https://github.com/sergi/go-diff) - 差异比较库\n\n- [ethereal14](https://github.com/ethereal14) - my good friend\n\n## 📞 支持\n\n如果你遇到问题或有建议，请：\n\n- 提交 Issue\n- 发起 Discussion\n\n---\n\n⭐ 如果这个项目对你有帮助，请给我们一个 Star！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzy2210%2Fstellarspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzy2210%2Fstellarspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzy2210%2Fstellarspec/lists"}