[PATCH v2 1/7] cli: allow query to come from stdin