Simple juju watch plugin

In my day-to-day work I frequently find myself deploying the services I'm working on to an lxd juju backend in order to test charm changes. The ability to deploy complex software configurations to lxd containers on my laptop makes developing a product with a distributed architecture much easier. However, I found myself running juju status over and over again to see if it was finished yet (my Internet connection isn't great - downloading packages for installation can sometimes take ~ 10 minutes).

Eventually I decided to come up with a better solution. Thankfully juju's plugin architecture makes this easy. To create a new juju "command", you simply need an executable in yout $PATH named juju-<command>. I quickly created ~/bin/juju-watch, made it executable, and pasted the following into the file:


watch -c juju status --color doesn't get much simpler than that!

Now I can run juju watch whenever I have a juju deployment in progress that I want to monitor. For example, here's a screenshot of me monitoring a service deployment:

A screenshot of 'juju watch' in action.

This style of plugin architecture is really nice: I can create a plugin for juju in any language. The fact that juju commands like juju status can be told to output information in a machine readable format makes this especially powerful.

Let me know if you find this useful, or if you have any of your own custom plugins.