https://github.com/mohabdo21/gh-search
Searches GitHub issues and discussions
https://github.com/mohabdo21/gh-search
discussions gh github issues json query search
Last synced: 2 days ago
JSON representation
Searches GitHub issues and discussions
- Host: GitHub
- URL: https://github.com/mohabdo21/gh-search
- Owner: Mohabdo21
- License: mit
- Created: 2026-05-12T10:01:28.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-12T11:19:47.000Z (about 1 month ago)
- Last Synced: 2026-05-12T12:14:15.146Z (about 1 month ago)
- Topics: discussions, gh, github, issues, json, query, search
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-search
`gh-search` searches GitHub issues and discussions in one repository.
Input is a repository URL and a query string. Output is either a table for humans or JSON for scripts.
It uses the same auth setup as `gh`. If `gh auth login` works, this works. `GH_TOKEN` works too.
## Install
```bash
go install ./cmd/gh-search
```
## Usage
```bash
gh-search (--query|-q) [(--state|-s) open|closed|all] [(--type|-t) issue|discussion|all] [--limit N] [--sort relevance|created|created-asc|created-desc|updated|updated-asc|updated-desc] [--json] [--plain-links]
```
## Flags
- `--query`, `-q`: required.
- `--state`, `-s`: filter by state. Default: `all`.
- `--type`, `-t`: search `issue`, `discussion`, or `all`. Default: `all`.
- `--limit`: max results per selected result type. `0` means no client-side cap.
- `--sort`: `relevance`, `created`, `created-asc`, `created-desc`, `updated`, `updated-asc`, or `updated-desc`.
- `--json`: print JSON.
- `--plain-links`: disable terminal hyperlinks and print a plain `Direct Links` section.
## Examples
```bash
gh-search https://github.com/moby/moby --query "container exit code" --state all
gh-search https://github.com/kubernetes/kubernetes -q "pod pending" -t discussion
gh-search https://github.com/kubernetes/kubernetes --query "pod pending" --type discussion
gh-search https://github.com/cli/cli --query "extension" --type issue --limit 5 --sort created-asc
gh-search https://github.com/cli/go-gh --query "graphql client" --json --type issue --limit 3
gh-search https://github.com/hyprwm/Hyprland --query "GPU Reset" --state open --limit 4 --plain-links
```
## Notes
- Issues and discussions are queried separately.
- `--limit` applies per selected result type.
- Pagination is automatic.
- Short flags exist only for the common filters: `-q`, `-s`, and `-t`.
- Table output uses terminal hyperlinks when possible.
- Piped output falls back to plain URLs.
- GitHub search limits still apply.