https://github.com/ckpack/git-dl
使用命令行下载 github 项目
https://github.com/ckpack/git-dl
Last synced: about 1 year ago
JSON representation
使用命令行下载 github 项目
- Host: GitHub
- URL: https://github.com/ckpack/git-dl
- Owner: ckpack
- License: mit
- Created: 2025-03-19T09:28:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-25T05:45:35.000Z (over 1 year ago)
- Last Synced: 2025-03-25T06:26:47.887Z (over 1 year ago)
- Language: TypeScript
- Size: 222 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @ckpack/git-dl
[English](./README.md) | [简体中文](./README_ZH.md)
A command-line tool used to download specific content from GitHub repositories. It allows you to specify parameters such as the owner and name of the repository, the output directory, the branch, the subpath, the glob expression, etc., making it convenient to download the files you need.
> GitHub has rate limits for unauthenticated users . You can add `GITHUB_TOKEN` to the environment variables or use the `-t` option to avoid exceeding the limits. You can create `GITHUB_TOKEN` at
# Install
```shell
npm install -g @ckpack/git-dl
```
# Usage
```shell
git-dl [options] [command] [output-dir]
```
Command:
- ``:Required. The owner and name of the GitHub repository, in the format of `owner/repo`, for example, `ckpack/git-dl`.
- `[output-dir]`:Optional. The output directory for the downloaded files. If not specified, the default directory will be used.
Options:
+ `-V`, `--version` output the version number
+ `-b`, `--branch ` branch name (default: "main")
+ `-s`, `--subpath ` subpath
+ `-g`, `--glob ` glob expressions
+ `-d`, `--debug ` show debug log
+ `-t`, `--token ` github token
+ `-h`, `--help` display help for command
Example:
```shell
# download ckpack/git-dl
git-dl ckpack/git-dl
# download ckpack/git-dl to my_dir
git-dl ckpack/git-dl ./my_dir
# Only download the src directory in ckpack/git-dl
git-dl ckpack/git-dl -s src
# Only download the .ts files in ckpack/git-dl
git-dl ckpack/git-dl -g "**.ts"
# USE GITHUB_TOKEN
git-dl ckpack/git-dl -g "**.ts" -t "YOUR_GITHUB_TOKEN"
# Show the help for the command
git-dl -h
```