cli: Move the KeyboardInterrupt handling.