Files
skills/scripts/README-git-auto-commit.md
2026-03-20 17:56:59 +08:00

80 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Git 自动提交脚本使用说明 (Python 版本)
## 文件说明
- `git_auto_commit.py` - 基础版:仅自动提交
- `git_auto_commit_with_skills_organize.py` - **增强版**:先整理 skills 文件夹,再自动提交
- `git_config.env` - **需要你填写**的认证配置
## 增强版功能
`git_auto_commit_with_skills_organize.py` 会在提交前自动执行以下操作:
1. **整理 Skills 文件夹** (`C:/ai/skills`)
- 遍历各个分类文件夹(内容创作、图像制作、视频制作等)
- 为每个 .zip 文件创建同名文件夹
- 将 .zip 移入对应文件夹
- 生成 install.md 文件
2. **Git 自动提交** (`C:/ai/openclaw`)
- 将整理后的内容提交到 Gitea 仓库
## 配置步骤
1. **编辑配置文件**
```
# 编辑 scripts/git-config.env
GIT_USERNAME=你的用户名
GIT_PASSWORD=你的密码
```
2. **测试脚本**
```bash
# 使用增强版脚本(推荐)
python scripts/git_auto_commit_with_skills_organize.py
# 或基础版(仅提交)
python scripts/git_auto_commit.py
```
3. **设置定时任务(每晚12点)**
**Windows (PowerShell 管理员):**
```powershell
$Action = New-ScheduledTaskAction -Execute "python.exe" -Argument "C:\ai\openclaw\scripts\git_auto_commit_with_skills_organize.py"
$Trigger = New-ScheduledTaskTrigger -Daily -At "00:00"
Register-ScheduledTask -TaskName "GitAutoCommit" -Action $Action -Trigger $Trigger
```
## 安全提示
- `git-config.env` 文件包含敏感信息,已添加到 `.gitignore`
- 请妥善保管你的密码
## 手动运行
```bash
# 使用默认目录
python scripts/git_auto_commit_with_skills_organize.py
# 指定其他源目录(skills 整理仍使用 C:/ai/skills
python scripts/git_auto_commit_with_skills_organize.py C:/其他/路径
```
## 依赖
只需要 Python 3.6+,无需额外依赖。
## 分类映射
| 中文分类 | URL 路径 |
|---------|---------|
| 内容创作 | content_creation |
| 图像制作 | image_generation |
| 视频制作 | video_production |
| 音频创作 | audio_creation |
| AI剪辑 | AI_video_trim |
| 社媒运营 | social_media |
| 电商工具 | E-commerce_tools |
| 漫剧制作 | comic_drama |