Skip to content

[GitHub CLI] extension for download folders/files

Notifications You must be signed in to change notification settings

yuler/gh-download

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

gh download

GitHub CLI extension for download folders/files

Install

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

# 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