full autodetection of cli interface using json if available and fixes for json support detection