How i can solve this error ? I will put my main.php im brazillian, so i making my plugin in portuguese
This one is easy, every variable should be defined somewhere. Can you find where $cmd is? Rename $cmd to $command, because that is what you get in the method parameters!
The problem is just, you defined Command as $command in the function parameters and you switched $cmd which is a undefined variable! To fix it, you'll have to switch $command->getName() instead.