This is no good. The code from above will be ran before the WP-CLI command even has a chance to be registered.