Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eczy/ghforeach
Utility for batch operations on GitHub repository contents.
https://github.com/eczy/ghforeach
github go golang repository-management utility
Last synced: 11 days ago
JSON representation
Utility for batch operations on GitHub repository contents.
- Host: GitHub
- URL: https://github.com/eczy/ghforeach
- Owner: eczy
- License: gpl-3.0
- Created: 2024-03-12T03:39:17.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-09-24T16:44:45.000Z (about 1 month ago)
- Last Synced: 2024-10-13T13:22:39.655Z (25 days ago)
- Topics: github, go, golang, repository-management, utility
- Language: Go
- Homepage:
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ghforeach
`ghforeach` is a tool to run batch operations on a large set of GitHub repositories. For example, this can be useful for creating or editing matching configuration files across many repos.
## Installation
`make install` will compile the executable and copy it to `/usr/local/bin`. If you want to place the executable elsewhere, run `make build` and then copy it to your desired location.
## Usage
```
Usage: ghforeach [--authuser AUTHUSER] [--authtoken AUTHTOKEN] [--org ORG] [--user USER] [--nameexp NAMEEXP] [--namelist NAMELIST] [--topicexp TOPICEXP] [--topiclist TOPICLIST] [--shell SHELL] [--tmpdir TMPDIR] [--cleanup] [--overwrite] [--nthreads NTHREADS] [--json] [--debug] [COMMAND]Positional arguments:
COMMAND command to run at root of each repo.Options:
--authuser AUTHUSER user for authenticating API requests. [env: GH_AUTH_USER]
--authtoken AUTHTOKEN
token for authenticating API requests. [env: GH_AUTH_TOKEN]
--org ORG, -o ORG organization owning repositories to be iterated.
--user USER, -u USER user owning repositories to be iterated.
--nameexp NAMEEXP, -n NAMEEXP
regular expression for matching repository names.
--namelist NAMELIST, -N NAMELIST
path to file containing repository names (newline separated).
--topicexp TOPICEXP, -t TOPICEXP
regular expression for matching topics.
--topiclist TOPICLIST, -T TOPICLIST
path to file containing topics (newline separated).
--shell SHELL, -s SHELL
path to shell used to run command. [default: /bin/sh]
--tmpdir TMPDIR, -d TMPDIR
directory into which repositories will be cloned. [default: ./tmp]
--cleanup, -c enable to delete TMPDIR after operations are complete.
--overwrite, -O enable to delete TMPDIR before operations start.
--nthreads NTHREADS, -p NTHREADS
number of repositories that will be handled in parallel. -1 for unlimited. [default: 1]
--json, -j enable to display output as JSON.
--debug, -D enable to debug logging.
--help, -h display this help and exit
```If both `user` and `org` are specified, `org` takes precedence. If `command` contains spaces (e.g. `ls -la`), wrap it in double quotes.