Skip to content

Output the remaining token limit for a GitHub personal access token or fine grained access token.

License

Notifications You must be signed in to change notification settings

clivewalkden/go-github-token-limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check GitHub Token Limit

Scrutinizer Code Quality Build Status CircleCI

This executable returns the number of requests remaining for the GitHub API. If there are no tokens left it gives the reset time.

The application assumes the ENV variable GITHUB_TOKEN is set with a valid GitHub token and uses that to return the quota data for.

Installation

Pre-built binaries

Pre-built binaries are available on the releases page.

Simply download the binary for your platform and run it.

Homebrew

Install with Homebrew on macOS (or Linux with Homebrew installed):

brew tap clivewalkden/taps
brew install github-token-limit

Usage

The application is a command line application and will try to find the GitHub token in the following environment variables:

  • GITHUB_TOKEN
  • GITHUB_TOKEN
  • GH_TOKEN
  • GITHUB_ACCESS_TOKEN
  • GH_ACCESS_TOKEN
  • GITHUB_OAUTH_TOKEN
  • GH_OAUTH_TOKEN
  • GITHUB_PAT
  • GH_PAT
  • GITHUB_AUTH_TOKEN
  • GH_AUTH_TOKEN
  • GITHUB_API_TOKEN
  • GH_API_TOKEN
  • GITHUB_API_KEY
  • GH_API_KEY
  • GITHUB_PERSONAL_ACCESS_TOKEN
  • GH_PERSONAL_ACCESS_TOKEN
  • GITHUB_PERSONAL_TOKEN
  • GH_PERSONAL_TOKEN
  • GITHUB_PERSONAL_API_TOKEN
  • GH_PERSONAL_API_TOKEN
  • GITHUB_PERSONAL_API_KEY
  • GH_PERSONAL_API_KEY
  • GITHUB_APP_TOKEN
  • GH_APP_TOKEN
  • GITHUB_APP_KEY
  • GH_APP_KEY

If the token is not found in any of these environment variables, the application will exit with an error.

No Token

If the token is found, the application will check the quota and return the number of requests remaining.

Quote remaining

If the token has no requests remaining, the application will return the reset time.

Quote reset

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository or CHANGELOG.md.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Output the remaining token limit for a GitHub personal access token or fine grained access token.

Resources

License

Stars

Watchers

Forks

Packages

No packages published