Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbrks/shotgun
💥 A tool for running commands in parallel on a set of directories
https://github.com/bbrks/shotgun
command-line command-line-tool go golang golang-tools shell utility
Last synced: about 21 hours ago
JSON representation
💥 A tool for running commands in parallel on a set of directories
- Host: GitHub
- URL: https://github.com/bbrks/shotgun
- Owner: bbrks
- License: mit
- Created: 2016-10-05T21:49:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T09:08:59.000Z (about 2 years ago)
- Last Synced: 2024-06-20T12:42:44.889Z (5 months ago)
- Topics: command-line, command-line-tool, go, golang, golang-tools, shell, utility
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [![Shotgun Logo](https://cdn.rawgit.com/bbrks/shotgun/master/logo.svg)](https://github.com/bbrks/shotgun)
A tool for running commands in parallel on a set of directories.
[![Build Status](https://travis-ci.org/bbrks/shotgun.svg)](https://travis-ci.org/bbrks/shotgun)
[![Go Report Card](https://goreportcard.com/badge/github.com/bbrks/shotgun)](https://goreportcard.com/report/github.com/bbrks/shotgun)
[![GitHub tag](https://img.shields.io/github/tag/bbrks/shotgun.svg)](https://github.com/bbrks/shotgun/releases)
[![license](https://img.shields.io/github/license/bbrks/shotgun.svg)](https://github.com/bbrks/shotgun/blob/master/LICENSE)Take the shotgun approach to your terminal. :boom:
## Installation/Updating
```sh
$ go install github.com/bbrks/shotgun@latest
```## Why?
Imagine you're working on a system with 20, 50, 100, or more microservices, all in separate repositories.
How do you update them all at once? Easy.```sh
$ shotgun git pull
```What about removing all local changes and syncing with the remote master branches?
```sh
$ shotgun 'git fetch origin; git reset --hard origin/master; git clean -f'
```Not convinced yet? See just how fast running commands in parallel vs. sequentially actually is:
## Usage
[embedmd]:# (doc.go /\/\*/ /\*\//)
```go
/*Shotgun is a tool for running commands in parallel on a set of directories.
Usage:
shotgun [options] commandOptions:
-d directory
Working directory - search from here (default ".")
-f regexp
Filter directories by RE2 regexp (default ".*")
-c number
Maximum number of concurrent commands (default 64)
-v
Print all lines of command output
-dry
Print what would be run where, without actually doing it
-version
Print version and exitExamples:
shotgun git pull
Run a command in each child directory of the currentshotgun -f '^a' git pull
Run a command in each directory beginning with the letter 'a'shotgun -d $GOPATH/src/github.com/bbrks git status --short
Run a command for each directory in '$GOPATH/src/github.com/bbrks'shotgun 'git checkout -- .; git checkout develop; git fetch; git pull'
Wrap commands in quotes and separate by semicolons to chain sequentiallyshotgun -dry 'rm .travis.yml'
Print what would be run where*/
```## License
This project is licensed under the [MIT License](LICENSE).