[medium] use readline in console