agentCLAWHUBUnverified

gh-cli

GitHub CLI for remote repository analysis, file fetching, codebase comparison, and discovering trending code/repos. Use when analyzing repos without cloning, comparing codebases, or searching for popular GitHub projects.

OpenClaw

Rank

62

Safety

84

Downloads

2.3k

Updated

Oct 9, 2026

Version

1.4.0

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 2.3K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Oct 9, 2026
Protocol compatibility
OpenClawcompatibility · observed Oct 9, 2026
Adoption signal
2.3K downloadsadoption · observed Oct 9, 2026
Latest release
1.4.0release · observed Sep 22, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install s17bp3v1hm1dnkzey0c9tfh02183j0y5:gh-cli
  1. Install using `clawhub skill install s17bp3v1hm1dnkzey0c9tfh02183j0y5:gh-cli` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/tenequm/gh-cli before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-tenequm-gh-cli/snapshot"

Documentation

CLAWHUB

148,098 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: gh-cli
description: GitHub CLI for remote repository analysis, file fetching, codebase comparison, and discovering trending code/repos. Use when analyzing repos without cloning, comparing codebases, or searching for popular GitHub projects.
metadata:
  version: "1.4.0"
  categories: "development, integrations"
  topics: "github, gh-cli, code-search, repo-analysis, pull-requests"
  upstream: "[email protected]"
  openclaw:
    homepage: https://github.com/tenequm/skills/tree/main/skills/gh-cli
    emoji: "🐙"
    primaryEnv: GH_TOKEN
    requires:
      bins:
        - gh
    install:
      - kind: brew
        formula: gh
        bins:
          - gh
    envVars:
      - name: GH_TOKEN
        required: false
        description: GitHub auth token used by gh CLI.
      - name: GITHUB_TOKEN
        required: false
        description: Alias for GH_TOKEN.
      - name: GH_HOST
        required: false
        description: GitHub Enterprise host override.
---

# 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

```bash
gh repo read-file path/file.ts --repo OWNER/REPO
```

`gh repo read-file` (preview) is the preferred path: it prints raw content, takes `--ref` for any branch/tag/commit, and handles large files. `--output PATH` writes to disk (`--clobber` to overwrite); `--json` returns metadata (`content, downloadUrl, encoding, gitSHA, gitUrl, htmlUrl, name, path, size, type, url`). Fall back to `gh api` where the command is unavailable:

```bash
gh api repos/OWNER/REPO/contents/path/file.ts -H "Accept: application/vnd.github.raw"
```

There is **no `base64decode` template function** - `--template '{{.content | base64decode}}'` fails with `function "base64decode" not defined`. To decode the default JSON response, pipe it:

```bash
gh api repos/OWNER/REPO/contents/path/file.ts --jq '.content' | base64 -d
```

The Contents API inlines only files up to **1MB**. Past that, `.content` is an empty string (`encoding: "none"`) and the pipe above silently prints nothing - use `read-file` or the raw `Accept` header instead.

### Terminal escape sequences (gh 2.97.0+)

`gh` refuses to print remote content containing terminal escape sequences (ANSI art, some test fixtures) instead of passing it to your terminal:

- `gh repo read-file`: `file contains terminal escape sequences; use --allow-escape-sequences to read anyway`
- `gh api` raw bodies: `the response contains terminal escape sequences; pass --allow-escape-sequences to output it anyway`
- `gh pr diff` when piped: `the diff contains terminal escape sequences; pass --allow-escape-sequences to output it anyway`

Pass `--allow-escape-sequences` (also on `gh release download --output -

_meta.json

{
  "ownerId": "kn76gpsgjw5chv0xvzbzcb8cxn81x46r",
  "slug": "gh-cli",
  "version": "1.4.0",
  "publishedAt": 1790116616999
}

references/actions.md

# Gh-Cli - Actions

**Pages:** 15

---

## gh workflow run

**URL:** https://cli.github.com/manual/gh_workflow_run

**Contents:**
- gh workflow run
  - Options
  - Options inherited from parent commands
  - Examples
  - See also

Create a workflow_dispatch event for a given workflow.

This command will trigger GitHub Actions to run a given workflow file. The given workflow file must support an on.workflow_dispatch trigger in order to be run in this way.

If the workflow file supports inputs, they can be specified in a few ways:

**Examples:**

Example 1 (unknown):
```unknown
gh workflow run [<workflow-id> | <workflow-name>] [flags]
```

Example 2 (bash):
```bash
# Have gh prompt you for what workflow you'd like to run and interactively collect inputs
$ gh workflow run

# Run the workflow file 'triage.yml' at the remote's default branch
$ gh workflow run triage.yml

# Run the workflow file 'triage.yml' at a specified ref
$ gh workflow run triage.yml --ref my-branch

# Run the workflow file 'triage.yml' with command line inputs
$ gh workflow run triage.yml -f name=scully -f greeting=hello

# Run the workflow file 'triage.yml' with JSON via standard input
$ echo '{"name":"scully", "greeting":"hello"}' | gh workflow run triage.yml --json
```

---

## gh run view

**URL:** https://cli.github.com/manual/gh_run_view

**Contents:**
- gh run view
  - Options
  - Options inherited from parent commands
  - JSON Fields
  - Examples
  - See also

View a summary of a workflow run.

Due to platform limitations, gh may not always be able to associate jobs with their corresponding logs when using the primary method of fetching logs in zip format.

In such cases, gh will attempt to fetch logs for each job individually via the API. This fallback is slower and more resource-intensive. If more than 25 job logs are missing, the operation will fail with an error.

Additionally, due to similar platform constraints, some log lines may not be associated with a specific step within a job. In these cases, the step name will appear as UNKNOWN STEP in the log output.

attempt, conclusion, createdAt, databaseId, displayTitle, event, headBranch, headSha, jobs, name, number, startedAt, status, updatedAt, url, workflowDatabaseId, workflowName

**Examples:**

Example 1 (unknown):
```unknown
gh run view [<run-id>] [flags]
```

Example 2 (bash):
```bash
# Interactively select a run to view, optionally selecting a single job
$ gh run view

# View a specific run
$ gh run view 12345

# View a specific run with specific attempt number
$ gh run view 12345 --attempt 3

# View a specific job within a run
$ gh run view --job 456789

# View the full log for a specific job
$ gh run view --log --job 456789

# Exit non-zero if a run failed
$ gh run view 0451 --exit-status && echo "run pending or passed"
```

---

## gh workflow enable

**URL:** https://cli.github.com/manual/gh_workflow_enable

**Contents:**
- gh workflow enable
  - Options inherited from parent commands
  - See also

Enable a w

references/comparison.md

# Compare Two Codebases

Systematic workflow for comparing repositories to identify similarities, differences, and unique features.

## When to Use

- "Are repo-a and repo-b providing the same functionality?"
- "What's different between these two implementations?"
- "Which repo has more features?"
- "Can I replace library X with library Y?"

## 4-Step Comparison Workflow

### Step 1: Fetch directory structures

```bash
gh repo read-dir PATH --repo OWNER-A/REPO-A --json name,type > repo1.json
gh repo read-dir PATH --repo OWNER-B/REPO-B --json name,type > repo2.json
```

If comparing a monorepo package, specify the path (e.g., `packages/explorerkit-idls`). Omit `PATH` to list the repo root.

### Step 2: Compare file lists

`read-dir --json` wraps the listing in `{"entries":[...]}`:

```bash
jq -r '.entries[].name' repo1.json | sort > repo1-files.txt
jq -r '.entries[].name' repo2.json | sort > repo2-files.txt
diff repo1-files.txt repo2-files.txt
```

This shows:
- Files unique to repo1 (prefixed with `<`)
- Files unique to repo2 (prefixed with `>`)

For whole-repo comparisons, list every file in one request per repo:

```bash
gh api 'repos/OWNER-A/REPO-A/git/trees/HEAD?recursive=1' --jq '.tree[] | select(.type == "blob") | .path' | sort > repo1-files.txt
gh api 'repos/OWNER-B/REPO-B/git/trees/HEAD?recursive=1' --jq '.tree[] | select(.type == "blob") | .path' | sort > repo2-files.txt
comm -3 repo1-files.txt repo2-files.txt
```

Use `HEAD`, not a hardcoded `main` - repos with another default branch return 404.

### Step 3: Fetch key files for comparison

Compare the most important files:

#### Package dependencies

```bash
gh repo read-file package.json --repo OWNER-A/REPO-A > repo1-pkg.json
gh repo read-file package.json --repo OWNER-B/REPO-B > repo2-pkg.json
```

Then compare dependencies:

```bash
diff <(jq -S '{dependencies, peerDependencies}' repo1-pkg.json) <(jq -S '{dependencies, peerDependencies}' repo2-pkg.json)
```

#### Main entry points

```bash
gh repo read-file src/index.ts --repo OWNER-A/REPO-A > repo1-index.ts
gh repo read-file src/index.ts --repo OWNER-B/REPO-B > repo2-index.ts
```

`gh repo read-file` handles files past the Contents API's 1MB inline limit; the older `gh api .../contents/FILE --jq '.content' | base64 -d` pattern silently prints nothing for them.

### Step 4: Analyze differences

Compare the fetched files to identify:

**API Surface**
- What functions/classes are exported?
- Are the APIs similar or completely different?
- Which repo has more comprehensive exports?

**Dependencies**
- Shared dependencies (same approach)
- Different dependencies (different implementation)
- Dependency versions (maintenance status)

**Unique Features**
- Features only in repo1
- Features only in repo2
- Similar features with different implementations

## Comparing Versions of the Same Repo

When both sides live in one repository network (tags, branches, or a fork), the compare API does the diff server-side:

```bash
# Commit and file summ

references/discovery.md

# Discovering Trending Content

Complete guide to finding popular repositories, code patterns, and active projects on GitHub.

## Find Trending Repositories

`gh search repos` needs a query or a qualifier flag (`--language`, `--topic`, `--owner`, ...). A bare `gh search repos --sort stars` fails with `Invalid search query ""`.

The date examples below use a computed cutoff so they never go stale. Set it once per shell (BSD and GNU `date` both work):

```bash
SINCE=$(date -v-30d +%F 2>/dev/null || date -d '30 days ago' +%F)
```

### By popularity

```bash
# Most starred repositories (all time)
gh search repos "stars:>10000" --sort stars --order desc --limit 20

# Most forked repos
gh search repos "forks:>5000" --sort forks --order desc

# Most help-wanted issues (NOT a watchers sort - there is none)
gh search repos "help-wanted-issues:>10" --sort help-wanted-issues --order desc
```

`gh search repos --sort` accepts only `{forks|help-wanted-issues|stars|updated}`. Watcher counts are available per-repo via `gh repo view OWNER/REPO --json watchers`, but you cannot sort search results by them - and `gh search repos --json watchersCount` is actually the star count.

### By language

```bash
# Trending repos in specific language
gh search repos --language=rust --sort stars --order desc
gh search repos --language=typescript --sort stars --order desc
gh search repos --language=python --sort stars --order desc
```

### By recency

```bash
# Recently popular (created in the last 30 days, sorted by stars)
gh search repos "created:>$SINCE" --sort stars --order desc

# Created this year
gh search repos "created:>$(date +%Y)-01-01" --sort stars --order desc

# Recently updated popular repos
gh search repos "stars:>100" "pushed:>$SINCE" --sort updated --order desc
```

### By topic

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

# Multiple topics (AND)
gh search repos topic:blockchain topic:typescript --sort stars --order desc
```

### By activity

```bash
# Most active popular repos (by recent updates)
gh search repos "stars:>1000" --sort updated --order desc

# Active repos (pushed in the last 30 days)
gh search repos "pushed:>$SINCE" --sort stars

# Repos with many open issues (active community)
gh search repos "good-first-issues:>5" --sort stars --order desc
```

## Advanced Discovery Queries

### Unique projects

```bash
# Repos with many stars but few forks (unique ideas)
gh search repos "stars:>1000" "forks:<100"

# High star-to-fork ratio (original content)
gh search repos "stars:>500" "forks:<50"
```

### By file presence

Use `--filename`, `--extension`, and `--match` to scope. Code search has no sorting flags. When the match is on the file name or path rather than its contents, piped output (every script and agent) prints **nothing** - the plain format only shows matched text lin
Github ReposUpdated 6h agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/tenequm/skills/gh-cli",
      "sourceUrl": "https://clawhub.ai/tenequm/skills/gh-cli",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T16:48:51.262Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-tenequm-gh-cli/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-tenequm-gh-cli/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-10-09T16:48:51.262Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "2.3K downloads",
      "href": "https://clawhub.ai/tenequm/gh-cli",
      "sourceUrl": "https://clawhub.ai/tenequm/gh-cli",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T16:48:51.262Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "1.4.0",
      "href": "https://clawhub.ai/tenequm/gh-cli",
      "sourceUrl": "https://clawhub.ai/tenequm/gh-cli",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-09-22T22:36:56.999Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-tenequm-gh-cli/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-tenequm-gh-cli/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 1.4.0",
      "description": "Updated gh-cli from 1.3.3 to 1.4.0. Changes: - modified `CHANGELOG.md` - modified `SKILL.md` - modified `references/actions.md` - modified `references/comparison.md` - modified `references/discovery.md` - modified `references/issues.md` - modified `references/other.md` - modified `references/pull_requests.md` - modified `references/releases.md` - modified `references/remote-analysis.md` - modified `references/repositories.md` - modified `references/search.md`",
      "href": "https://clawhub.ai/tenequm/gh-cli",
      "sourceUrl": "https://clawhub.ai/tenequm/gh-cli",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-09-22T22:36:56.999Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 10, 2026.

Sponsored

Ads related to gh-cli and adjacent AI workflows.