pcmd is a Go program that executes commands defined in a YAML file concurrently, with colorful output for each command.
This program was made to simplify the process of running multiple long-running commands concurrently, while still being able to distinguish between the output of each command.
Install pcmd either through the GitHub releases page or by building from source.
Download the latest release from the GitHub releases page and extract the binary for your system.
- Run
go install github.com/fieu/pcmd@latest
- The binary will be installed to
$GOPATH/bin
(e.g.~/go/bin
)
- Go 1.16 or later
- GNU Make
- Clone the repository using
git clone https://github.com/fieu/pcmd.git
- Build the binary using
make build
- Move the compiled binary to a directory in your
PATH
(e.g./usr/local/bin
) - Make the binary executable using
chmod +x pcmd
To use pcmd, create a YAML file (pcmd.yml
) with the following structure:
- name: System Log
command: tail -f /var/log/system.log
- name: WiFi
command: tail -f /var/log/wifi.log
Each command consists of a name
and a command
field. Customize the commands as per your requirements.
Once you have the YAML file set up, run pcmd using the following command in the same directory as the YAML file:
pcmd
pcmd will read the YAML file, execute the commands concurrently, and display the output with colorful prefixes for each command.
Both stdout and stderr are displayed in the output. If a program exits, pcmd will display the exit code.
Contributions are welcome! If you find any issues or have suggestions, please open an issue or a pull request.
pcmd is licensed under the MIT License. See LICENSE for more information.