gh-search
Use when searching GitHub via CLI for issues, PRs, repos, code, or commits - provides correct syntax for exclusions, qualifiers, quoting, and platform-specific handling to avoid command failures
What this skill does
# GitHub CLI Search ## Overview Search GitHub from the command line using `gh search` subcommands. The key principle: **Always use `--` before queries with exclusions** to prevent shell interpretation of `-` prefixes. ## When to Use Use this skill when: - Searching GitHub via `gh` CLI for issues, PRs, repos, code, or commits - User requests searches with exclusions (NOT, minus prefix) - Constructing complex queries with multiple qualifiers - Queries contain spaces or special characters ## Subcommands Quick Reference | Subcommand | Use For | Common Flags | |------------|---------|--------------| | `gh search issues` | Issues (add `--include-prs` for PRs too) | `--label`, `--state`, `--author`, `--assignee` | | `gh search prs` | Pull requests only | `--label`, `--state`, `--author`, `--draft`, `--merged` | | `gh search repos` | Repositories | `--language`, `--stars`, `--topic`, `--owner` | | `gh search code` | Code within files | `--repo`, `--language`, `--filename` | | `gh search commits` | Commit messages | `--repo`, `--author`, `--committer` | ## Critical Syntax Rules ### 1. Exclusions Require `--` Flag **Unix/Linux/Mac:** ```bash gh search issues -- "bug -label:duplicate" ``` **PowerShell:** ```powershell gh --% search issues -- "bug -label:duplicate" ``` **Why:** The `-` prefix gets interpreted as a command flag without `--`. PowerShell needs `--% ` to stop parsing. ### 2. Quoting Rules **Multi-word queries need quotes:** ```bash gh search issues "memory leak" ``` **Entire query with spaces should be quoted:** ```bash gh search issues "bug label:urgent created:>2024-01-01" ``` **Qualifier values with spaces need inner quotes:** ```bash gh search prs -- 'security label:"bug fix"' ``` ### 3. Qualifier Syntax **Inline qualifiers** (use within search query): ```bash gh search repos "react stars:>1000 language:typescript" ``` **Flag-based** (use as separate flags): ```bash gh search repos "react" --language typescript --stars ">1000" ``` **Can mix both:** ```bash gh search issues "crash" --label bug created:>2024-01-01 ``` ## Common Qualifiers ### Comparison Operators - `>`, `>=`, `<`, `<=` - Numeric: `stars:>100`, `comments:>=5` - `..` - Ranges: `stars:10..50`, `created:2024-01-01..2024-12-31` ### Special Values - `@me` - Current user: `author:@me`, `assignee:@me`, `owner:@me` - Dates use ISO8601: `created:>2024-01-01` or `created:2024-01-01..2024-12-31` ### Field-Specific Search - `in:title` - Search in title only - `in:body` - Search in body only - `in:comments` - Search in comments only ### Exclusions - `-qualifier:value` - Exclude: `-label:bug`, `-language:javascript` - `NOT` keyword - For words only: `"hello NOT world"` ## Examples **Find your open issues without bug label:** ```bash gh search issues -- "is:open author:@me -label:bug" ``` **Find popular Python ML repos updated recently:** ```bash gh search repos "machine learning" --language python --stars ">1000" --updated ">2024-01-01" ``` **Find PRs with specific label and text:** ```bash gh search prs -- 'security label:"bug fix" created:>2024-01-01' ``` **Search code in organization repos:** ```bash gh search code "TODO" --owner myorg --language javascript ``` ## Common Mistakes | Mistake | Problem | Fix | |---------|---------|-----| | `gh search issues -label:bug` | `-label` interpreted as flag | Add `--`: `gh search issues -- "-label:bug"` | | `gh search repos machine learning` | Searches "machine" OR "learning" | Quote it: `"machine learning"` | | `in:title` outside quotes | Shell interprets `:` oddly | Include in query: `"crash in:title"` | | Mixing `@` with value | Invalid syntax | Use `@me` or username, not both: `author:@me` ✓, `author:@username` ✗ (drop @) | | PowerShell without `--%` | Parsing breaks with exclusions | Add `gh --%` before command | ## Output Options All subcommands support: - `--limit <n>` - Max results (default: 30, max: 1000) - `--json <fields>` - JSON output for scripting - `--web` - Open results in browser - `--sort <field>` - Sort by: comments, created, reactions, updated, stars, etc. - `--order asc|desc` - Sort direction (default: desc) ## Real-World Impact Correct syntax prevents: - Command failures from misinterpreted flags - Missing results from incorrect exclusions - Errors from unquoted spaces - Platform-specific parsing issues
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.