diff --git a/cfg_checker/cli/command.py b/cfg_checker/cli/command.py
new file mode 100644
index 0000000..0a9c2a2
--- /dev/null
+++ b/cfg_checker/cli/command.py
@@ -0,0 +1,59 @@
+import sys
+import traceback
+
+from cfg_checker.common import logger_cli
+from cfg_checker.common.exception import CheckerException
+
+# TODO: auto-create types for each command
+package_command_types = ['report']
+network_command_types = ['check', 'report']
+reclass_command_types = ['list', 'diff']
+
+commands = {
+    'packages': package_command_types,
+    'network': network_command_types,
+    'reclass': reclass_command_types
+}
+
+
+def execute_command(args, command):
+    # Validate the commands
+    # check command
+    if command not in commands:
+        logger_cli.info("\n# Please, type a command listed above")
+        return 0
+    elif args.type not in commands[command]:
+        # check type
+        logger_cli.info(
+            "\n# Please, select '{}' command type listed above".format(
+                command
+            )
+        )
+        return 0
+    else:
+        # form function name to call
+        _method_name = "do_" + args.type
+        _target_module = __import__(
+            "cfg_checker.modules."+command,
+            fromlist=[""]
+        )
+        _method = getattr(_target_module, _method_name)
+
+    # Execute the command
+    try:
+        _method(args)
+        return 0
+    except CheckerException as e:
+        logger_cli.error("\nERROR: {}".format(
+            e.message
+        ))
+
+        exc_type, exc_value, exc_traceback = sys.exc_info()
+        logger_cli.debug("\n{}".format(
+            "".join(traceback.format_exception(
+                exc_type,
+                exc_value,
+                exc_traceback
+            ))
+        ))
+        return 1
diff --git a/cfg_checker/cli/network.py b/cfg_checker/cli/network.py
index 4d6d0c4..b53311d 100644
--- a/cfg_checker/cli/network.py
+++ b/cfg_checker/cli/network.py
@@ -1,14 +1,59 @@
-from cfg_checker.modules.network.checker import NetworkChecker
+import sys
+
+from cfg_checker.common import config, logger, logger_cli
+from cfg_checker.helpers.args_utils import MyParser
+
+from command import execute_command
+
+
+def init_network_parser(_parser):
+    # network subparser
+    net_subparsers = _parser.add_subparsers(dest='type')
+
+    net_check_parser = net_subparsers.add_parser(
+        'check',
+        help="Do network check and print the result"
+    )
+
+    net_check_parser.add_argument(
+        '--detailed',
+        action="store_true", default=False,
+        help="Print error details after summary"
+    )
+
+    net_report_parser = net_subparsers.add_parser(
+        'report',
+        help="Generate network check report"
+    )
+
+    net_report_parser.add_argument(
+        '--html',
+        metavar='network_html_filename',
+        help="HTML filename to save report"
+    )
+
+    return _parser
+
+
+def cli_network():
+    net_parser = MyParser("# Mirantis Cloud Network checker")
+    init_network_parser(net_parser)
+
+    # parse arguments
+    try:
+        args = net_parser.parse_args()
+    except TypeError:
+        logger_cli.info("\n# Please, check arguments")
+        sys.exit(0)
+
+    # force use of sudo
+    config.ssh_uses_sudo = True
+
+    # Execute the command
+    result = execute_command(args, 'network')
+    logger.debug(result)
+    sys.exit(result)
+
 
 if __name__ == '__main__':
-    # init connection to salt and collect minion data
-    cl = NetworkChecker()
-
-    # collect data on installed packages
-    cl.collect_network_info()
-
-    # diff installed and candidates
-    # cl.collect_packages()
-
-    # report it
-    cl.create_html_report("./pkg_versions.html")
+    cli_network()
diff --git a/cfg_checker/cli/package.py b/cfg_checker/cli/package.py
index 74166be..5fe7e0b 100644
--- a/cfg_checker/cli/package.py
+++ b/cfg_checker/cli/package.py
@@ -1,15 +1,57 @@
-from cfg_checker.modules.packages.checker import CloudPackageChecker
+import sys
+
+from cfg_checker.common import config, logger, logger_cli
+from cfg_checker.helpers.args_utils import MyParser
+
+from command import execute_command
+
+
+def init_package_parser(_parser):
+    # packages subparser
+    pkg_subparsers = _parser.add_subparsers(dest='type')
+
+    pkg_report_parser = pkg_subparsers.add_parser(
+        'report',
+        help="Report package versions to HTML file"
+    )
+    pkg_report_parser.add_argument(
+        '--full',
+        action="store_true", default=False,
+        help="HTML report will have all of the packages, not just errors"
+    )
+    pkg_report_parser.add_argument(
+        '--html',
+        metavar='packages_html_filename',
+        help="HTML filename to save report"
+    )
+    pkg_report_parser.add_argument(
+        '--csv',
+        metavar='packages_csv_filename',
+        help="CSV filename to save report"
+    )
+
+    return _parser
+
+
+def cli_package():
+    pkg_parser = MyParser("# Mirantis Cloud Package checker")
+    init_package_parser(pkg_parser)
+
+    # parse arguments
+    try:
+        args = pkg_parser.parse_args()
+    except TypeError:
+        logger_cli.info("\n# Please, check arguments")
+        sys.exit(0)
+
+    # force use of sudo
+    config.ssh_uses_sudo = True
+
+    # Execute the command
+    result = execute_command(args, 'packages')
+    logger.debug(result)
+    sys.exit(result)
 
 
 if __name__ == '__main__':
-    # init connection to salt and collect minion data
-    cl = CloudPackageChecker()
-
-    # collect data on installed packages
-    cl.collect_installed_packages()
-
-    # diff installed and candidates
-    # cl.collect_packages()
-
-    # report it
-    cl.create_html_report("./pkg_versions.html")
+    cli_package()
diff --git a/cfg_checker/cli/reclass.py b/cfg_checker/cli/reclass.py
index 2959bf3..fc5961a 100644
--- a/cfg_checker/cli/reclass.py
+++ b/cfg_checker/cli/reclass.py
@@ -1,6 +1,67 @@
-from cfg_checker.modules.reclass.comparer import ModelComparer
+import sys
+
+from cfg_checker.common import config, logger, logger_cli
+from cfg_checker.helpers.args_utils import MyParser
+
+from command import execute_command
+
+
+def init_reclass_parser(_parser):
+    # reclass subparsers
+    reclass_subparsers = _parser.add_subparsers(dest='type')
+    reclass_list_parser = reclass_subparsers.add_parser(
+        'list',
+        help="List models available to compare"
+    )
+    reclass_list_parser.add_argument(
+        "-p",
+        "--models-path",
+        default="/srv/salt/",
+        help="Global path to search models in"
+    )
+
+    reclass_diff_parser = reclass_subparsers.add_parser(
+        'diff',
+        help="List models available to compare"
+    )
+    reclass_diff_parser.add_argument(
+        "--model1",
+        required=True,
+        help="Model A <path>. Model name is the folder name"
+    )
+    reclass_diff_parser.add_argument(
+        "--model2",
+        required=True,
+        help="Model B <path>. Model name is the folder name"
+    )
+    reclass_diff_parser.add_argument(
+        '--html',
+        metavar='reclass_html_filename',
+        help="HTML filename to save report"
+    )
+
+    return _parser
+
+
+def cli_reclass():
+    net_parser = MyParser("# Mirantis Cloud Reclass comparer")
+    init_reclass_parser(net_parser)
+
+    # parse arguments
+    try:
+        args = net_parser.parse_args()
+    except TypeError:
+        logger_cli.info("\n# Please, check arguments")
+        sys.exit(0)
+
+    # force use of sudo
+    config.ssh_uses_sudo = True
+
+    # Execute the command
+    result = execute_command(args, 'reclass')
+    logger.debug(result)
+    sys.exit(result)
+
 
 if __name__ == "__main__":
-    # Execute the comparison using argv params
-
-    pass
+    cli_reclass()
