Move cli-specific code into src/cli