code for CLI