module Bundler::Thor::Base::ClassMethods

def no_commands


end
remove_command :this_is_not_a_command
end
def this_is_not_a_command
class MyScript < Bundler::Thor

You can also add the method and remove it from the command list:

end
end
end
def this_is_not_a_command
no_commands do
class MyScript < Bundler::Thor

So you can do:

All methods defined inside the given block are not added as commands.
def no_commands
  @no_commands = true
  yield
ensure
  @no_commands = false
end