gh-search-docs

command module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 12 Imported by: 0

README

Search (GitHub) Docs CLI

Test and Lint

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

Documentation

Overview

Command gh-search-docs is a GitHub CLI extension that searches the GitHub documentation using the provided docs.github.com Search API.

Build / install:

gh extension install <your-username>/gh-search-docs

Usage:

gh search-docs [flags] <query>

Flags:

--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: title, content, content_explicit, term
--include              additional includes: intro, headings, toplevel
--include-matched-content include matched content highlights
--toplevel             toplevel filter
--aggregate            aggregate options
--debug                show raw JSON response from the API
--format               output format: pretty (default), plain, json
--plain                disable pretty rendering (use plain text output)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL