Skip to content

worlpaker/gitty

Repository files navigation

Gitty

GitHub Latest Release Go CodeQL codecov Go Report Card License

gitty

Overview

Gitty is a CLI tool that helps you download GitHub files and directories directly! It is fast, simple, and works concurrently.

Gitty simplifies downloading a single folder from GitHub. It is perfect for downloading specific files and folders from large repositories without cloning them.

Install

Go

Requires Go 1.23+

go install github.com/worlpaker/gitty@latest

Usage

gitty github-url

Examples

  • Download GitHub Directory
gitty https://github.com/worlpaker/go-syntax/tree/master/examples
  • Download GitHub File
gitty https://github.com/worlpaker/go-syntax/blob/master/test/semantic_tokens.go
  • Gitty also works without the https prefix
gitty github.com/worlpaker/go-syntax/tree/master/examples

Authorization

GitHub has hourly rate limit:

  • For unauthenticated users: 60

  • For authenticated users: 5000

  • For enterprise cloud users: 15000

Gitty authenticates using the GH_TOKEN environment variable. You can get a personal access token from GitHub Personal Tokens. For more details, see GitHub's guide on managing your personal access tokens.

You can set the GH_TOKEN environment variable manually, or you can use gitty!

  • Set token
gitty -s=your_github_token
  • Unset token
gitty -u
  • Authenticated user info
gitty -a
  • Check client auth status and remaining rate limit
gitty -c

NOTE: Gitty doesn't store your token. It gets, saves, and deletes the token from your os environment variable.

How it works

Gitty uses go-github to interact with GitHub and cobra for CLI.

Test

Test coverage is 100% for Windows, Linux and macOS (see: gitty test commands).

Contributing

Yes, please! Feel free to contribute.

Credits

Inspired by download-directory.

License

MIT

About

Download GitHub File & Directory

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published