class MyInterpreter(cmd.Cmd):

    def do_level1(self, args):
        pass

def do_level2_subcommand_1(self, args):
    pass

def do_level2_subcommand_2(self, args):
    pass

def do_level3_subcommand_1(self, args):
    pass
Как сделать многоуровневый интерфейс командной строки в Python?