Skip to content

Command line utility to search github.com's v3 API with more functionalities planned.

License

Notifications You must be signed in to change notification settings

rlaneyjr/github_cli

Repository files navigation

Command line tools to search github.com's v3 API

Installation

Just use pip like so:

pip install github_cli

Or clone the repo and add your twist:

git clone https://github.com/rlaneyjr/github_cli.git

Quick Run-down:

After installation, you will have two new commands "gh_find" and "gh_list". Use these two commands perform advanced queries on the Github v3 API. I wrote this simple script because got tired of typing curl commands that kept getting longer. Plus I could never remember how to stucture the URLs.

Example using curl:

curl https://api.github.com/search/repositories?q=tetris+language:assembly&sort=stars&order=desc

Command gh_find Usage:

gh_find [SEARCH_TYPE] [OPTIONS] QUERY

Search github.com for 'repo', 'user', or 'topic' using Github's v3 API query.

SEARCH_TYPE: repo - Find repositories via various criteria (100 results per page max). topic - Find topics via various criteria (100 results per page max). user - Find users via various criteria (100 results per page max).

OPTIONS: -l --long By default 'gh_find' will return a short list of repo names along with date created and date updated. Use this option to return more repo details. -s --sort Sort by stars, forks, help-wanted-issues, or updated. (Optional default=best-match) -o --order Order-by desc or asc. (Optional default=desc) -c --count Number of items to return. (Optional default=100)

QUERY: Type: Github API v3 query Format: 'SEARCH_KEYWORD_1+SEARCH_KEYWORD_N+QUALIFIER_1+QUALIFIER_N' Examples: 'GitHub+Octocat+in:readme+user:defunkt' or 'tetris+language:assembly' Details: 'https://developer.github.com/v3/search/#constructing-a-search-query'

Command gh_list Usage:

gh_list [OPTIONS] USER

List public repositories for the specified user.

OPTIONS: -l --long By default 'gh_list' will return a short list of repo names along with date created and date updated. Use this option to return more repo details. -s --sort Sort by stars, forks, help-wanted-issues, or updated. (Optional default=best-match) -c --count Number of items to return. (Optional default=100)

USER: Github username or email address.

Default fields returned: 'name' 'description' 'created_at' 'updated_at'

Long option fields returned: 'name' 'description' 'html_url' 'clone_url' 'language' 'fork' 'size' 'stargazers_count' 'watchers_count' 'open_issues_count' 'forks' 'created_at' 'updated_at'

Sort options: 'stars' 'forks' 'help-wanted-issues' 'updated' 'best-match'

About

Command line utility to search github.com's v3 API with more functionalities planned.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published