Skip to content

Latest commit

 

History

History
112 lines (77 loc) · 2.54 KB

README.md

File metadata and controls

112 lines (77 loc) · 2.54 KB

License GoDoc Go Report Card Release

go-git-stats

CLI tool for git statistics

COMMANDS

repo

Get all repositories.

# When Github access token is set to GGS_TOKEN (environment variable)
$ echo $GGS_TOKEN
> ghp_....

# Repositories for authenticated user with Github access token
$ ggs repo
# abbreviation command
$ ggs r

# Public repositories without Github access token
$ ggs repo -name kokoichi206
$ ggs r -n kokoichi206

stats

Get statistics of a specific repository.

# You need to set Github access token to GGS_TOKEN (environment variable)
# if you want to get private repopsitory stats.
$ echo $GGS_TOKEN
> ghp_....

$ ggs stats -name kokoichi206/go-git-stats
# abbreviation command
$ ggs s -name kokoichi206/go-git-stats

lines

Get lines of codes you wrote before.

# You need to set Github access token to GGS_TOKEN (environment variable)
# if you want to get private repopsitory stats.
$ echo $GGS_TOKEN
> ghp_....
# with access token
$ ggs lines
> 11930741

$ ggs lines -name kokoichi206
> 10452117
# abbreviation command
$ ggs l -n kokoichi206
> 10452117

INSTALLATION

Built binaries are available from GitHub Releases.

https://github.com/kokoichi206/go-git-stats/releases

How to install

If you have Go environment, you can install via go install.

go install github.com/kokoichi206/go-git-stats/cmd/ggs@latest

MacOS, Linux

curl -Lsf https://raw.githubusercontent.com/kokoichi206/go-git-stats/main/_tools/scripts/installer.sh | bash

Get Access Token

Following this document, you can get personal access token (classic) which starts from ghp_.

Required scopes

  • repo:status
  • public_repo

How to set environment varialbe

MacOS, Linux

# Write these two commands to .bashrc, .zshrc or etc. if you want.
$ GGS_TOKEN=ghp_xxx
$ export GGS_TOKEN

# easier way
$ GGS_TOKEN=ghp_pienpoyon ggs <sub-command>

LICENSE

under MIT License.