@cyftec/ghcopy
v0.5.0
Published
CLI tool to copy contents of any GitHub repo's subdirectory and paste in current working directory
Downloads
522
Readme
ghcopy
A CLI tool to copy files and folders from any GitHub repo's subdirectory and paste directly into your current working directory.
Features
- 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
How to Use
Prerequisites
- Mac or Linux or WSL on Windows
- Terminal
- git tool installed on terminal
- Node and npm installed on terminal
Installation
npm install -g @cyftec/ghcopyBasic usage
ghcopy <github-url>Examples
Copy entire repository:
ghcopy https://github.com/user/repoCopy a subdirectory (from 'main' branch):
ghcopy https://github.com/user/repo/tree/main/path/to/some/subdirectoryCopy from a different branch:
ghcopy https://github.com/user/repo/tree/feature-x/templatesWhat it does internally
- 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
⚠️ Existing files in the current directory may be overwritten.
How to support
This project is open-source and community-driven. Any form of contribution is welcome.
Contributing with code
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
Good contribution ideas
- Adding test-cases
- Better error handling for invalid URLs
- Support for private repos via token
- Progress indicators
Contributing financially
If this tool saves you time, consider supporting its development.
Options:
- One time or monthly contributions via GitHub Sponsorship
- Support via Ko-fi account
- Sponsored feature development
- Drop a mail at [email protected] for discussing personalized contribution
Other Ways to Help
- Star the repository
- Report bugs or request features
- Improve documentation
- Share with others
License
MIT License
