expose cmd function