# git-message **Repository Path**: li_kun_zang/git-message ## Basic Information - **Project Name**: git-message - **Description**: # Git Commit Message 总结日报助手 ## 使用方式 告诉AI:你的工具在那个文件夹 告诉AI:你的git username是啥 告诉AI:你需要总计的报告的周期 ## Skill使用 告诉AI:帮我安装XXX的Skill 安装后,就可以告诉AI:使用日报助手,总结今日日报! - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-13 - **Last Updated**: 2026-04-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # git-message Git Commit Message 提取工具,支持 macOS / Linux / Windows,专为 QClaw 设计。 ## 目录结构 ``` git-message/ ├── git-message.sh # macOS / Linux 入口脚本 ├── git-message.bat # Windows 入口脚本 ├── git-message-core.py # Python 核心引擎(三端共用) ├── README.md └── 需求.txt ``` ## 依赖 | 系统 | 依赖 | |------|------| | macOS | `git`, `python3` | | Linux | `git`, `python3` | | Windows | `git`, `python3` (需将 python 加入 PATH) | ## 用法 ```bash # macOS / Linux ./git-message.sh [user] [time_range] [style] # Windows git-message.bat [user] [time_range] [style] ``` ### 参数说明 | 参数 | 说明 | 默认值 | |------|------|--------| | `repo_path` | 项目路径(必填) | — | | `user` | 作者名/邮箱(可选) | 全部 | | `time_range` | 时间范围 | `this-week` | | `style` | 输出风格 | 三版供选择 | ### time_range 可选值 | 值 | 含义 | |----|------| | `today` | 今天 | | `yesterday` | 昨天 | | `this-week` | 本周一至今 | | `last-week` | 上周 | | `this-month` | 本月 | | `last-month` | 上月 | | `YYYY-MM-DD..YYYY-MM-DD` | 自定义范围 | ### style 可选值 | 值 | 含义 | |----|------| | `brief` | 简洁摘要(提交数 + 消息列表) | | `detail` | 详细报告(+ 仓库信息 + 变更文件) | | `list` | 列表形式(表格对齐) | | 空/其他 | 三版同时输出,供选择 | ## 示例 ```bash # 本周所有提交(三版风格) ./git-message.sh /path/to/project # 某用户本月详细报告 ./git-message.sh /path/to/project 'zhangsan' this-month detail # 今天简洁列表 ./git-message.sh /path/to/project '' today list # 自定义范围 ./git-message.sh /path/to/project '' '2026-01-01..2026-03-31' ``` ## QClaw 调用方式 QClaw 可通过 `exec` 工具直接调用脚本: ``` exec: ./git-message.sh /path/to/repo this-week brief ``` 或使用 Python 引擎直接获取结构化数据(JSON): ```python # parse-time python3 git-message-core.py parse-time 2026-04-13 this-week # → 2026-04-13 00:00:00|2026-04-13 23:59:59|2026-04-13-2026-04-13 # stats (JSON) python3 git-message-core.py stats /path/repo '' '2026-04-01 00:00:00' '2026-04-13 23:59:59' # → {"total": N, "added": N, "deleted": N, "authors": "..."} # log (JSON) python3 git-message-core.py log /path/repo '' '...' '...' detail # → [{"hash": "...", "author": "...", "date": "...", "message": "...", ...}] ``` ## QClaw 日报场景提示词 ``` 帮我提取 /path/to/repo 的 Git Commit Message, 用户:zhangsan 时间范围:this-month 风格:brief ``` 工具自动完成:Git 检测 → 仓库校验 → 时间解析 → 数据提取 → 格式化输出 → 三版选择。