← 返回 Skills 市场
panchenbo

Atomgit Powershell

作者 panchenbo · GitHub ↗ · v3.0.1 · MIT-0
win32linuxdarwin ✓ 安全检测通过
166
总下载
1
收藏
1
当前安装
7
版本数
在 OpenClaw 中安装
/install atomgit-powershell
功能描述
AtomGit (GitCode) 代码托管平台集成 - PowerShell 版本。完整支持 PR 审查、批准、合并、仓库管理、Issues 管理。特色功能:批量并行处理 (性能提升 80%)、CI 流水线检查、仓库协作管理。跨平台:Windows/Linux/macOS。
使用说明 (SKILL.md)

当何时使用

当任务涉及 AtomGit/GitCode 平台的 Pull Request 审查、批准、合并、仓库管理等操作时优先使用此版本

适用场景:

  • ✅ OpenClaw 技能 (原生支持)
  • ✅ Windows/Linux/macOS 跨平台
  • ✅ 需要批量处理 PR
  • ✅ 复杂 JSON 处理
  • ✅ 需要结构化错误处理

不适用场景:

  • ❌ 无 PowerShell 环境
  • ❌ 仅需简单单次 API 调用

快速参考

主题 文件
快速入门 README.md
命令参考 commands.md
API 参考 API-REFERENCE.md
更新日志 CHANGELOG.md

📦 安装说明

ClawHub 限制: 由于 ClawHub 平台限制,PowerShell 脚本文件 (.ps1) 会被重命名为 .ps1.txt 发布。

安装步骤

  1. 从 ClawHub 安装技能 (自动完成)

  2. 恢复脚本文件扩展名:

# 进入技能目录
cd ~/.openclaw/workspace/skills/atomgit-ps

# 恢复 scripts 目录中的.ps1 扩展名
Rename-Item -Path "scripts/*.ps1.txt" -NewName { $_.Name -replace '\.ps1\.txt$', '.ps1' }

# 验证
Get-ChildItem scripts/*.ps1
  1. 验证安装:
# 加载技能
. ~/.openclaw/workspace/skills/atomgit-ps/scripts/atomgit.ps1

# 查看帮助
AtomGit-Help

文件说明

文件 说明
scripts/atomgit.ps1.txt 主执行脚本 (需恢复为.ps1)
scripts/atomgit-batch.ps1.txt 批量处理脚本 (需恢复为.ps1)

核心命令

命令 说明 示例
AtomGit-Login 登录认证 AtomGit-Login "token"
AtomGit-GetPRList 获取 PR 列表 AtomGit-GetPRList -Owner "o" -Repo "r"
AtomGit-ApprovePR 批准 PR AtomGit-ApprovePR -Owner "o" -Repo "r" -PR 123
AtomGit-MergePR 合并 PR AtomGit-MergePR -Owner "o" -Repo "r" -PR 123
AtomGit-GetIssues 获取 Issues AtomGit-GetIssues -Owner "o" -Repo "r"

完整命令列表: commands.md

特色功能

1. 批量并行处理

# 并行处理多个 PR,性能提升 80%
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit-batch.ps1
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2557, 2558, 2560) `
    -Parallel `
    -MaxConcurrency 3

性能对比:

  • 串行处理 3 个 PR: ~3 分钟
  • 并行处理 3 个 PR: ~35 秒
  • 提升: 81% ⬇️

2. 处理规则

PR 处理判断标准:

  • 已处理: 同时有 /lgtm/approve 两条评论
  • 未处理: 缺少任一评论 (只有/lgtm、只有/approve、或都没有)

说明: 必须同时具备 /lgtm/approve 才算完成审查流程

3. CI 流水线检查 (v2.5.0 新增)

# 加载脚本
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit.ps1

# 检查 CI 流水线
AtomGit-CheckCI -Owner "openeuler" -Repo "release-management" -PR 2560

状态码:

  • 0 - ✅ SUCCESS (全部通过)
  • 1 - ⏳ RUNNING (有运行中)
  • 2 - ❌ FAILED (有失败)

4. 暂不支持的功能

  • AtomGit-GetPRReviews - AtomGit API 不支持 /pulls/{id}/reviews 端点

💡 使用示例

场景 1: 查询需要处理的 PR

# 加载脚本
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit.ps1

# 查询开放 PR
$prs = AtomGit-GetPRList -Owner "openeuler" -Repo "release-management" -State "open"

# 检查每个 PR 的处理状态
foreach ($pr in $prs) {
    $comments = AtomGit-GetPRComments -Owner "openeuler" -Repo "release-management" -PR $pr.number
    $myComments = $comments | Where-Object { $_.user.login -eq "panchenbo" }
    $hasLgtm = $myComments | Where-Object { $_.body -eq "/lgtm" }
    $hasApprove = $myComments | Where-Object { $_.body -eq "/approve" }
    
    if ($hasLgtm -and $hasApprove) {
        Write-Host "PR #$($pr.number): ✅ 已处理" -ForegroundColor Green
    } elseif ($hasLgtm) {
        Write-Host "PR #$($pr.number): ⏳ 已 LGTM,待 Approve" -ForegroundColor Yellow
    } else {
        Write-Host "PR #$($pr.number): ❌ 未处理" -ForegroundColor Red
    }
}

场景 2: 批量批准 PR

# 加载批量脚本
. ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit-batch.ps1

# 并行批量批准 (推荐)
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2547, 2564, 2565) `
    -Parallel `
    -MaxConcurrency 3

场景 3: 检查 CI 状态

# 检查 CI 流水线
AtomGit-CheckCI -Owner "openeuler" -Repo "release-management" -PR 2564

# 输出示例:
# === AtomGit CI Check ===
# Total: 10
# Success: 9
# Failure: 1
# Overall: FAILED

场景 4: 创建 PR

# 创建 PR
AtomGit-CreatePR -Owner "openeuler" -Repo "release-management" `
    -Title "添加新包" `
    -Head "feature/new-package" `
    -Base "main" `
    -Body "这个 PR 添加了新的软件包"

场景 5: 协作管理

# 获取协作者列表
AtomGit-GetCollaborators -Owner "openeuler" -Repo "release-management"

# 添加协作者
AtomGit-AddCollaborator -Owner "openeuler" -Repo "release-management" `
    -Username "newuser" -Permission "push"

# 移除协作者
AtomGit-RemoveCollaborator -Owner "openeuler" -Repo "release-management" `
    -Username "olduser"

场景 6: Issues 管理

# 获取 Issues 列表
AtomGit-GetIssues -Owner "openeuler" -Repo "release-management" -State "open"

# 创建 Issue
AtomGit-CreateIssue -Owner "openeuler" -Repo "release-management" `
    -Title "发现 bug" -Body "详细描述..."

# 添加评论
AtomGit-AddIssueComment -Owner "openeuler" -Repo "release-management" `
    -Issue 123 -Comment "这个问题已经修复"

场景 7: 仓库查询

# 获取我的仓库
AtomGit-GetRepos

# 获取仓库详情
AtomGit-GetRepoDetail -Owner "openeuler" -Repo "release-management"

# 获取文件树
AtomGit-GetRepoTree -Owner "openeuler" -Repo "release-management"

# 获取文件内容
AtomGit-GetRepoFile -Owner "openeuler" -Repo "release-management" -Path "README.md"

场景 8: 其他查询

# 获取标签列表
AtomGit-GetLabels -Owner "openeuler" -Repo "release-management"

# 获取发布列表
AtomGit-GetReleases -Owner "openeuler" -Repo "release-management"

# 获取 Webhooks 列表
AtomGit-GetHooks -Owner "openeuler" -Repo "release-management"

🎯 最佳实践

1. 批量处理优先使用并行

# ✅ 推荐:并行处理,性能提升 80%
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2547, 2564, 2565) -Parallel -MaxConcurrency 3

# ❌ 不推荐:串行处理
foreach ($pr in @(2547, 2564, 2565)) {
    AtomGit-ApprovePR -Owner "openeuler" -Repo "release-management" -PR $pr
}

2. Token 安全

# ✅ 推荐:使用环境变量
$env:ATOMGIT_TOKEN="YOUR_TOKEN"

# ❌ 不推荐:硬编码在脚本中
$token = "YOUR_TOKEN"  # 不要提交到 Git

3. 错误处理

# ✅ 技能自动处理错误
try {
    AtomGit-ApprovePR -Owner "openeuler" -Repo "release-management" -PR 2547
} catch {
    Write-Host "批准失败:$($_.Exception.Message)"
}

API 端点

Base URL: https://api.atomgit.com/api/v5

认证方式:

$headers = @{ "Authorization" = "Bearer YOUR_TOKEN" }
Invoke-RestMethod -Uri "https://api.atomgit.com/api/v5/user" -Headers $headers

详细 API: API-REFERENCE.md

状态码

状态码 说明
200 OK 请求成功
201 Created 资源创建成功
400 Bad Request 请求参数错误
401 Unauthorized 未认证
403 Forbidden 无权限
404 Not Found 资源不存在
429 Too Many Requests 请求超限 (50/分,5000/小时)

系统要求

组件 要求 说明
PowerShell 5.1+ Windows 内置,Linux/macOS 需安装
.NET 4.7+ 通常已预装
网络 HTTPS 访问 api.atomgit.com

安装

方式 1: ClawHub (推荐)

clawhub install atomgit-ps

方式 2: 手动安装

# 1. 克隆技能到本地
# 2. 配置 Token (优先级:环境变量 > openclaw.json)
$env:ATOMGIT_TOKEN="YOUR_TOKEN"

# 或在 ~/.openclaw/openclaw.json 中添加:
# {"env": {"ATOMGIT_TOKEN": "YOUR_TOKEN"}}

# 3. 加载技能
. ~/.openclaw/workspace/skills/atomgit-ps/scripts/atomgit.ps1

Token 配置

优先级顺序:

  1. 环境变量 ATOMGIT_TOKEN (最高优先级)
  2. openclaw.json 中的 env.ATOMGIT_TOKEN 字段

配置方式:

# 方式 1: 环境变量 (推荐用于临时会话)
$env:ATOMGIT_TOKEN="YOUR_TOKEN"

# 方式 2: openclaw.json (推荐用于持久配置)
# 编辑 ~/.openclaw/openclaw.json,添加:
{
  "env": {
    "ATOMGIT_TOKEN": "YOUR_TOKEN"
  }
}

使用示例

登录

AtomGit-Login "YOUR_TOKEN"

获取用户信息

AtomGit-GetUserInfo

获取 PR 列表

AtomGit-GetPRList -Owner "openeuler" -Repo "release-management" -State "open"

批准 PR

AtomGit-ApprovePR -Owner "openeuler" -Repo "release-management" -PR 2560 -Comment "/lgtm"

批量处理

. ~/.openclaw/workspace/skills/atomgit-ps/scripts/atomgit-batch.ps1
Invoke-BatchApprove -Owner "openeuler" -Repo "release-management" `
    -PRs @(2557, 2558, 2560) `
    -Parallel

相关技能

  • git - Git 版本控制基础操作

反馈

安全使用建议
This skill appears internally coherent for AtomGit/GitCode operations via PowerShell. Before using it, do the following: (1) Inspect the included .ps1 files yourself (they are bundled as .ps1.txt) to confirm there are no unexpected network endpoints or commands. (2) Verify the install path (SKILL.md sometimes references 'atomgit-ps' vs 'atomgit-powershell') before running rename commands. (3) Restrict the ATOMGIT_TOKEN to least privilege needed (use a token scope limited to repository operations). (4) Keep the token out of logs — the scripts claim to mask tokens but confirm behavior in your environment. (5) Run first in an isolated/sandbox environment if possible, especially when using the parallel batch functions. If you need higher assurance, request a signed or authoritative upstream source (origin of the skill is unknown) or compare the scripts to an official AtomGit client implementation.
功能分析
Type: OpenClaw Skill Name: atomgit-powershell Version: 3.0.1 The AtomGit-PowerShell skill bundle is a legitimate integration for the AtomGit (GitCode) platform. The PowerShell scripts (atomgit.ps1.txt and atomgit-batch.ps1.txt) implement standard API interactions with api.atomgit.com and include proactive security measures such as regex-based input validation for repository names, token masking in logs, and error handling designed to prevent credential leakage. The instructions in SKILL.md regarding file renaming are consistent with the stated deployment constraints and do not exhibit malicious intent or prompt-injection attacks.
能力评估
Purpose & Capability
Name/description (AtomGit PowerShell integration) align with required binary (powershell) and the single required env var (ATOMGIT_TOKEN). The provided scripts implement PR, issue, CI-check and collaborator operations against api.atomgit.com which matches the declared purpose.
Instruction Scope
SKILL.md tells the agent to restore .ps1 file extensions, load the included PowerShell scripts, and set ATOMGIT_TOKEN (env or config). Those instructions operate only within the skill workspace and call the AtomGit API. Minor inconsistencies: SKILL.md uses path 'atomgit-ps' in one place while other metadata/paths use 'atomgit-powershell' (double-check install path). The scripts read ~/.openclaw/openclaw.json and ~/.openclaw/config/atomgit.json for tokens—this is expected for credentials but you should inspect those files before use.
Install Mechanism
No install spec (instruction-only). The skill includes PowerShell script files (.ps1.txt) the user is instructed to rename and load. No external downloads or archive extraction occur as part of the skill itself.
Credentials
Only ATOMGIT_TOKEN is required and is used for Authorization to the AtomGit API. The scripts also optionally read local OpenClaw config files (~/.openclaw/*) to obtain the token; this is proportionate to the goal of authenticating API calls. No unrelated credentials or extra secrets are requested.
Persistence & Privilege
Skill does not declare always:true and is user-invocable. It modifies files only in its own workspace (renaming .ps1.txt to .ps1) which matches the declared fileAccess: workspace. It does not request system-wide privileges or modify other skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install atomgit-powershell
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /atomgit-powershell 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v3.0.1
v3.0.1 - 安全增强:完善输入验证、错误处理、Token 保护,达到 ClawHub High Confidence 级别
v1.0.5
**atomgit-powershell v1.0.5 Changelog** - Expanded and clarified usage examples for common scenarios (PR管理/协作/Issues/仓库查询等) in SKILL.md. - Updated all script path references from `atomgit-ps` to `atomgit-powershell` for consistency. - Reformatted documentation with clearer sections and practical "方案/场景" PowerShell code examples. - Added "最佳实践" section with security and performance guidance. - No functional or code-level changes; documentation only.
v1.0.4
- 安全性提升:增强了输入验证、错误处理和 Token 保护机制 - 元数据更新:声明实现了 High Confidence 级别,包括 command injection 防护和 SSL 校验 - 文档更新:在 changelog 中标注安全性提升,反映当前安全防护能力
v1.0.3
- 修复文档版本号与实际版本号不一致的问题,SKILL.md 由 3.1.0 恢复为 3.0.0 - 保持实际代码和说明文档内容一致,无功能更新 - 优化文档版本溯源和维护流程
v1.0.2
- Added collaborative management features. - Enhanced Issues management capabilities. - Introduced support for querying Labels, Releases, and Webhooks. - Updated documentation to reflect new features.
v1.0.1
- Skill renamed from "atomgit-ps" to "atomgit-powershell" - Updated documentation to reflect the new skill name and directory structure - New installation instructions added to handle ClawHub file extension limitations (.ps1.txt → .ps1) - Added scripts/atomgit-batch.ps1.txt and scripts/atomgit.ps1.txt files - Improved metadata with enhanced security fields (sandboxing, path validation, rate limiting)
v1.0.0
初始发布 - 包含完整的 scripts 目录
元数据
Slug atomgit-powershell
版本 3.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 7
常见问题

Atomgit Powershell 是什么?

AtomGit (GitCode) 代码托管平台集成 - PowerShell 版本。完整支持 PR 审查、批准、合并、仓库管理、Issues 管理。特色功能:批量并行处理 (性能提升 80%)、CI 流水线检查、仓库协作管理。跨平台:Windows/Linux/macOS。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 166 次。

如何安装 Atomgit Powershell?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install atomgit-powershell」即可一键安装,无需额外配置。

Atomgit Powershell 是免费的吗?

是的,Atomgit Powershell 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Atomgit Powershell 支持哪些平台?

Atomgit Powershell 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(win32, linux, darwin)。

谁开发了 Atomgit Powershell?

由 panchenbo(@panchenbo)开发并维护,当前版本 v3.0.1。

💬 留言讨论