Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djfarly/ghcd
📂 GitHub Clone Directory — ghcd
https://github.com/djfarly/ghcd
cli clone command-line-tool directory github
Last synced: 3 months ago
JSON representation
📂 GitHub Clone Directory — ghcd
- Host: GitHub
- URL: https://github.com/djfarly/ghcd
- Owner: djfarly
- License: mit
- Created: 2022-09-24T20:17:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-23T06:57:29.000Z (over 1 year ago)
- Last Synced: 2024-10-03T09:19:12.842Z (3 months ago)
- Topics: cli, clone, command-line-tool, directory, github
- Language: TypeScript
- Homepage:
- Size: 323 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📂 GitHub Clone Directory — `ghcd`
> A CLI to _clone_[^1] a subdirectory of a GitHub repository
```sh
npx ghcd@latest [options] [dir]
```## Usage
Open the subdirectory you want to clone in GitHub, and copy the URL. Then run:
```sh
npx ghcd@latest https://github.com/vercel/next.js/tree/canary/packages/create-next-app
```This will download `create-next-app` directory of the `vercel/next.js` repository into a new folder.
The `https://github.com/` part is optional, so you can also run:
```sh
npx ghcd@latest vercel/next.js/tree/canary/packages/create-next-app
```### Specifying the output directory
You can specify the output directory by passing directory name as the second argument:
```sh
npx ghcd@latest vercel/next.js/tree/canary/packages/create-next-app my-copy-of-create-next-app
```## Options
### `--init` / `-i`
Initialize a new git repository in the downloaded directory.
[^1]: The term _clone_ is used loosely here. 🫣 The CLI does not actually clone the repository, but rather downloads the files into a new folder.
### `--help` / `-h`
Show help.