{"id":29874008,"url":"https://github.com/yinzhenyu-su/weekly-git-summary","last_synced_at":"2025-07-31T00:02:11.268Z","repository":{"id":303538006,"uuid":"1015790995","full_name":"yinzhenyu-su/weekly-git-summary","owner":"yinzhenyu-su","description":"一个跨平台的 CLI 工具，用于生成 Git 提交记录的周报汇总。支持多种输出格式（文本、JSON、Markdown、 HTML），自动扫描项目目录并提取指定时间范围内的提交历史。","archived":false,"fork":false,"pushed_at":"2025-07-25T03:50:12.000Z","size":507,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T08:35:25.186Z","etag":null,"topics":["bunjs","git","shell-script","weekly-reports"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/yinzhenyu-su.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2025-07-08T03:42:44.000Z","updated_at":"2025-07-17T11:11:01.000Z","dependencies_parsed_at":"2025-07-25T05:14:50.353Z","dependency_job_id":null,"html_url":"https://github.com/yinzhenyu-su/weekly-git-summary","commit_stats":null,"previous_names":["yinzhenyu-su/weekly-git-summary"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/yinzhenyu-su/weekly-git-summary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinzhenyu-su%2Fweekly-git-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinzhenyu-su%2Fweekly-git-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinzhenyu-su%2Fweekly-git-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinzhenyu-su%2Fweekly-git-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinzhenyu-su","download_url":"https://codeload.github.com/yinzhenyu-su/weekly-git-summary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinzhenyu-su%2Fweekly-git-summary/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267961953,"owners_count":24172528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["bunjs","git","shell-script","weekly-reports"],"created_at":"2025-07-31T00:01:12.602Z","updated_at":"2025-07-31T00:02:11.050Z","avatar_url":"https://github.com/yinzhenyu-su.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# weekly-git-summary\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/yinzhenyu-su/weekly-git-summary/main/scripts/dist/banner.svg\" alt=\"weekly-git-summary Banner\" width=\"100%\"\u003e\n\u003c/div\u003e\n\n[![npm version](https://img.shields.io/npm/v/weekly-git-summary.svg)](https://www.npmjs.com/package/weekly-git-summary)\n[![Node version](https://img.shields.io/node/v/weekly-git-summary.svg)](https://nodejs.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n一个跨平台的 CLI 工具，用于生成 Git 提交记录的周报汇总。支持多种输出格式（文本、JSON、Markdown），自动扫描项目目录并提取指定时间范围内的提交历史。\n\n## 🚀 特性\n\n- **跨平台支持** - 自动检测系统环境，Windows 使用 Node.js，macOS/Linux 使用 Bash 或 Node.js\n- **多种输出格式** - 支持彩色终端输出、JSON 格式、Markdown 格式\n- **智能仓库扫描** - 自动扫描指定目录下的 Git 仓库（最大深度 2 层）\n- **灵活的时间范围** - 支持自定义开始和结束日期\n- **作者过滤** - 可以按特定作者筛选提交记录\n- **可视化展示** - 包含 Web 可视化界面，支持图表展示\n- **零配置使用** - 开箱即用，无需复杂配置\n\n## 📦 安装\n\n### 全局安装\n\n```bash\nnpm install -g weekly-git-summary\n```\n\n### 使用 npx（推荐）\n\n```bash\nnpx weekly-git-summary\n```\n\n## 🎯 使用方法\n\n### 基本用法\n\n```bash\n# 生成当前目录的本周提交汇总\nweekly-git-summary\n\n# 或使用 npx\nnpx weekly-git-summary\n```\n\n### 常用选项\n\n```bash\n# 指定目录和时间范围\nweekly-git-summary --dir ~/projects --since 2023-01-01 --until 2023-01-31\n\n# 过滤特定作者的提交\nweekly-git-summary --author \"张三\" --since 2023-01-01\n\n# 输出 JSON 格式\nweekly-git-summary --json\n\n# 输出 Markdown 格式\nweekly-git-summary --md\n\n# 显示帮助信息\nweekly-git-summary --help\n```\n\n## 📋 命令行参数\n\n| 参数       | 简写 | 描述                  | 默认值   |\n| ---------- | ---- | --------------------- | -------- |\n| `--dir`    | `-d` | 指定要扫描的目录      | 当前目录 |\n| `--since`  | `-s` | 开始日期 (YYYY-MM-DD) | 本周一   |\n| `--until`  | `-u` | 结束日期 (YYYY-MM-DD) | 今天     |\n| `--author` | `-a` | 按作者过滤提交        | 所有作者 |\n| `--json`   | `-j` | 以 JSON 格式输出      | false    |\n| `--md`     | `-m` | 以 Markdown 格式输出  | false    |\n| `--html`   |      | 以 HTML 格式输出      | false    |\n| `--help`   | `-h` | 显示帮助信息          | -        |\n\n## 📊 输出格式\n\n### 1. 彩色终端输出（默认）\n\n```\n工作内容Git提交记录汇总\n\n统计时间范围: 2023-06-26 到 2023-07-02\n搜索目录: .\n\n📦 my-project (github.com/user/my-project)\n\n📅 2023-07-02\n  • feat: 添加用户认证功能 (作者: 张三, hash: abc123)\n  • fix: 修复登录页面样式问题 (作者: 李四, hash: def456)\n\n📅 2023-07-01\n  • docs: 更新 API 文档 (作者: 王五, hash: ghi789)\n```\n\n### 2. JSON 格式\n\n```json\n{\n  \"timeRange\": {\n    \"since\": \"2023-06-26\",\n    \"until\": \"2023-07-02\"\n  },\n  \"searchDir\": \".\",\n  \"repositories\": [\n    {\n      \"name\": \"my-project\",\n      \"url\": \"github.com/user/my-project\",\n      \"commits\": [\n        {\n          \"date\": \"2023-07-02\",\n          \"commits\": [\n            {\n              \"message\": \"feat: 添加用户认证功能\",\n              \"author\": \"张三\",\n              \"hash\": \"abc123\"\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n### 3. Markdown 格式\n\n```markdown\n# 工作内容 Git 提交记录汇总\n\n- **统计时间范围**: 2023-06-26 到 2023-07-02\n- **搜索目录**: .\n\n## my-project\n\n### 2023-07-02\n\n- feat: 添加用户认证功能 (作者: 张三, hash: abc123)\n- fix: 修复登录页面样式问题 (作者: 李四, hash: def456)\n\n### 2023-07-01\n\n- docs: 更新 API 文档 (作者: 王五, hash: ghi789)\n```\n\n## 🎨 可视化界面\n\n项目包含一个精美的 Web 可视化界面 (`git-log.html`)，提供：\n\n- 🌓 深色/浅色主题切换\n- 📊 提交类型分布雷达图\n- 📈 提交统计卡片\n- 🕒 交互式时间线\n- 📱 响应式设计\n\n![纯文本格式](https://raw.githubusercontent.com/yinzhenyu-su/weekly-git-summary/main/scripts/dist/weekly-git-summary-1.png)\n![JSON 输出](https://raw.githubusercontent.com/yinzhenyu-su/weekly-git-summary/main/scripts/dist/weekly-git-summary-2.png)\n![Web 可视化界面](https://raw.githubusercontent.com/yinzhenyu-su/weekly-git-summary/main/scripts/dist/weekly-git-summary-3.png)\n\n## 🛠️ 开发\n\n### 环境要求\n\n- Node.js ≥ 22.0.0\n- Bun (用于构建)\n- Git 命令行工具\n\n### 本地开发\n\n```bash\n# 克隆项目\ngit clone \u003crepository-url\u003e\ncd weekly-git-summary\n\n# 安装依赖\nbun install\n\n# 构建项目\nbun run build\n\n# 运行测试\nbun test\n\n# 监视模式测试\nbun test --watch\n\n# 本地链接测试\nnpm link\nweekly-git-summary --help\n```\n\n### 项目结构\n\n```bash\nweekly-git-summary/\n├── scripts/\n│   ├── cli.ts                 # CLI 入口点（TypeScript）\n│   ├── weekly-git-summary.ts  # TypeScript 脚本实现\n│   ├── weekly-git-summary.sh  # Shell 脚本实现\n│   ├── weekly-git-summary.ps1 # PowerShell 脚本实现\n│   ├── git-log.html           # Web 可视化界面模板\n│   └── dist/                  # 示例截图\n├── tests/\n│   ├── cli.test.ts            # CLI 功能测试\n│   ├── build.test.ts          # 构建系统测试\n│   ├── integration.test.ts    # 集成测试\n│   └── windows.test.ts        # Windows 兼容性测试\n├── build/                     # 构建输出目录\n├── build.ts                   # Bun 构建配置\n├── package.json              # 项目配置\n├── tsconfig.json             # TypeScript 配置\n├── CLAUDE.md                 # 项目开发指南\n└── README.md                 # 项目文档\n```\n\n### 架构设计\n\n该项目采用智能的跨平台架构：\n\n1. **TypeScript CLI 包装器** (`scripts/cli.ts`)\n\n   - 检测操作系统类型\n   - 自动选择对应的脚本实现\n   - 透明传递命令行参数\n\n2. **平台特定实现**\n\n   - **Windows**: Node.js 脚本 (跨平台兼容)\n   - **macOS/Linux**: Bash 脚本（已集成 URL 转换功能）或 Node.js 脚本 (回退)\n   - **PowerShell**: 支持 Windows PowerShell 环境\n   - 功能完全一致，参数格式统一\n\n3. **构建系统**\n   - 使用 Bun 进行 TypeScript 编译\n   - 输出 ESM 格式的 Node.js 模块\n   - 自动生成可执行的 CLI 工具\n\n## 🧪 测试\n\n项目包含全面的测试套件：\n\n```bash\n# 运行所有测试\nbun test\n\n# 查看测试覆盖率\nbun test --coverage\n```\n\n### 测试内容\n\n- **CLI 功能测试** - 验证命令行参数处理、输出格式等\n- **构建系统测试** - 验证构建过程和输出文件\n- **跨平台兼容性** - 验证不同系统环境下的行为\n- **错误处理** - 验证异常情况的处理\n\n## 📄 许可证\n\nMIT License - 详见 [LICENSE](LICENSE) 文件\n\n## 🤝 贡献\n\n欢迎提交 Issue 和 Pull Request！\n\n### 贡献指南\n\n1. Fork 项目\n2. 创建功能分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 打开 Pull Request\n\n### 开发规范\n\n- 使用 TypeScript 进行类型安全的开发\n- 遵循 ESLint 和 Prettier 规范\n- 为新功能添加相应的测试\n- 更新相关文档\n\n## 🔗 相关链接\n\n- [npm 包地址](https://www.npmjs.com/package/weekly-git-summary)\n- [GitHub 仓库](https://github.com/user/weekly-git-summary)\n- [问题反馈](https://github.com/user/weekly-git-summary/issues)\n\n## 📞 支持\n\n如果您遇到任何问题或有功能建议，请：\n\n1. 查看 [常见问题](docs/FAQ.md)\n2. 搜索已有的 [Issues](https://github.com/user/weekly-git-summary/issues)\n3. 创建新的 Issue 描述您的问题\n\n---\n\n**喜欢这个项目？请给它一个 ⭐️**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinzhenyu-su%2Fweekly-git-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinzhenyu-su%2Fweekly-git-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinzhenyu-su%2Fweekly-git-summary/lists"}