Using Obsidian's protocol handler, BRAT can be invoked from within or outside of Obsidian. This specially formatted URL will open a plugin or theme repository for installation within BRAT. To use this feature, create a URL with the following format: `obsidian://brat?<command>=<repository>` The protocol handler has the following elements: - starts with `obsidian://` - Followed by `brat?`, - Followed by the `command`, which is either `plugin` or `theme`. - `plugin` means the following GitHub repository is either a plugin - `theme` means the following GitHub repository is either a theme - Followed by the `repository`, which is the URL to the GitHub repository. Review the following examples to see how this works. # Plugin Example The following is an example of using the protocol for a link to install the Meta Bind plugin: ``` obsidian://brat?plugin=https://github.com/mProjectsCode/obsidian-meta-bind-plugin ``` Go ahead and give it a try: [Click me to install the Meta Bind plugin](obsidian://brat?plugin=https://github.com/mProjectsCode/obsidian-meta-bind-plugin) You can also use the shorthand version of the URL and remove `https://githbut.com/`, as shown here: ``` obsidian://brat?plugin=mProjectsCode/obsidian-meta-bind-plugin ``` Go ahead and give it a try: [Click me to install the Meta Bind plugin](obsidian://brat?plugin=mProjectsCode/obsidian-meta-bind-plugin) # Theme Example The following is an example of using the protocol for a link to install the Gruvbox theme: ``` obsidian://brat?theme=https://github.com/insanum/obsidian_gruvbox ``` Go ahead and give it a try: [Click me to install the Gruvbox theme](obsidian://brat?theme=https://github.com/insanum/obsidian_gruvbox) # Enabling and Disabling Plugins Some have asked if this can also be done via BRAT as a protocol handler. This functionality already exists in the [Advanced URI plugin](https://obsidian.md/plugins?id=obsidian-advanced-uri), which is documented [here](https://publish.obsidian.md/advanced-uri-doc/Actions/Miscellaneous) with the `enable-plugin` and `disable-plugin` commands. ## Disabling a plugin To disable a plugin, use the command like this: `[Disable](obsidian://advanced-uri?disable-plugin=obsidian42-brat)` ## Enabling a plugin To enable a plugin, you would do this: `[Enable](obsidian://advanced-uri?enable-plugin=obsidian42-brat)` However, this did not work for me for some plugins, so an alternative is to turn on "Allow executing arbitrary code via eval" and then use: `[Enable](obsidian://advanced-uri?eval=app.plugins.enablePluginAndSave("obsidian42-brat"))` ![[promo-embed-home]]