Add enhanced git auto-commit script with skills organize feature
This commit is contained in:
@@ -2,9 +2,23 @@
|
||||
|
||||
## 文件说明
|
||||
|
||||
- `git_auto_commit.py` - 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. **编辑配置文件**
|
||||
@@ -16,30 +30,22 @@
|
||||
|
||||
2. **测试脚本**
|
||||
```bash
|
||||
# 直接运行(使用默认目录 C:/ai/openclaw)
|
||||
python scripts/git_auto_commit.py
|
||||
# 使用增强版脚本(推荐)
|
||||
python scripts/git_auto_commit_with_skills_organize.py
|
||||
|
||||
# 或指定其他目录
|
||||
python scripts/git_auto_commit.py D:/其他/目录
|
||||
# 或基础版(仅提交)
|
||||
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.py"
|
||||
$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
|
||||
```
|
||||
|
||||
**或者使用任务计划程序 GUI:**
|
||||
1. 打开"任务计划程序"
|
||||
2. 创建基本任务
|
||||
3. 触发器: 每天 00:00
|
||||
4. 操作: 启动程序
|
||||
5. 程序: `python` 或 `python.exe`
|
||||
6. 参数: `C:\ai\openclaw\scripts\git_auto_commit.py`
|
||||
|
||||
## 安全提示
|
||||
|
||||
- `git_config.env` 文件包含敏感信息,已添加到 `.gitignore`
|
||||
@@ -49,13 +55,26 @@
|
||||
## 手动运行
|
||||
|
||||
```bash
|
||||
# 使用默认目录 (C:/ai/openclaw)
|
||||
python scripts/git_auto_commit.py
|
||||
# 使用默认目录
|
||||
python scripts/git_auto_commit_with_skills_organize.py
|
||||
|
||||
# 指定目录
|
||||
python scripts/git_auto_commit.py C:/其他/路径
|
||||
# 指定其他源目录(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 |
|
||||
|
||||
Reference in New Issue
Block a user