Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuler/gh-download
[GitHub CLI] extension for download folders/files
https://github.com/yuler/gh-download
command download gh gh-extension
Last synced: 29 days ago
JSON representation
[GitHub CLI] extension for download folders/files
- Host: GitHub
- URL: https://github.com/yuler/gh-download
- Owner: yuler
- Created: 2021-09-06T06:32:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T02:51:38.000Z (over 1 year ago)
- Last Synced: 2024-08-03T21:02:36.392Z (4 months ago)
- Topics: command, download, gh, gh-extension
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 56
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-gh-cli-extensions - **download** - Extension to download folders/files without cloning the repository. (Tool)
- jimsghstars - yuler/gh-download - [GitHub CLI] extension for download folders/files (Shell)
README
# gh download
[GitHub CLI] extension for download folders/files
## Install
```bash
gh extension install yuler/gh-download
```## Features
- Download folders/files from GitHub
- Support private repository## How it works
- Get GitHub token by `gh config get -h github.com oauth_token` command, for support private repository
- Use [GitHub `get a tree` API] filter path
- Path suffix with `/` means is folder, otherwise checked automatically via api
- Traverse the folder and download it via curl with GitHub token## Usage
```bash
# Create alias dl => download
gh alias set dl "download"
# Download files
gh dl yuler/gh-download README.md gh-download
# Download `.github` folders from `cli/cli` repo
gh dl cli/cli .github
# Download from github.com url
gh dl https://github.com/yuler/actions/blob/3541e20e6f195a812b0e775058224a6d6f4b9fc1/ci/nodejs.yml
```## Related
- [download-directory.github.io]
- [gh-cp][github cli]: https://github.com/cli/cli
[download-directory.github.io]: https://download-directory.github.io/
[gh-cp]: https://github.com/mislav/gh-cp
[github `get a tree` api]: https://docs.github.com/en/rest/reference/git#get-a-tree