Konk runs a series of commands serially or concurrently. It is especially well-suited to running multiple npm scripts.
There are two npm packages I frequently already use for running npm scripts
serially or concurrently: npm-run-all and concurrently. I built konk because
I wanted something that could run serially and concurrently and did not need to
be installed as an npm package (note, however, that konk can be installed from
npm). In addition, I wanted to be able to use the same command line interface to
run processes defined in a Procfile. Finally, I have always been curious how to
build such a command line interface, so this is also a learning exercise for me.
There are currently feature gaps between npm-run-all and concurrently, but I
am working to fill them when I have time.
Install via Homebrew:
$ brew install jclem/tap/konkOr, use or install directly from npm:
$ npx konk      # Run from npm
$ npm i -g konk # Install from npmKonk is a tool for running multiple processes
  -D, --debug   debug mode
  -h, --help    help for konk
- konk completion - Generate the autocompletion script for the specified shell
- konk docs - Print documentation
- konk proc - Run commands defined in a Procfile (alias: p)
- konk run - Run commands serially or concurrently (alias: r)
Generate the autocompletion script for the specified shell
Generate the autocompletion script for konk for the specified shell. See each sub-command's help for details on how to use the generated script.
  -h, --help   help for completion
  -D, --debug   debug mode
- konk - Konk is a tool for running multiple processes
- konk completion bash - Generate the autocompletion script for bash
- konk completion fish - Generate the autocompletion script for fish
- konk completion powershell - Generate the autocompletion script for powershell
- konk completion zsh - Generate the autocompletion script for zsh
Generate the autocompletion script for bash
Generate the autocompletion script for the bash shell.
This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.
To load completions in your current shell session:
source <(konk completion bash)
To load completions for every new session, execute once:
konk completion bash > /etc/bash_completion.d/konk
konk completion bash > $(brew --prefix)/etc/bash_completion.d/konk
You will need to start a new shell for this setup to take effect.
konk completion bash
  -h, --help              help for bash
      --no-descriptions   disable completion descriptions
  -D, --debug   debug mode
- konk completion - Generate the autocompletion script for the specified shell
Generate the autocompletion script for fish
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
konk completion fish | source
To load completions for every new session, execute once:
konk completion fish > ~/.config/fish/completions/konk.fish
You will need to start a new shell for this setup to take effect.
konk completion fish [flags]
  -h, --help              help for fish
      --no-descriptions   disable completion descriptions
  -D, --debug   debug mode
- konk completion - Generate the autocompletion script for the specified shell
Generate the autocompletion script for powershell
Generate the autocompletion script for powershell.
To load completions in your current shell session:
konk completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command to your powershell profile.
konk completion powershell [flags]
  -h, --help              help for powershell
      --no-descriptions   disable completion descriptions
  -D, --debug   debug mode
- konk completion - Generate the autocompletion script for the specified shell
Generate the autocompletion script for zsh
Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
To load completions in your current shell session:
source <(konk completion zsh)
To load completions for every new session, execute once:
konk completion zsh > "${fpath[1]}/_konk"
konk completion zsh > $(brew --prefix)/share/zsh/site-functions/_konk
You will need to start a new shell for this setup to take effect.
konk completion zsh [flags]
  -h, --help              help for zsh
      --no-descriptions   disable completion descriptions
  -D, --debug   debug mode
- konk completion - Generate the autocompletion script for the specified shell
Print documentation
konk docs [flags]
  -f, --format string   output format (default "markdown")
  -h, --help            help for docs
  -D, --debug   debug mode
- konk - Konk is a tool for running multiple processes
Run commands defined in a Procfile (alias: p)
konk proc [flags]
  -c, --continue-on-error          continue running commands after a failure
  -e, --env-file string            Path to the env file (default ".env")
  -h, --help                       help for proc
  -C, --no-color                   do not colorize label output
  -E, --no-env-file                Don't load the env file
  -B, --no-label                   do not attach label/prefix to output
  -S, --no-subshell                do not run commands in a subshell
      --omit-env                   Omit any existing runtime environment variables
  -p, --procfile string            Path to the Procfile (default "Procfile")
  -w, --working-directory string   set the working directory for all commands
  -D, --debug   debug mode
- konk - Konk is a tool for running multiple processes
Run commands serially or concurrently (alias: r)
konk run <subcommand> [flags]
  -b, --bun                        Run npm commands with Bun
  -L, --command-as-label           use each command as its own label
  -c, --continue-on-error          continue running commands after a failure
  -h, --help                       help for run
  -l, --label stringArray          label prefix for the command
  -C, --no-color                   do not colorize label output
  -B, --no-label                   do not attach label/prefix to output
  -S, --no-subshell                do not run commands in a subshell
  -n, --npm stringArray            npm command
  -w, --working-directory string   set the working directory for all commands
  -D, --debug   debug mode
- konk - Konk is a tool for running multiple processes
- konk run concurrently - Run commands concurrently (alias: c)
- konk run serially - Run commands serially (alias: s)
Run commands concurrently (alias: c)
konk run concurrently <command...> [flags]
# Run two commands concurrently
konk run concurrently "script/api-server" "script/frontend-server"
# Run a set of npm commands concurrently
konk run concurrently -n lint -n test
# Run a set of npm commands concurrently, but aggregate their output
konk run concurrently -g -n lint -n test
# Run all npm commands prefixed with "check:" concurrently using Bun, ignore
# errors, aggregate output, and use the script name as the label
konk run concurrently -bgcL -n "check:*"
  -g, --aggregate-output   aggregate command output
  -h, --help               help for concurrently
  -b, --bun                        Run npm commands with Bun
  -L, --command-as-label           use each command as its own label
  -c, --continue-on-error          continue running commands after a failure
  -D, --debug                      debug mode
  -l, --label stringArray          label prefix for the command
  -C, --no-color                   do not colorize label output
  -B, --no-label                   do not attach label/prefix to output
  -S, --no-subshell                do not run commands in a subshell
  -n, --npm stringArray            npm command
  -w, --working-directory string   set the working directory for all commands
- konk run - Run commands serially or concurrently (alias: r)
Run commands serially (alias: s)
konk run serially <command...> [flags]
# Run two commands in serial
konk run serially "echo foo" "echo bar"
# Run a set of npm commands in serial
konk run serially -n build -n deploy
  -h, --help   help for serially
  -b, --bun                        Run npm commands with Bun
  -L, --command-as-label           use each command as its own label
  -c, --continue-on-error          continue running commands after a failure
  -D, --debug                      debug mode
  -l, --label stringArray          label prefix for the command
  -C, --no-color                   do not colorize label output
  -B, --no-label                   do not attach label/prefix to output
  -S, --no-subshell                do not run commands in a subshell
  -n, --npm stringArray            npm command
  -w, --working-directory string   set the working directory for all commands
- konk run - Run commands serially or concurrently (alias: r)