Install
openclaw skills install @thcjp/git-cli-tool-pro面向企业研发团队的高级Git命令行工具,提供自动化脚本、深度仓库诊断、工作流模板、故障排除与批量操作能力。核心能力: - Git自动化脚本库 - 深度仓库诊断与分析 - 标准化工作流模板 - 故障排除与恢复 - 批量Git操作 - 多仓库管理 适用场景: - 企业级Git工作流自动化 - 仓库健康诊断 - 团队标准化操作 - 复杂故障排除 差异化: - 专业版完全兼容免费版命令,支持平滑升级 - 提供自动化脚本和批量操作 - 内置深度诊断和工作流模板 - 支持多仓库统一管理 ...
openclaw skills install @thcjp/git-cli-tool-proGit命令行助手专业版为企业研发团队提供高级Git CLI自动化能力。在免费版基础命令参考之上,专业版新增自动化脚本库、深度仓库诊断、标准化工作流模板、故障排除与恢复以及批量操作能力,帮助团队提升Git使用效率. 专业版完全兼容免费版的所有Git命令和配置,研发团队可从免费版无缝升级,已有别名和配置无需修改.
提供常用Git操作的自动化脚本.
详细代码示例已移至
references/detail.md
处理: 解析Git自动化脚本库的输入参数,完成核心逻辑,返回结构化响应. 输出: 返回Git自动化脚本库的响应数据,包含状态码、结果和日志.
处理: 解析深度仓库诊断的输入参数,完成核心逻辑,返回结构化响应. 输出: 返回深度仓库诊断的响应数据,包含状态码、结果和日志.
处理: 解析工作流模板的输入参数,完成核心逻辑,返回结构化响应. 输出: 返回工作流模板的响应数据,包含状态码、结果和日志.
处理: 解析多仓库管理的输入参数,完成核心逻辑,返回结构化响应. 输出: 返回多仓库管理的响应数据,包含状态码、结果和日志. 能力覆盖范围:本skill的核心能力覆盖以下场景关键词:企业级、CLI、支持自动化脚本、深度诊断、工作流模板与故障、提升团队效率、面向企业研发团队、的高级、命令行工具、提供自动化脚本、故障排除与批量操、作能力、核心能力、深度仓库诊断与分、标准化工作流模板、故障排除与恢复等。这些关键词对应description中声明的使用场景,均已在上述能力点中提供对应的操作支持.
自动化日常Git操作.
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input | string | 是 | Git命令行助手专业版处理的输入数据或指令 |
| options | object | 否 | 附加配置选项,如模式选择、格式偏好等 |
| callback_url | string | 否 | 异步处理完成后的回调通知URL |
#!/bin/sh
echo "=== Git日常自动化 ==="
# ...
echo "1. 仓库状态:"
python3 -c "
from git_automation import GitAutomation
import json
status = GitAutomation.get_repo_status()
print(json.dumps(status, indent=2, ensure_ascii=False))
"
# ...
echo -e "\n2. 智能提交:"
python3 -c "
from git_automation import GitAutomation
result = GitAutomation.smart_commit('feat: 日常开发提交')
print(result)
"
# ...
echo -e "\n3. 智能同步:"
python3 -c "
from git_automation import GitAutomation
print(result)
"
定期对仓库进行健康诊断.
#!/bin/sh
echo "=== Git仓库健康诊断 ==="
# ...
python3 -c "
from git_diagnostics import GitDiagnostics
import json
# ...
diagnosis = GitDiagnostics.full_diagnosis()
print(json.dumps(diagnosis, indent=2, ensure_ascii=False))
# ...
print('\n=== 建议 ===')
for rec in diagnosis.get('recommendations', []):
print(f' - {rec}')
"
统一管理多个Git仓库.
#!/bin/sh
echo "=== 多仓库批量管理 ==="
# ...
cat > repos.txt << 'EOF'
/path/to/project-a
/path/to/project-b
/path/to/project-c
EOF
# ...
echo "1. 批量状态检查:"
python3 -c "
from multi_repo import MultiRepoManager
import json
manager = MultiRepoManager('repos.txt')
status = manager.batch_status()
for repo, info in status.items():
if 'error' in info:
print(f'[ERROR] {repo}: {info[\"error\"]}')
else:
branch = info.get('branch', '?')
clean = '干净' if info.get('is_clean') else '有变更'
print(f'[OK] {repo}: {branch} ({clean})')
"
# ...
echo -e "\n2. 批量同步:"
python3 -c "
from multi_repo import MultiRepoManager
results = manager.batch_sync()
for repo, result in results.items():
print(f'{repo}: {result}')
"
# ...
echo -e "\n3. 批量清理:"
python3 -c "
from multi_repo import MultiRepoManager
results = manager.batch_cleanup()
print(f'{repo}: {result}')
"
以下场景Git命令行助手专业版不适合处理:
需要提升效率、自动化流程、批量处理、工作流优化时使用。不适用于非本工具能力范围的需求.
version: "2.0"
edition: pro
# ...
automation:
smart_commit: true
auto_sync: true
auto_cleanup: true
# ...
diagnostics:
health_check: true
performance_check: true
security_check: true
large_file_threshold: 10MB
# ...
workflows:
feature:
branch_prefix: "feature/"
auto_push: true
auto_cleanup_on_merge: true
hotfix:
branch_prefix: "hotfix/"
auto_tag: true
release:
branch_prefix: "release/"
auto_tag: true
# ...
multi_repo:
repos_file: repos.txt
batch_operations: [status, sync, cleanup]
请对当前Git仓库进行深度健康诊断,输出问题和建议.
version: "2.0"
edition: pro
# ...
automation:
smart_commit:
enabled: true
auto_stage: true
message_template: "type(scope): description"
auto_sync:
enabled: true
interval: 300 # 5分钟
rebase: true
auto_cleanup:
enabled: true
cleanup_merged: true
cleanup_stale_days: 30
# ...
diagnostics:
health_check:
uncommitted_changes: true
unpushed_commits: true
stash_count: 5
performance:
repo_size_warning: 500MB
loose_objects_warning: 10000
gc_recommended: true
security:
check_sensitive_files: true
sensitive_patterns: [.env, .pem, .key, .secret]
check_history: true
# ...
workflows:
feature:
prefix: "feature/"
base: main
auto_push: true
squash_on_merge: true
cleanup_after_merge: true
hotfix:
prefix: "hotfix/"
base: main
auto_tag: true
tag_format: "hotfix-{date}"
release:
prefix: "release/"
base: main
auto_tag: true
tag_format: "v{version}"
# ...
multi_repo:
repos:
- /path/to/project-a
- /path/to/project-b
batch_ops:
- status
- sync
- cleanup
parallel: true
0 2 * * 0 python3 git_diagnostics.py > /var/log/git-diagnosis.log
python3 -c "from git_automation import GitAutomation; GitAutomation.smart_commit('feat: update')"
批量管理:统一管理多个仓库状态
工作流标准化:使用模板确保团队工作流一致
安全检查:定期运行安全检查发现敏感信息泄露
专业版完全兼容免费版的所有Git命令和配置。免费版的别名和配置可直接使用,专业版会自动启用自动化和诊断功能.
所有自动化脚本遵循安全优先原则:
| 仓库数量 | 并行处理 | 耗时 |
|---|---|---|
| 1-10 | 串行 | <10s |
| 10-50 | 并行 | 10-30s |
| 50-100 | 并行 | 30-60s |
| 100+ | 分批并行 | 1-5min |
workflows:
custom:
prefix: "custom/"
steps:
- fetch
- create_branch
- push
- notify
| 依赖项 | 类型 | 是否必需 | 获取方式 |
|---|---|---|---|
| Git 2.20+ | 运行时 | 必需 | git-scm.com 下载 |
| Python 3.8+ | 运行时 | 必需 | python.org 下载 |
| Bash | 运行时 | 推荐 | 系统自带 |
| LLM API | API | 必需 | 由 Agent 内置 LLM 提供 |
ssh-keygen -t ed25519 -C "your@email.com"
# ...
git config --global credential.helper store
| 错误场景 | 原因 | 处理方式 |
|---|---|---|
| 配置错误 | 参数缺失或格式错误 | 检查依赖说明中的配置要求 |
| 运行时错误 | 运行环境不满足 | 确认运行环境符合依赖说明 |
| 网络错误 | 连接超时或不可达 | 执行ping命令测试网络连通性,检查防火墙和代理设置连接后执行ping命令测试网络连通性,检查防火墙和代理设置连接后重新执行命令,参考国内替代方案 |
输出:返回执行结果,包含操作状态和输出数据
用户: 执行核心功能
Skill: 正在执行核心功能...
Skill: 执行完成,结果如下: 操作成功
{
"success": true,
"data": {
"result": "Git命令行助手专业版处理结果",
"execution_time": "0.5s",
"metadata": {
"version": "1.0",
"processor": "git cli pro"
}
},
"execution_log": ["解析输入参数", "执行核心处理", "格式化输出结果"],
"error": null
}
| 风险类型 | 防范措施 |
|---|---|
| API密钥泄露 | 通过环境变量配置,禁止硬编码到代码或配置文件中 |
| 命令执行风险 | 仅执行白名单命令,避免拼接用户输入到命令行参数中 |
| 网络通信安全 | 使用HTTPS协议,验证SSL证书有效性 |
| 敏感数据暴露 | 输出结果中不包含密钥、令牌等敏感信息 |
使用前请确认已阅读依赖说明章节,确保运行环境满足安全要求。