Home

Awesome

<p align="center"> <img width="96" height="96" src="./docs/96x96.png" alt="logo"> </p> <h1 align="center">shmux</h1> <p align="center"> Run multiple scripts from one file. In (almost) any language. </p> <p align="center"> <a href="https://asciinema.org/a/548928" target="_blank"> <img src="https://asciinema.org/a/548928.svg" height="288"/> </a> </p>

⚡️ Quick start

Installation

MacOS and Linux

sudo sh -c "curl -s https://shikaan.github.io/sup/install | REPO=shikaan/shmux sh -"

or

sudo sh -c "wget -q https://shikaan.github.io/sup/install -O- | REPO=shikaan/shmux sh -"

Windows and manual instructions

Head to the releases page and download the executable for your system and architecture.

Usage

shmux makes you execute different scripts in any scripting language from one one configuration file.

The scripts are called recipes and the configuration file is called shmuxfile.

Writing a recipe

For example, a shmuxfile.sh for a Go project might look like:

test:
  go test ./...

build:
  go generate
  GOOS=$1 go build

greet:
  echo "Hello $1, my old friend"

echo:
  echo "$@"  

The last two recipes could be also written in JavaScript like:

greet:
  #!/usr/bin/env node

  const friend = "$1"
  console.log(`Hello ${friend}, my old friend`)

echo:
  #!/usr/bin/env node

  console.log(`$@`)

Running a recipe

Running the recipes then is as simple as:

# Runs the test command
$ shmux test

# Runs the build command with "linux" as $1
$ shmux build -- "linux"

# Runs the greet command with "darkness" as $1
$ shmux greet -- "darkness" 
# => Hello darkness, my old friend

Recipe dependencies

Similar to a Makefile, recipes can have dependencies:

test:
  go test ./...

build: test
  go build
$ shmux build

Running shmux build will execute test before build.

📄 Documentation

More detailed documentation can be found here.

❓ FAQs

🤓 Contributing

Have a look through existing Issues and Pull Requests that you could help with. If you'd like to request a feature or report a bug, please create a GitHub Issue.

License

MIT