in reply to how to deal with 20 commands

For an shell type CLI interface the package Term::ReadLine::Gnu may provide some useful tools.