Merge "Finish implementation of "cmd"."