A CLI tool to copy files and folders from any GitHub repo's subdirectory and paste directly into your current working directory.
- Copies files and folders from any github repo subdirectory and pastes them in current directory
- Copies without initializing git in current directory
- Copies without checking into any branch
- No
git clone, nosvn - Works with public GitHub repositories
- Mac or Linux or WSL on Windows
- Terminal
- git tool installed on terminal
- Node and npm installed on terminal
npm install -g @cyftec/ghcopy
ghcopy <github-url>
ghcopy https://github.com/user/repo
ghcopy https://github.com/user/repo/tree/main/path/to/some/subdirectory
ghcopy https://github.com/user/repo/tree/feature-x/templates
- Converts GitHub URL to codeload.github.com
- Downloads the repo ZIP
- Extracts only the target directory
- Copies all files and folders into the current directory
- Removes temporary files
This project is open-source and community-driven. Any form of contribution is welcome.
If you’d like to improve ghcopy:
- Fork the repo
- Create a branch based on the type of change/commit
git checkout -b commit_type:your-branch-detail
- Make changes and commit
- Open a Pull Request with a clear description and screenshots if necessary
Check this link for commit_type convention - https://github.com/pvdlg/conventional-commit-types
- Adding test-cases
- Better error handling for invalid URLs
- Support for private repos via token
- Progress indicators
If this tool saves you time, consider supporting its development.
- One time or monthly contributions via GitHub Sponsorship
- Support via Ko-fi account
- Sponsored feature development
- Drop a mail at cyftec@cyfer.tech for discussing personalized contribution
- Star the repository
- Report bugs or request features
- Improve documentation
- Share with others
MIT License