Skip to main content

CLI tool to clone all repos from a given organization or user

Project description


CLI tool to clone all repos from a given organization or user

Install into your Python project using pip install clone-all-from-org

Install as a CLI tool using pipx: pipx install clone-all-from-org.

What does this do?

For any given GitHub users or orgs (or yourself) this will enumerate all the repos you can see and clone them to a prefix. This allows you to keep up to date with any repos in the uses or orgs you follow.

This script requires a GitHub OAuth token, or Personal Access Token, to talk to the GitHub API. The easiest way to get one is to login with the GitHub CLI tool. This script knows how to read the token from that tool's config.

To run give it a list of orgs to clone:

clone-all-from-org me org:codinggrace user:micktwomey
# clones all the repos into ~/src/{organization or user}/{repo name}

This tool recognizes:

  • org:someorg - a GitHub organization
  • user:someuser - GitHub user
  • me - yourself

Note that the GitHub APIs will only show you publicly available repos for users and orgs by default. If you are a member of the organization you can see all repos (if you have access). me is a special case, this will show all repos you have access to (including your own private repos). If you used user:your-username it would only show your public repos.

Combining with gitup

This combines well with gitup to fetch all new repos and then update all your cloned repos:

# one off setup
pipx install gitup clone-all-from-org
gitup -a ~/src/

# run periodically
clone-all-from-org me org:my-org
gitup --prune

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clone-all-from-org-0.2.1.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

clone_all_from_org-0.2.1-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page