run-pty - a lightweight process supervisor
Last year, when I was starting to work on a new Go project at work, I was looking for a lightweight tool that would let me run a few file watchers, like gow and templ generate -watch, in parallel in a single terminal tab with easy access to their logs. I wanted to see how far I could get without using Docker, even though I don’t really have anything against it, and was already planning to invest in an OrbStack license - more on that in a different post.
It was then that I found out about Simon’s run-pty. It’s a nifty little TUI tool. Shell commands, which it should run, can be passed to it as positional arguments, or through a JSON-based configuration file, which is considered advanced usage. I’ve turned to that one pretty much right away because of the complexity of commands I was running, and I was running quite a few of them, which made the possitional alternative less appealing.
Compared to possitional arguments, the JSON configuration file lets you set additional options per command, like the working directory, and you can do preprocessing on it with tools like jq, which can come in handy in certain situations.
The only thing that I’m missing from it is the ability to be able to accept the JSON configuration file content through standard input, but it’s apparently not possible, because it’s used for input (key stroke) handling. See this issue for details.
I recommend that you read through the README of the repository for a proper introduction if you’re interested. It’s very well written.