code: def add_plugin(plugin, directory=None):
      
      repo = require_repo(directory)
      plugins = get_value(repo, 'plugins', expect_type=dict)
      if plugin in plugins:
          return False
  
      plugins[plugin] = {}
      set_value(repo, 'plugins', plugins)
      return True
docs: Adds the specified plugin. This returns False if it was already added.