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.
What this skill does
# 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 api repos/OWNER/REPO/contents/path/file.ts --template '{{.content | base64decode}}'
```
### Get directory listing
```bash
gh api repos/OWNER/REPO/contents/PATH
```
### Search code
```bash
gh search code "pattern" --language=typescript
```
### Find trending repos
```bash
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
```bash
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
```bash
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:
```bash
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:
```bash
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](references/comparison.md).
## Discover Trending Content
### Find trending repositories
```bash
# 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
```bash
# 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](references/discovery.md).
## Search Basics
### Code search
```bash
# 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
```bash
# 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](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:**
```bash
# ✅ 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:
```bash
gh search issues -- "query -label:bug"
```
For more syntax gotchas, see [references/syntax.md](references/syntax.md).
## Advanced Workflows
For detailed documentation on specific workflows:
**Core Workflows:**
- [remote-analysis.md](references/remote-analysis.md) - Advanced file fetching patterns
- [comparison.md](references/comparison.md) - Complete codebase comparison guide
- [discovery.md](references/discovery.md) - All trending and discovery queries
- [search.md](references/search.md) - Advanced search syntax
- [syntax.md](references/syntax.md) - Special syntax and command quirks
**GitHub Operations:**
- [repositories.md](references/repositories.md) - Repository operations
- [pull_requests.md](references/pull_requests.md) - PR workflows
- [issues.md](references/issues.md) - Issue management
- [actions.md](references/actions.md) - GitHub Actions
- [releases.md](references/releases.md) - Release management
**Setup & Configuration:**
- [getting_started.md](references/getting_started.md) - Installation and auth
- [other.md](references/other.md) - Environment variables, aliases, config
- [extensions.md](references/extensions.md) - CLI extensions
## Resources
- Official docs: https://cli.github.com/manual/
- GitHub CLI: https://github.com/cli/cli
- Search syntax: https://docs.github.com/en/search-github
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.