Extract common code in command plugins to a base module