Long terminal command finished? See it on your matrix
Builds, test runs, model training, big downloads: get told when they end and how.
Start a long build, go make tea, and the matrix tells you whether it worked. Put onmatrix in front of any command: it runs the command, then shows its name in green if it succeeded or in red with the exit code if it failed.
What your matrix shows
Plain text. Illustration; the real effect is animated.
What you need
- macOS or Linux with zsh or bash, and the pipplee helper from the setup guide.
- Your Authorization value from the setup guide (about 5 minutes).
Set it up
1. Add the function
Add this to ~/.zshrc (or ~/.bashrc) and open a new terminal.
# Run a command, then show on the matrix how it ended.
onmatrix() {
"$@"
code=$?
if [ "$code" -eq 0 ]; then
"$HOME/.local/bin/pipplee" "Done: $1" 51cf66 "" 20
else
"$HOME/.local/bin/pipplee" "Failed: $1 ($code)" ff6b6b fireworks 120
fi
return "$code"
}
2. Use it
Put onmatrix in front of the command.
onmatrix npm run build
onmatrix pytest
onmatrix python train.py --epochs 50
How it works
- onmatrix runs the command exactly as you typed it, with its normal output.
- When it ends, the helper sends one message: green "Done" or red "Failed" with the exit code.
- The command's exit code is passed on, so onmatrix works in scripts and && chains.
Variations
Forgot to add it?
If a command is already running, type this and press Enter. It runs as soon as the command ends.
pipplee "Finished" 2fd3e8
Questions
Does it work over SSH?
Yes, if the pipplee helper and auth file are on the machine where the command runs. The request goes from that machine to Pipplee Cloud, not to your matrix directly.