https://github.com/worlpaker/gitty
Download GitHub File & Directory
https://github.com/worlpaker/gitty
cli cli-app git github github-api go golang golang-cli
Last synced: 4 months ago
JSON representation
Download GitHub File & Directory
- Host: GitHub
- URL: https://github.com/worlpaker/gitty
- Owner: worlpaker
- License: mit
- Created: 2024-05-01T09:20:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-29T20:07:03.000Z (about 1 year ago)
- Last Synced: 2024-08-29T21:52:55.178Z (about 1 year ago)
- Topics: cli, cli-app, git, github, github-api, go, golang, golang-cli
- Language: Go
- Homepage:
- Size: 423 KB
- Stars: 17
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gitty

[](https://github.com/worlpaker/gitty/actions/workflows/go.yml)
[](https://github.com/worlpaker/gitty/actions/workflows/codeql.yml)
[](https://codecov.io/gh/worlpaker/gitty)
[](https://goreportcard.com/report/github.com/worlpaker/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+**
```sh
go install github.com/worlpaker/gitty@latest
```
## Usage
```sh
gitty github-url
```
### Examples
- Download GitHub Directory
```sh
gitty https://github.com/worlpaker/go-syntax/tree/master/examples
```
- Download GitHub File
```sh
gitty https://github.com/worlpaker/go-syntax/blob/master/test/semantic_tokens.go
```
- Gitty also works without the https prefix
```sh
gitty github.com/worlpaker/go-syntax/tree/master/examples
```
## Authorization
GitHub has hourly [rate limit](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api):
- 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](https://github.com/settings/tokens). For more details, see GitHub's guide on [managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
You can set the `GH_TOKEN` environment variable manually, or you can use **gitty**!
- Set token
```sh
gitty -s=your_github_token
```
- Unset token
```sh
gitty -u
```
- Authenticated user info
```sh
gitty -a
```
- Check client auth status and remaining rate limit
```sh
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](https://github.com/google/go-github) to interact with GitHub and [cobra](https://github.com/spf13/cobra) for CLI.
## Test
Test coverage is 100% for Windows, Linux and macOS (see: [gitty test commands](Makefile)).
## Contributing
Yes, please! Feel free to contribute.
## Credits
Inspired by [download-directory](https://github.com/download-directory/download-directory.github.io).
## License
[MIT](LICENSE)