moved init to lib, integrated cli init