Add CLI support.

Initial work on CLI support.