{"id":13616938,"url":"https://github.com/tegon/clone-org-repos","last_synced_at":"2025-04-14T22:13:23.349Z","repository":{"id":22707238,"uuid":"26051322","full_name":"tegon/clone-org-repos","owner":"tegon","description":":octocat: Clone github organization repositories","archived":false,"fork":false,"pushed_at":"2020-07-12T02:27:39.000Z","size":36,"stargazers_count":80,"open_issues_count":3,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T22:13:12.973Z","etag":null,"topics":["clone","github","organization","repository"],"latest_commit_sha":null,"homepage":"https://tegon.github.io/clone-org-repos/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tegon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-01T13:27:30.000Z","updated_at":"2025-04-09T11:08:29.000Z","dependencies_parsed_at":"2022-09-16T15:11:48.477Z","dependency_job_id":null,"html_url":"https://github.com/tegon/clone-org-repos","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegon%2Fclone-org-repos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegon%2Fclone-org-repos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegon%2Fclone-org-repos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegon%2Fclone-org-repos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tegon","download_url":"https://codeload.github.com/tegon/clone-org-repos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968917,"owners_count":21191162,"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":["clone","github","organization","repository"],"created_at":"2024-08-01T20:01:34.978Z","updated_at":"2025-04-14T22:13:23.332Z","avatar_url":"https://github.com/tegon.png","language":"JavaScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"Clone github organization repos\n===\n\n[![NPM](https://nodei.co/npm/clone-org-repos.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/clone-org-repos/)\n[![Build Status](https://travis-ci.org/tegon/clone-org-repos.svg?branch=master)](https://travis-ci.org/tegon/clone-org-repos)\n[![Coverage Status](https://coveralls.io/repos/tegon/clone-org-repos/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/tegon/clone-org-repos?branch=master)\n\nThis is a tool to clone all repositories from an github organization.\nThis could be helpful if you work at some company, or if you contribute to an open source project.\n\nWhy?\n---\nI went through this a few times, I need to clone all repositories from the company where I work, and, in the beginning, this line of Ruby code was sufficient:\n\n```ruby\ncurl -s \"https://api.github.com/orgs/ORG_NAME/repos?per_page=100\" -u \"username\" | ruby -rubygems -e 'require \"json\"; JSON.load(STDIN.read).each {|repo| %x[git clone #{repo[\"ssh_url\"]} ]}'\n```\n\nBut things got a little complicated. Some repositories aren't used by me because they are from different teams. In this case this tool can be useful because it allows you to pass options to ignore some repositories.\n\nUsage\n---\n```bash\n  cloneorg [OPTIONS] [ORG]\n```\n\nOptions:\n---\n```bash\n  -p,  --perpage NUMBER number of repos per page (Default is 100)\n  -t,  --type STRING    can be one of: all, public, private, forks, sources,\n                         member  (Default is all)\n  -e,  --exclude STRING   Exclude passed repos, comma separated\n  -o,  --only STRING      Only clone passed repos, comma separated\n  -r,  --regexp BOOLEAN   If true, exclude or only option will be evaluated as a\n                         regexp\n  -u,  --username STRING  Username for basic authentication. Required to\n                         access github api\n       --token STRING     Token authentication. Required to access github api\n  -a, --gitaccess         Protocol to use in `git clone` command. Can be `ssh` (default), `https` or `git`\n  -s, --gitsettings       Additional parameters to pass to git clone command. Defaults to empty.\n       --debug            Show debug information\n  -v,  --version          Display the current version\n  -h,  --help             Display help and usage details\n```\n\nExamples:\n---\n\nclones all github/twitter repositories, with HTTP basic authentication. A password will be required\n\n```bash\ncloneorg twitter -u GITHUB_USERNAME\ncloneorg twitter --username=GITHUB_USERNAME\n```\n\nclones all github/twitter repositories, with an access token provided by Github\n\n```bash\ncloneorg twitter --token GITHUB_TOKEN\n```\n\nIf an environment variable `GITHUB_TOKEN` is set, it will be used.\n\n```bash\nexport GITHUB_TOKEN='YOUR_GITHUB_API_TOKEN'\n```\n\nAdd a -p or --perpage option to paginate response\n\n```bash\ncloneorg mozilla --token=GITHUB_TOKEN -p 10\n```\n\nExclude and Only options\n---\n\nIf you only need some repositories, you can pass -o or --only with their names\n\n```bash\ncloneorg angular --token=GITHUB_TOKEN -o angular\n```\n\nThis can be an array to\n\n```bash\ncloneorg angular --token=GITHUB_TOKEN -o angular,material,bower-angular-i18n\n```\n\nThis can also be an regular expression, with -r or --regexp option set to true.\n\n```bash\ncloneorg marionettejs --token=GITHUB_TOKEN -o ^backbone -r true\n```\n\nThe same rules apply to exclude options\n\n```bash\ncloneorg jquery --token=GITHUB_TOKEN -e css-framework # simple\n```\n\n```bash\ncloneorg emberjs --token=GITHUB_TOKEN -e website,examples # array\n```\n\n```bash\ncloneorg gruntjs --token=GITHUB_TOKEN -e $-docs -r true # regexp\n```\n\n```bash\ncloneorg gruntjs --token=GITHUB_TOKEN -e $-docs -r true --gitaccess=git # Clone using git protocol\n```\n\n```bash\n# Clone using git protocol and pass --recurse to `git clone` to clone submodules also\ncloneorg gruntjs --token=GITHUB_TOKEN -e $-docs -r true --gitaccess=git --gitsettings=\"--recurse\"\n```\n\nToDo\n---\n\n- Progress bar while cloning repos\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftegon%2Fclone-org-repos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftegon%2Fclone-org-repos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftegon%2Fclone-org-repos/lists"}