Search (GitHub) Docs CLI

A CLI Extension for the GitHub CLI that lets you search the GitHub documentation using the official GitHub documentation search API.
Search results are returned from the search API provided by docs.github.com.

Installation
Install this extension using the GitHub CLI:
gh extension install ebonsignori/gh-search-docs
Prerequisites
You'll need the GitHub CLI installed first:
Usage
gh search-docs [flags] <query>
Examples
Search for documentation:
gh search-docs "pull request"
Search with specific parameters:
gh search-docs --size 5 --highlights title,content "GitHub Actions"
Search Enterprise Server documentation:
gh search-docs --version enterprise-server@3.17 "SAML configuration"
Get results in plain text format:
gh search-docs --plain "API authentication"
Get results in JSON format:
gh search-docs --format json "API authentication"
Search with additional includes:
gh search-docs --include intro,headings "webhook events"
Paginate through results:
gh search-docs --page 2 --size 20 "Git workflow"
Flags
| Flag |
Description |
--query |
Search query (can also be provided as positional argument) |
--size |
Number of results to return (max: 50, default: 5) |
--version |
Docs version (free-pro-team, enterprise-cloud, or enterprise-server@<3.13-3.17>) |
--language |
Language code (default: en) |
--page |
Page number for pagination |
--sort |
Sort order |
--highlights |
Highlight options (can be used multiple times): title, content, content_explicit, term |
--include |
Additional includes (can be used multiple times): intro, headings, toplevel |
--toplevel |
Toplevel filter (can be used multiple times) |
--aggregate |
Aggregate options (can be used multiple times) |
--debug |
Show raw JSON response from the API |
--format |
Output format: pretty (default), plain, json |
--plain |
Disable pretty rendering (use plain text output) |
--list-versions |
List supported GitHub Enterprise Server versions |
More examples
Finding specific topics:
gh search-docs "repository settings"
gh search-docs "branch protection rules"
gh search-docs "GitHub Apps authentication"
Enterprise-specific searches:
gh search-docs --version enterprise-server@3.17 "LDAP configuration"
gh search-docs --version enterprise-cloud "SAML SSO"
Detailed searches with highlights:
gh search-docs --highlights title,content --include intro,headings "webhook payload"
Paginated browsing:
gh search-docs --size 5 "API" --page 1
gh search-docs --size 5 "API" --page 2
Development
Please see development docs.
License
MIT