By commands do you mean you want to call the methods in a class?
If you have a reference to the Main class, you can call methods in that class.
For example in one of the Maintain class's methods:...