Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

✨ Browse trending GitHub projects from your command line

License

NotificationsYou must be signed in to change notification settings

hedyhli/starcli

Repository files navigation

  ___  ______    _     ____     ____   _     _ / \ *   | |    /\    | |  \   / |  * | \   | \ \  \    | |   /\ \   | |* /  |  |    | |   | |  \  \   | |  /--\ \  | | \   |  |    | |   | | *_\./   ._| /    ._\ |_|  \_  \.|__. |_|_. |_|

Browse trending projects on Github from your command line$ _

checkspypi versionpypi downloads per monthPython RequirementsCode style: blackGitHub license MIT


starcli demo.gif

Features

  • Filters
    • Stars
    • Pushed date
    • Created date
    • User
    • Topic
    • Language
    • Spoken language
  • Use generic GitHub search API or GitHub trending
  • Auth token (optional)
  • Paged output
  • Different layouts

Prerequisites

  • Requires Python 3.6 or greater

Installation

pip3 install starcli

Usage

Usage: starcli [OPTIONS]  Search and query GitHub repositoriesOptions:  -l, --lang TEXT                 Language filter eg: python. (can be used                                  multiple times)  -S, --spoken-language TEXT      Spoken Language filter eg: en for English,                                  zh for Chinese  -c, --created TEXT              Specify repo creation date in YYYY-MM-DD,                                  use >date, <=date etc to be more specific.  -t, --topic TEXT                Date of last push in YYYY-MM-DD (>, <, >=,                                  <= specifiers supported)  -p, --pushed TEXT               Specify date of last push in YYYY-MM-DD, >=<                                  allowed  -L, --layout [list|table|grid]  The output format (list, table, or grid),                                  default is list  -s, --stars TEXT                Number of stars, default is '>=100'. eg:                                  '>0', '123', '<50000  -n, --num-results INTEGER       The number of items in the results. Default:                                  7  -o, --order [desc|asc]          Order of repos by stars, 'desc' or 'asc',                                  default: desc  --long-stats                    Print the actual stats number (1300 instead                                  of 1.3k)  -d, --date-range [day|week|month]                                  View stars received within time, choose                                  from: day, week, month. Uses GitHub trending                                  for fetching results, hence some other                                  filter options may not work.  -u, --user TEXT                 Filter for trending repositories by username  --auth TEXT                     Optionally use GitHub personal access token                                  in the format 'username:password'.  -P, --pager                     Use $PAGER to page output. (put -r in $LESS                                  to enable ANSI styles)  --debug                         Turn on debugging mode  --help                          Show this message and exit.

Layouts

Switch layouts using--layout {list|table|grid}, or use the short option-L

list

demo list

table

grid

demo grid

All three of the layout options support clickable links for repository names. Ifyour terminal supports links, you can directly click on the name and it willtake you to the GitHub repository in your browser.

Filtering by language

For example, you only want to find popular Python repos: using--lang or-l:

starcli --lang python

Here's another examplestarcli -l python -L grid, which is python with gridlayout:

demo grid

Filtering by spoken language

If you wanted to find repos in your native language, you can use--spoken-language or-S:

starcli --spoken-language zh

The above command lists down repos written in Chinese.

A full list of language codes is availablehere

Note that (as with--date-range) options like--topics,--pushed,--created won't take effect because-d uses a different search mechanism tofind results.

Specify the number (or range) of stars

(Recommended to be used with--created)

The default range is >=100 stars.

Use--stars or-s to specify what you want, for example, if you want to findrepos that has more than 100 stars, you can use:

starcli -s '>100'

Note that if you do something like>1000 not many repos can have more than1000 and is created within around 200 days (which is the default for--created), to specify date of creation, use--created, see below.

Filter by stars daily, weekly or monthly

You can view the number of stars a repo received today, this week or this monthby using the--date-range or-d option:

starcli -d this-week -L table

This command will also display the number of stars received for each repo thisweek in the form of a table.

-d uses GitHub Trending search for repositories, hence options--topic,--pushed,--created won't take effect.

Specify the date of creation

--created/-c accepts a date in ISO8601 format: yyyy-mm-dd

For example, for repos created on 1st January 2014, use:

starcli --created 2014-01-01

To search for repos that are createdon or after 1st January 2014, use:

starcli --created '>=2014-01-01'

Filtering by topics

This option lets you filter by topics. You can use--topics or-t to includea topic in search.

This option can be used multiple times.

starcli -l python -d 2020-07-06 -t deep-learning -t pytorch

Specifying last pushed date

Use--pushed/-p when you want to find popular repos that are last updated ona given date, say 2020-01-01 for 1st of Jan 2020:

starcli -p 2020-01-01

You can also prefix the value with ">=<" like:

starcli -p '>=2020-01-01'

This is find repos that have last pushed after or on January the 1st, 2020.

Read more about the >=< syntax onGitHubDocs.

Searching by user

Recommended to be used with--stars and/or--date-created.

Finding trending projects by GitHub username is supported too. Use--user or-u to do so.

Just provide a valid GitHub username after it, like:

starcli -u torvaldsstarcli -u gvanrossum

Using date ranges

You can use--date-range or-d and specify today, this-week, or this-month,so that GitHub Trending search function will be used to find popular repos andtell you how much stars are gained this day/week/month depending on the optionyou used.

starcli -d this-week

demo date range

Note that (like--spoken-language) options like--topics,--pushed,--created won't take effect because-d uses a different search mechanism tofind results.

Limit the number of results shown

Don't like the default 7? You can change it to something else, using--limit-results or-r followed by an integer:

starcli -r 2

The above will only give you two repos. This is useful if you want to put it inyour.bashrc,.zshrc, orfish_greeting function.

Just addstarcli -r 3 -L grid in there, and every time you open your terminal,you will find 3 trending repos printed neatly in a grid format, great way tostart your day (a bit like theHacker TabExtension).

Paging

Result output can be displayed through your OS pager using the--pager/-pflag.

If you're using less, addR to yourLESS environment variable so colors andstyling can be displayed correctly.

GitHub Authentication

Rate limit may be hit if starcli sends many repeated requests to GitHub within ashort perod of time.

To avoid this, provide an authentication token using--auth:

starcli --auth 'username:token'

Read more about authentication tokens on GitHubDocs

Issues, feature request, and feedback

  • Issues, bug reports, or feature request: Don't hesitate to open an issue inthis repo
  • Feedback: any general feedback or questions about using StarCLI you can leavea comment on theProduct Huntpage

DevelopmentPRs Welcome

For contributing guidelines and how to set up your development environment,please readCONTRIBUTING.md.Remember that all contributions to this project should follow itsCODE OFCONDUCT.

Uses

  • CommandLine Argument parser:Click
  • Colored and table console print:rich(with click and colorama)
  • HTTP library to send requests:requests

Contributors ✨

Thanks goes to all of these wonderful people (emojikey):

Shagilton
Shagilton

💻
hexbee
hexbee

🐛
Sam Wellander
Sam Wellander

💻
Shivam Sinha
Shivam Sinha

💻
Will McGugan
Will McGugan

💻
Ashik J M
Ashik J M

💻
Yu-Lin Chao
Yu-Lin Chao

💻
Saif Kazi
Saif Kazi

💻📖
arcanearronax
arcanearronax

⚠️💻
jSadoski
jSadoski

📖💻
odmishien(Tetsuya MISHIMA)
odmishien(Tetsuya MISHIMA)

💻
Neel Shah
Neel Shah

💻
0xflotus
0xflotus

💻
Akash Dhanwani
Akash Dhanwani

💻
Ed Davis
Ed Davis

💻
Jeff Chiang
Jeff Chiang

💻
Dmitry Kankalovich
Dmitry Kankalovich

💻

This project follows theall-contributorsspecification. Contributions of any kind welcome!

Credits

This project was forked fromgithunt(python) and its initial intention wasto rewrite that project to use Rich instead of colorama + tabulate, but now ithas so much more features than before, thanks to everyone's contributions 🙌


[8]ページ先頭

©2009-2025 Movatter.jp