cli: fix tests & basic functionality