← 返回 Skills 市场
tenequm

gh-cli

作者 Misha Kolesnik · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ⚠ suspicious
177
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install gh-cli
功能描述
GitHub CLI for remote repository analysis, file fetching, codebase comparison, and discovering trending code/repos. Use when analyzing repos without cloning,...
使用说明 (SKILL.md)

GitHub CLI - Remote Analysis & Discovery

Remote repository operations, codebase comparison, and code discovery without cloning.

When to Use

  • Analyze repositories without cloning
  • Compare codebases side-by-side
  • Fetch specific files from any repo
  • Find trending repositories and code patterns
  • Search code across GitHub

Quick Operations

Fetch a file remotely

gh api repos/OWNER/REPO/contents/path/file.ts --template '{{.content | base64decode}}'

Get directory listing

gh api repos/OWNER/REPO/contents/PATH

Search code

gh search code "pattern" --language=typescript

Find trending repos

gh search repos --language=rust --sort stars --order desc

Compare Two Codebases

Systematic workflow for comparing repositories to identify similarities and differences.

Example use: "Compare solana-fm/explorer-kit and tenequm/solana-idls"

Step 1: Fetch directory structures

gh api repos/OWNER-A/REPO-A/contents/PATH
gh api repos/OWNER-B/REPO-B/contents/PATH

If comparing a monorepo package, specify the path (e.g., packages/explorerkit-idls).

Step 2: Compare file lists

gh api repos/OWNER-A/REPO-A/contents/PATH -q '.[].name'
gh api repos/OWNER-B/REPO-B/contents/PATH -q '.[].name'

Compare the output of each command to identify files unique to each repo and common files.

Step 3: Fetch key files for comparison

Compare package dependencies:

gh api repos/OWNER-A/REPO-A/contents/package.json --template '{{.content | base64decode}}'
gh api repos/OWNER-B/REPO-B/contents/package.json --template '{{.content | base64decode}}'

Compare main entry points:

gh api repos/OWNER-A/REPO-A/contents/src/index.ts --template '{{.content | base64decode}}'
gh api repos/OWNER-B/REPO-B/contents/src/index.ts --template '{{.content | base64decode}}'

Step 4: Analyze differences

Compare the fetched files to identify:

API Surface

  • What functions/classes are exported?
  • Are the APIs similar or completely different?

Dependencies

  • Shared dependencies (same approach)
  • Different dependencies (different implementation)

Unique Features

  • Features only in repo1
  • Features only in repo2

For detailed comparison strategies, see references/comparison.md.

Discover Trending Content

Find trending repositories

# Most starred repos
gh search repos --sort stars --order desc --limit 20

# Trending in specific language
gh search repos --language=rust --sort stars --order desc

# Recently popular (created in last month)
gh search repos "created:>2024-10-01" --sort stars --order desc

# Trending in specific topic
gh search repos "topic:machine-learning" --sort stars --order desc

Discover popular code patterns

# Find popular implementations
gh search code "function useWallet" --language=typescript --sort indexed

# Find code in popular repos only
gh search code "implementation" "stars:>1000"

# Search specific organization
gh search code "authentication" --owner=anthropics

For complete discovery queries and patterns, see references/discovery.md.

Search Basics

Code search

# Search across all repositories
gh search code "API endpoint" --language=python

# Search in specific organization
gh search code "auth" --owner=anthropics

# Exclude results with negative qualifiers
gh search issues -- "bug report -label:wontfix"

Issue & PR search

# Find open bugs
gh search issues --label=bug --state=open

# Search assigned issues
gh search issues --assignee=@me --state=open

For advanced search syntax, see references/search.md.

Special Syntax

Field name inconsistencies

IMPORTANT: GitHub CLI uses inconsistent field names across commands:

Field gh repo view gh search repos
Stars stargazerCount stargazersCount
Forks forkCount forksCount

Examples:

# ✅ Correct for gh repo view
gh repo view owner/repo --json stargazerCount,forkCount

# ✅ Correct for gh search repos
gh search repos "query" --json stargazersCount,forksCount

Excluding search results

When using negative qualifiers (like -label:bug), use -- to prevent the hyphen from being interpreted as a flag:

gh search issues -- "query -label:bug"

For more syntax gotchas, see references/syntax.md.

Advanced Workflows

For detailed documentation on specific workflows:

Core Workflows:

GitHub Operations:

Setup & Configuration:

Resources

安全使用建议
This SKILL.md is a usable guide for running GitHub CLI (gh) commands, but it does not declare that the gh binary or GitHub credentials are required — those are implied. Before installing or using this skill: - Ensure the gh CLI is present where the agent will run; otherwise the commands will fail. - Be aware that if a GH_TOKEN/GITHUB_TOKEN (or stored gh credentials) exist in the agent environment or system credential store, the agent's gh commands can access private repos and perform API actions. Only provide a token with the minimal, read-only scopes you need (avoid repo:write or admin scopes unless necessary). - Avoid running interactive auth flows (gh auth login) via an automated agent; those can open browsers or store tokens locally. - Review any gh aliases or extensions configured in the environment (gh alias/extension can run shell commands) before allowing the agent to use this skill. - If you want read-only discovery on public repos, consider using a scoped read-only token or run the commands yourself rather than granting agent access. Given the mismatch between declared requirements and the instructions' dependencies on gh and credentials, treat this skill as potentially risky until you confirm the runtime environment and token policies.
功能分析
Type: OpenClaw Skill Name: gh-cli Version: 1.1.1 The gh-cli skill bundle is a comprehensive documentation and instruction set for using the GitHub CLI (gh) within the OpenClaw environment. The SKILL.md file provides clear, legitimate workflows for remote repository analysis, codebase comparison, and discovery of trending projects without cloning. The extensive reference directory (e.g., references/remote-analysis.md, references/search.md, references/syntax.md) contains standard manual pages for the gh tool, including authentication and secret management, which are necessary for the tool's full functionality. No evidence of malicious intent, data exfiltration logic, or prompt injection attacks was found; the bundle's contents are strictly aligned with its stated purpose of providing a robust interface for GitHub operations.
能力评估
Purpose & Capability
The name/description match the instructions: the SKILL.md is a guide to using the GitHub CLI (gh) for remote repo analysis, file fetching, search, and comparisons. That purpose legitimately requires calling gh and interacting with GitHub APIs.
Instruction Scope
Instructions tell the agent to run gh commands (gh api, gh search, gh repo view, etc.) which will make network calls to GitHub and may fetch repository contents. The SKILL.md also documents gh auth/login behavior (including storing tokens in credential stores or files). The instructions do not ask the agent to read unrelated local files, but they do imply use of authentication and credential storage which has side effects.
Install Mechanism
This is an instruction-only skill (no install spec, no code written to disk), which is the lowest-risk install model. However, the runtime relies on an external binary (gh) being present even though none is declared.
Credentials
The skill declares no required env vars or credentials, yet the documentation explicitly references GH_TOKEN/GITHUB_TOKEN, GH_HOST, and gh auth/login flows. If the agent runs these gh commands and an authentication token is present in the environment or credential store, the agent could access private repos or perform actions. The lack of declared required credentials is an inconsistency and increases risk if users assume no credentials are needed.
Persistence & Privilege
always is false and there is no install or code that modifies other skills or system-wide settings. The only persistence risk is that following gh auth instructions can register tokens in system credential stores or files — a side effect of using the gh CLI, not the skill itself.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gh-cli
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gh-cli 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.1
Initial publish of gh-cli
元数据
Slug gh-cli
版本 1.1.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

gh-cli 是什么?

GitHub CLI for remote repository analysis, file fetching, codebase comparison, and discovering trending code/repos. Use when analyzing repos without cloning,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 177 次。

如何安装 gh-cli?

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

gh-cli 是免费的吗?

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

gh-cli 支持哪些平台?

gh-cli 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 gh-cli?

由 Misha Kolesnik(@tenequm)开发并维护,当前版本 v1.1.1。

💬 留言讨论