Turns out writing a WP-CLI plugin (for my sins, in php) is not a road well travelled or sign-posted. Sigh.