add cli interface, avoid global variables