change cli to support piping and easier cmd execution