gf2
v0.0.6
Published
A simple CLI tool for downloading specific folders from GitHub repositories.
Downloads
394
Maintainers
Readme
GF2 - GitHub Folder Fetcher
GF2 is a simple CLI tool that allows you to download specific folders from GitHub repositories with ease. Using this tool, you can fetch only the necessary folder from a GitHub repository without having to clone the entire repository.
Features
- Download specific folders from any public GitHub repository.
- Simple CLI interface that can be used directly via
npx
. - Lightweight: Only fetches the folder you need, making it fast and efficient.
- Supports GitHub Enterprise: Fetch folders from GitHub Enterprise repositories.
Installation
Using npx
You can use the tool directly with npx
without installing it globally:
npx gf2 <github-folder-url>
Where <github-folder-url>
is the URL of the GitHub folder you want to download.
Installing Locally
Alternatively, you can install gf2
locally as a dependency in your project:
npm install gf2 --save-dev
Then, use it by running:
npx gf2 <github-folder-url>
Usage
Once installed, you can fetch any folder from a GitHub repository by running the following command:
npx gf2 <github-folder-url>
Example:
To download the src/templates/TypeScript/Express/MongoDB/JWT
folder from the dollfin-templates
repository, run:
npx gf2 https://github.com/shaantanu9/dollfin-templates/tree/main/src/templates/TypeScript/Express/MongoDB/JWT
This will download the folder to your current directory, named after the repository folder.
Development
Prerequisites
- Node.js (>= 14.x)
- npm or yarn
Installing Dependencies
To set up the development environment, run:
npm install
Running the Tool Locally
If you're working on the tool or want to test it locally, you can run it using:
npm start
This will run the tool with the ts-node
interpreter.
Building the Project
To compile the TypeScript files to JavaScript, run:
npm run build
Running Tests
Currently, there are no tests defined, but you can set up testing frameworks like Jest or Mocha for future test setups.
Contributing
We welcome contributions to the project! If you'd like to contribute, please fork the repository, make your changes, and submit a pull request.
Steps to Contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-xyz
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to your forked repository (
git push origin feature-xyz
). - Create a pull request to the main repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Created by Shantanu Bhat
LinkedIn
Acknowledgments
- Giget: This tool relies on the
giget
package for downloading GitHub folders. - Open Source Community: Thank you to all the contributors who help make the open-source community thrive!