Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gennaro-tedesco/gh-s
🔎 search github repositories interactively
https://github.com/gennaro-tedesco/gh-s
command-line gh-extension go
Last synced: 6 days ago
JSON representation
🔎 search github repositories interactively
- Host: GitHub
- URL: https://github.com/gennaro-tedesco/gh-s
- Owner: gennaro-tedesco
- License: apache-2.0
- Created: 2022-01-28T11:48:01.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-08T06:29:54.000Z (over 1 year ago)
- Last Synced: 2025-01-02T23:58:35.472Z (10 days ago)
- Topics: command-line, gh-extension, go
- Language: Go
- Homepage:
- Size: 2.11 MB
- Stars: 346
- Watchers: 4
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gh-cli-extensions - **s** - Search GitHub repositories interactively from the command line. (Tool)
- jimsghstars - gennaro-tedesco/gh-s - 🔎 search github repositories interactively (Go)
README
search github repositories interactively
Installation •
Usage •
FeedbackSearch GitHub repositories interactively from the command line. Start the prompt and browse the results! The name of that repository 🤔? Written in rust, a list of awesome projects...
...well say no more:
```
gh s -l rust -d list
```## Installation
```
gh extension install gennaro-tedesco/gh-s
```
This being a `gh` extension, you of course need [gh cli](https://github.com/cli/cli) as prerequisite.## Usage
Get started!
```
gh s
```![demo](https://user-images.githubusercontent.com/15387611/151630538-07574523-662a-4e74-b117-4afec38794ad.gif)
...or do you prefer a [full YouTube video](https://www.youtube.com/watch?v=JbG_mLsbw24) on the topic?
Without any argument (or with flags only) `gh s` starts a prompt to insert the search query; after the search a list of results is shown. Navigate the list to show details, stars counts, URL and more. If instead you want to do all in one line
```
gh s [search] [flag]
```
takes one of the following arguments or flags| flags | description | multiple | example |
| :------------ | :----------------------------------------------- | :-------- | :--------------------------- |
| -E, --empty | do not prompt for name, search by flags only | no | gh s -E -l go -l rust |
| -l, --lang | narrow down the search to a specific language | yes (OR) | gh s prompt -l go -l lua |
| -d, --desc | search for keyword in the repository description | no | gh s neovim -d plugin |
| -u, --user | restrict the search to a specific user | no | gh s lsp -u neovim |
| -t, --topic | narrow down the search to specific topics | yes (AND) | gh s lsp -t plugin -t neovim |
| -c, --colour | change colour of the prompt | no | gh s nvim -c magenta |
| -L, --limit | limit the number of results (default 20) | no | gh s nvim -L 3 |
| -h, --help | show the help page | no | gh s -h |
| -V, --version | print the current version | no | gh s -V |The prompt accepts the following navigation commands:
| key | description |
| :------------- | :---------------------------------------- |
| arrow keys | browse results list |
| `/` | toggle search in results list |
| `enter ()` | print selected repository URL to `stdout` |### Search by topic or language only
`gh-s` allows to skip prompting for a repository name by passing the `-E` flag; this in turn implies that the query searches against all possible GitHub repositories, which may result in longer response times. Notice furthermore that `-E` must always be accompanied by at least another non-empty flag. Use with care, however it does allow for some interesting statistics or general curiosity: check the [Wiki](https://github.com/gennaro-tedesco/gh-s/wiki/Common-queries)!### Execute commands
`gh-s` must be intended as a filter prompt returning the URL of the selection; as such, the best and most flexible way to execute commands with the results is to pipe it into and from `stdin/stdout`. Have a look at the [Wiki](https://github.com/gennaro-tedesco/gh-s/wiki/Execute-commands) for some common examples!## Feedback
If you find this application useful consider awarding it a ⭐, it is a great way to give feedback! Otherwise, any additional suggestions or merge request is warmly welcome!See also the complete family of extensions
- [gh-i](https://github.com/gennaro-tedesco/gh-i) to search for github issues with interactive prompt
- [gh-f](https://github.com/gennaro-tedesco/gh-f) to snap around your git worfklow with `fzf`