parse commands from stdin