💥 A tool for running commands in parallel on a set of directories
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor/github.com/pkg/errors
.travis.yml
LICENSE
README.md
doc.go
flags.go
lock.json
logo.svg
main.go
manifest.json
run.go
run_windows.go
shotgun.go

README.md

Shotgun Logo

A tool for running commands in parallel on a set of directories.

Build Status GoDoc Go Report Card GitHub tag license

Take the shotgun approach to your terminal. 💥

Installation/Updating

$ go get -u github.com/bbrks/shotgun

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.

$ shotgun git pull

What about removing all local changes and syncing with the remote master branches?

$ 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

/*

Shotgun is a tool for running commands in parallel on a set of directories.

Usage:
	shotgun [options] command

Options:
	-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 exit

Examples:
	shotgun git pull
		Run a command in each child directory of the current

	shotgun -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 sequentially

	shotgun -dry 'rm .travis.yml'
		Print what would be run where

*/

License

This project is licensed under the MIT License.