{"id":22531658,"url":"https://github.com/gyumeijie/github-files-fetcher","last_synced_at":"2025-07-04T22:32:27.199Z","repository":{"id":41485147,"uuid":"139954798","full_name":"Gyumeijie/github-files-fetcher","owner":"Gyumeijie","description":"Download a specific folder or file from a GitHub repo through command line ","archived":false,"fork":false,"pushed_at":"2021-09-19T13:30:56.000Z","size":103,"stargazers_count":161,"open_issues_count":1,"forks_count":24,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-22T02:19:47.594Z","etag":null,"topics":["cli","command-line","command-line-tool","commandline-options","download","download-file","downloader","downloads","fetch","fetcher","file","file-downloader","files","files-downloader","github","github-repository","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/github-files-fetcher","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gyumeijie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-06T08:17:23.000Z","updated_at":"2025-05-25T11:57:46.000Z","dependencies_parsed_at":"2022-09-19T03:50:28.867Z","dependency_job_id":null,"html_url":"https://github.com/Gyumeijie/github-files-fetcher","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Gyumeijie/github-files-fetcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gyumeijie%2Fgithub-files-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gyumeijie%2Fgithub-files-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gyumeijie%2Fgithub-files-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gyumeijie%2Fgithub-files-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gyumeijie","download_url":"https://codeload.github.com/Gyumeijie/github-files-fetcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gyumeijie%2Fgithub-files-fetcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263628011,"owners_count":23490894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","commandline-options","download","download-file","downloader","downloads","fetch","fetcher","file","file-downloader","files","files-downloader","github","github-repository","npm-package"],"created_at":"2024-12-07T08:08:25.069Z","updated_at":"2025-07-04T22:32:27.163Z","avatar_url":"https://github.com/Gyumeijie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nThe `github-files-fetcher` is designed for downloading parts of a github repository. This is very useful if you have a low bandwidth network or only need a particular file or subdirectory from a large repository. If you want to download a whole repository, prefer `git clone`.\n\n# Installation \n\nRun `npm install -g github-files-fetcher`\n\n## Basic usage\n\n```sh\nfetcher --url=resource_url  --out=output_directory\n```\n\nFor example:\n```sh\nfetcher --url=\"https://github.com/Gyumeijie/github-files-fetcher/blob/master/CHANGELOG.md\" --out=/tmp\n```\n![](https://github.com/Gyumeijie/assets/blob/master/github-files-fetcher/fetcher-result.png)\n\n## Authentication\n\nThe default unauthorized API access rate is **60** times per hour, which is usually enough.\nYou can surpass this with authentication, using one of the following three ways:\n\n1. The --auth commandline option\n\n   This option takes the form of `--auth=username:password`, where the password can be either the login password for your github account or the personal access token which can be generated in https://github.com/settings/tokens.\n\n2. Default configuration file\n\n   The default configuration file is `~/.download_github`, and the config file is a **json file**.\n\n3. Designate via --file commandline option\n\n   For example, you can use `~/config.json` as configuration file.\n```sh\n # download a directory\n fetcher --file=\"~/config.json\" --url=\"https://github.com/reduxjs/redux/tree/master/examples/async\" --out=\"~/\" \n \n # download a single file\n fetcher --file=\"~/config.json\" --url=\"https://github.com/Gyumeijie/github-files-fetcher/blob/master/index.js\" --out=\"~/\" \n```\n\nThis is a **template** for the configuration file:\n```json\n{\n   \"auth\": {\n        \"username\" : \"your_github_name\",\n        \"password\" : \"password_or_api_access_token\"\n   },\n   \"alwaysUseAuth\" : true,\n   \"timeout\" : 5000 \n}\n```\n\n### Behavior\n\nWhen the default unauthorized API access rate exceeded, `github-files-fetcher` will automatically switch to use authentication if provided through one of the ways above. \n\n`github-files-fetcher` requests resources without authentication by default to improve performance. However, this incurs a delay once the default unauthorized API access rate exceeded. To avoid this problem you can specify the `--alwaysUseAuth` option so `github-files-fetcher` always uses authentication.\n\n# Environment\n`node \u003e= 6`\n\n# Related works\nThere are some other good tools that function similarly:\n- GitZip (Credits to Kino, Browser Extensions)\n    - [Firefox Addon](https://addons.mozilla.org/en-US/firefox/addon/gitzip/)\n    - [Chrome Extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)\n- [DownGit](https://minhaskamal.github.io/DownGit/#/home) (Credits to Minhas Kamal, Web Page)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgyumeijie%2Fgithub-files-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgyumeijie%2Fgithub-files-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgyumeijie%2Fgithub-files-fetcher/lists"}