项目作者: mskutin

项目描述 :
Github Stats Collector
高级语言: Go
项目地址: git://github.com/mskutin/gsc.git
创建时间: 2020-07-06T04:58:26Z
项目社区:https://github.com/mskutin/gsc

开源协议:MIT License

下载


Linter" class="reference-link">gsc Release Linter

Github Stats Collector is a tiny cli that helps to collect stats for public repositories.

Screenshot 2020-07-07 at 03 41 29

Install

The quickest way to start: docker run mskutin/gsc get --help

Install binary

Platforms supported:

Mac OS X
  1. wget -c https://github.com/mskutin/gsc/releases/download/v0.3-alpha/gsc-darwin-amd64.tar.gz -O - | tar -xz && \
  2. mv gsc /usr/local/bin/gsc

Installation on other platforms may be different.

Build from source

Clone the repository: git clone https://github.com/mskutin/gsc

Build with go

  • go build
  • ./gsc help

Build with docker

  • docker build -f build/package/cli/Dockerfile . -t gsc
  • docker run gsc get --help

Usage

Repository stats can be retrieved by calling a get command:

```shell script
Usage:
gsc get [flags]

Flags:
-f, —format string —format tsv (default “csv”)
-h, —help help for get
-r, —repos strings One or more repositories: ‘gsc get -r mskutin/gsc’
See help for more examples.

  1. ### Authorization
  2. By default `gsc` interacts with GitHub API anonymously.
  3. Since GitHub's default request rate is only 60 req/h you may run out of this limit shortly.
  4. You can set `GITHUB_TOKEN` and `GITHUB_USERNAME` environment variables to authorize gsc in GitHub.
  5. ### Stats
  6. #### get statistics for one repository:
  7. ```shell script
  8. 1) gsc get -r mskutin/gsc
  9. 2) gsc get --repos=mskutin/gsc
  1. name,clone_url,last_commit_author,last_commit_date
  2. mskutin/gsc,https://github.com/mskutin/gsc.git,Maksim Skutin,2020-07-07 05:43:31 +0000 UTC

get statistics for multiple repositories:

```shell script
1) gsc get -f tsv \
-r mskutin/gsc \
-r mskutin/nginx-fluentd \
-r helm/charts
2) gsc get -r=helm/charts,mskutin/gsc
3) echo “helm/charts,mskutin/gsc” | xargs gsc get -r

  1. ```csv
  2. name,clone_url,last_commit_author,last_commit_date
  3. mskutin/gsc,https://github.com/mskutin/gsc.git,Maksim Skutin,2020-07-07 05:43:31 +0000 UTC
  4. helm/charts,https://github.com/helm/charts.git,Maxime Brunet,2020-07-07 11:51:58 +0000 UTC

Formatters

```shell script
gsc get [flags]

Flags:
-f, —format string —format tsv (default “csv”)

  1. ```shell script
  2. ./gsc get -f tsv \
  3. -r mskutin/gsc \
  4. -r helm/charts \
  5. -r github/hubot

shell script name clone_url last_commit_author last_commit_date mskutin/gsc https://github.com/mskutin/gsc.git Maksim Skutin 2020-07-10 20:10:52 +0000 UTC helm/charts https://github.com/helm/charts.git jabdoa2 2020-07-11 17:39:23 +0000 UTC hubotio/hubot https://github.com/hubotio/hubot.git Misty De Meo 2019-04-17 04:49:47 +0000 UTC

By default, gsc uses csv format output.
The following types of output are supported:

  • csv
  • tsv
  • table