Processes `cli` input and replies with JSend compliant JSON response.