gh-gr

module
v2.6.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: MIT

README

test_and_report build_and_release Go Report Card Maintainability Test Coverage Go Reference Go version Release Release Date Commits since latest release Downloads (all assets, all releases) Downloads (all assets, latest release)


gh-gr

gh-gr is a GitHub repository management tool based on the project github-repo by Cristian Henzel.

Since the original project used a configuration file containing sensitive information, the issue has been addressed by reinventing the tool as an extension to the github cli (gh).

gh-gr demo

Installation

Prerequisites: github cli (gh)

To install gr:

$ gh extension install https://github.com/sarumaj/gh-gr

Usage

$ gh gr --help

> gr is a gh cli extension allowing management of multiple repositories at once
>
> Usage:
>   gr [flags]
>   gr [command]
>
> Examples:
>   gh gr --concurrency 100 --timeout "20s" <subcommand>
>
> Available Commands:
>   cleanup     Clean up untracked local repositories
>   completion  Generate the autocompletion script for the specified shell
>   edit        Edit configuration
>   export      Export current configuration to stdout
>   help        Help about any command
>   import      Import configuration from stdin or a file
>   init        Initialize repository mirror
>   pull        Pull all repositories
>   push        Push all repositories
>   remove      Remove current configuration
>   status      Show status for all repositories
>   update      Update configuration
>   version     Display version information
>   view        Display current configuration
>
> Flags:
>   -c, --concurrency uint   Concurrency for concurrent jobs (default 12)
>   -h, --help               help for gr
>   -t, --timeout duration   Set timeout for long running jobs (default 10m0s)
>
> Use "gr [command] --help" for more information about a command.

First, create the configuration:

$ gh gr init -d SOMEDIR -c 10

or, if you are willing to exclude some repositories, you can use regular expressions:

$ gh gr init -c 10 -d SOMEDIR -e ".*repo1" -e "SOMEORG/repo-.*" -s

Run gh gr init --help or gh gr help init to retrieve more information about the init command.

After the configuration is created, you can pull all repositories using:

$ gh gr pull

you can view the status of the repositories using:

$ gh gr status

and you can push all repositories using:

$ gh gr push

After creating new repositories on the server or after user data changes, you can update the local configuration using:

$ gh gr update

Acknowledgments

Directories

Path Synopsis
cmd
gh-gr
gh-gr is a CLI tool to manage GitHub repositories.
gh-gr is a CLI tool to manage GitHub repositories.
pkg
commands
Package commands provides the command line interface for the application.
Package commands provides the command line interface for the application.
configfile
Package configfile provides a simple interface for reading and writing configuration file.
Package configfile provides a simple interface for reading and writing configuration file.
restclient
Package restclient provides a REST client for the GitHub API.
Package restclient provides a REST client for the GitHub API.
util
Package util provides utility functions for the application.
Package util provides utility functions for the application.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL