Socket
Book a DemoInstallSign in
Socket

xiam.li/ghclone

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xiam.li/ghclone

Go Modules
Version
v1.1.0
Version published
Created
Source

GH Clone

goreleaser License

A simple cli tool that clones whole GitHub accounts or organizations.

Installation

You can either download the latest release from the release page, or you can install it via go install:

go install xiam.li/ghclone/cmd/ghclone@latest

ghclone will then be available in your $GOPATH/bin directory.

Usage

The command syntax is as follows:

ghclone [flags] <account>

If the --type/-t flag is not supplied, the tool will try a organization first and if that fails, it will ask to t

The account argument can either be a GitHub username or an organization name.

To clone a GitHub organization, run the following command:

ghclone --all golang

This will clone all repositories of the golang organization into the golang directory.

If there are more than 100 repositories, you will be prompted if you wanna clone the next page too, unless the --all/-a flag is supplied, then all repositories will be downloaded without a prompt. If --all/-a is not supplied but --no-prompt/-np is, the tool will stop after the first page, without a prompt.

If you want to clone a personal account, run the following command:

ghclone -u octocat

This would download the first page (by default 100 repositories, customizable with the --per-page/-pp flag) and if there are more repositories left, it will prompt you if you wanna clone the next page and so on.

Flags

FlagDescriptionDefault
--help/-hShows the help.
--version/-vShows the version.
--type/-tThe type of the GitHub account. Can be either user or org.org
--user/-uAlias to --type user
--page/-pThe page to start cloning from.1
--per-page/-ppThe amount of repositories per page.100
--verbose/-VWhether to print verbose output.false
-quiet/-qWhether to suppress unnecessary, informational, output.false
-quieter-quiet/-qqWhether to suppress all output. Errors will still be printed.false
--no-prompt/-npWhether to prompt the user to clone the next page.false
--all/-aWhether to clone all pages.false
--dry-run/--dry/-drWhether to only print the repositories that would be cloned.false
--output/-oThe output directory.Account Name
--tokenGitHub Fine-grained Token for use in authentication. Optional to avoid rate limiting.
Needs Repository->Metadata->Read-Only and Repository->Contents->Read-Only permissions.
--patGitHub Personal Access Token for use in authentication. Optional to avoid rate limiting.
Needs full repo access permissions. Use of fine-grained tokens are recommended over PATs.

Note: A PAT can be supplied via the token flag and vice-versa; they're both parsed into the same field, and there's no difference whether of the two flags are used.

License

MIT © 2023 Dorian Heinrichs

FAQs

Package last updated on 21 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts