fix(cli): detect existence before readJSON

Close #1102