move CLI prototypes to cli.h and add comments