Separate out cli tool from lib