A CLI tool for searching GitHub from the terminal.
Stig is a CLI tool for searching GitHub from the terminal. With the ability to sort and filter results, Stig makes it easy to find what you're looking for. Stig can also print out a repositories README.md to stdout, so you can quickly learn more about a project.
- search GitHub from the terminal
- use flags and options to filter the results
- print the readme of a specified repo to stdout
A typical search result item will look like the following:
- owner | - repo | | - stars | | | - forks | | | | - issues | | | | | - language | | | | | | - last updated | | | | | | | - summary | | | | | | | | octobanana/stig *12 <3 !4 [C++] 5h A CLI tool for searching GitHub from the terminal.
A forked repository will show a
> symbol, instead of the default
The last updated symbols are mapped to the following:
s : seconds m : minutes h : hours D : days W : weeks M : months Y : years
At the end of the results, a summary will be shown:
- current results | - total results | | - current page | | | - total pages | | | | - requests remaining | | | | | - requests limit | | | | | | 1-5/81 results | 1/17 pages | 9/10 limit
By default, the GitHub API allows up to 10 search queries per minute.
To extend the limit to 30 search queries per minute, you can pass a GitHub token with the
For more information regarding creating a new personal access token, refer to the following GitHub help article.
GitHub Enterprise Compatibility
It is possible to use a custom API endpoint for compatibility with GitHub
Enterprise installations using the
--host option. The host should be
subdomain.domain.tld. It's expected that the endpoint is served over HTTPS on port 443.
A terminal emulator that supports ansi escape codes and true color
is required when colored output is enabled.
The majority of the popular terminal emulators should support both.
While having the colored output enabled provides the best experience,
it can be adjusted using the
auto as inputs, with auto being the default value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# query 'stig' showing '20' results from page '1' $ stig --query 'stig' --number 20 --page 1 # query 'stig' with filter 'language:cpp' $ stig --query 'stig' --filter 'language:cpp' # query 'stig' and pipe into less $ stig --query 'stig' | less # query 'all' sorted by 'stars' with filter 'language:js' $ stig --query '' --sort 'stars' --filter 'language:js' # query 'http server' with filters 'language:cpp' and 'stars:>10' $ stig --query 'http server' --filter 'language:cpp stars:>10' # output the README.md for 'octobanana/stig' on default branch $ stig --readme 'octobanana/stig' # output the README.md for 'octobanana/stig' on branch 'master' $ stig --readme 'octobanana/stig/master' # output the README.md for 'octobanana/stig' on default branch and pipe into less $ stig --readme 'octobanana/stig' | less # output the program help $ stig --help # output the program version $ stig --version
- Linux (supported)
- BSD (untested)
- macOS (untested)
- C++17 compiler
- Boost >= 1.67
- OpenSSL >= 1.1.0
- CMake >= 3.8
- ssl (libssl)
- crypto (libcrypto)
- pthread (libpthread)
- boost (libboost_system)
- my belle library, for making HTTPS requests, included as
- my parg library, for parsing CLI args, included as
- nlohmann's json library, for working with JSON, included as
The following shell command will build the project in release mode:
To build in debug mode, run the script with the
The following shell command will install the project in release mode:
To install in debug mode, run the script with the
This project is licensed under the MIT License.
Copyright (c) 2018 Brett Robinson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.