I think it's nice to have them defined in a separate file. It keeps the code clean, and it makes debugging a bit easier (being able to fire up a REPL and have access to the commands).