Skip to content

community-plugins

Resolves, searches and manages community plugins through Obsidian’s public plugin registry and store-install path.

Obsidian’s community-plugins.json is the authoritative source that maps a plugin id to its owner/name GitHub repository — the plugin manifest itself carries no repository. This module uses it to search the registry, to locate a plugin’s GitHub releases (e.g. to download its shipped demo-vault archive), and to install/update/uninstall/enable/disable an arbitrary community plugin — selected by either its id or its display name — via Obsidian’s own store path (app.plugins.installPlugin + enablePluginAndSave), so any dev/deploy or tooling flow can reuse it.

Interface Description
CommunityPluginSearchResult A single result of searchCommunityPlugins.
Function Description
configureCommunityPlugin Configures a community plugin, preferring the running plugin’s own settings component over its data.json. When the plugin is loaded AND exposes a pluginSettingsComponent with an editAndSave method, the settings are shallow-merged through it: they take effect immediately and are persisted, so the plugin needs no reload and ConfigureCommunityPluginResult.AppliedLive is returned. This is what lets a plugin’s own script reconfigure it without the disable/enable cycle that would tear down the very code doing the reconfiguring. Note that this path runs the plugin’s setting validators, so an invalid value is replaced by its default rather than written through verbatim. Otherwise the settings are written into the plugin’s data.json, shallow-merged over any existing settings (creating the file if absent). Writing settings BEFORE the plugin is enabled makes it load already configured, with no reload. A no-op write is skipped: when the merge changes nothing, the file is left untouched and ConfigureCommunityPluginResult.Skipped is returned, so a caller can avoid reloading an already-correctly-configured plugin.
disableCommunityPlugin Disables a community plugin (persisting the change) if it is currently enabled. Idempotent — a no-op when the plugin is already disabled.
enableCommunityPlugin Enables a community plugin (persisting the change) if it is not already enabled. Idempotent — a no-op when the plugin is already enabled.
getCommunityPluginRepo Resolves the owner/name GitHub repository of a community plugin from Obsidian’s public community-plugins.json registry. The registry is fetched once and cached on the shared plugin state for subsequent calls; a failed fetch is not cached, so a later call retries.
getLatestReleaseVersion Resolves the latest release version (the release tag_name, a bare version such as 1.2.3) of a GitHub repository.
installCommunityPlugin Installs a community plugin from the official store if it is not already installed. Idempotent — a no-op when the plugin is already installed. Resolves the plugin’s repository from Obsidian’s community registry, reads the latest release version and its manifest, and installs it through Obsidian’s own installPlugin path.
installConfigureEnableCommunityPlugin Installs a community plugin, writes its settings, THEN enables it — in that order — so the plugin loads already configured (a plugin enabled before it is configured runs its onload with default settings and does nothing useful). If the plugin is already enabled and the settings changed, it is disabled and re-enabled so the new settings take effect. settings is optional: omit it for a plugin that needs no configuration. Composes installCommunityPlugin, configureCommunityPlugin, enableCommunityPlugin and disableCommunityPlugin.
searchCommunityPlugins Searches Obsidian’s public community plugins registry, returning the id and display name of every plugin whose id, name, author or description contains the query (case-insensitive). An empty query matches every plugin.
toggleEnableCommunityPlugin Enables or disables a community plugin to match the desired state. Delegates to enableCommunityPlugin / disableCommunityPlugin, so it is idempotent.
toggleInstallCommunityPlugin Installs or uninstalls a community plugin to match the desired state. Delegates to installCommunityPlugin / uninstallCommunityPlugin, so it is idempotent.
uninstallCommunityPlugin Uninstalls a community plugin if it is currently installed. Idempotent — a no-op when the plugin is not installed.
updateCommunityPlugin Updates an installed community plugin to its latest release, the way the community plugin browser’s own Update button does. Obsidian’s installPlugin writes the release’s files over the installed copy and, when the plugin is running, disables and re-enables it so the new code loads — read from the shipped bundle (1.14.4), not assumed. It reports its own failures (a failed download, a manifest whose id does not match) as a notice and RETURNS rather than throwing, so the installed manifest is re-read afterwards and a version that did not move to the release is thrown as a failure.
Type Description
CommunityPluginRef Selects a community plugin either by its id (CommunityPluginByIdRef) or by its display name (CommunityPluginByNameRef).
ConfigureCommunityPluginParams Parameters for configureCommunityPlugin. Selects the plugin by either pluginId or pluginName.
DisableCommunityPluginParams Parameters for disableCommunityPlugin. Selects the plugin by either pluginId or pluginName.
EnableCommunityPluginParams Parameters for enableCommunityPlugin. Selects the plugin by either pluginId or pluginName.
InstallCommunityPluginParams Parameters for installCommunityPlugin. Selects the plugin by either pluginId or pluginName.
InstallConfigureEnableCommunityPluginParams Parameters for installConfigureEnableCommunityPlugin. Selects the plugin by either pluginId or pluginName; settings is optional (omit for a plugin that needs no configuration).
ToggleEnableCommunityPluginParams Parameters for toggleEnableCommunityPlugin. Selects the plugin by either pluginId or pluginName.
ToggleInstallCommunityPluginParams Parameters for toggleInstallCommunityPlugin. Selects the plugin by either pluginId or pluginName.
UninstallCommunityPluginParams Parameters for uninstallCommunityPlugin. Selects the plugin by either pluginId or pluginName.
UpdateCommunityPluginParams Parameters for updateCommunityPlugin. Selects the plugin by either pluginId or pluginName.
Enum Description
ConfigureCommunityPluginResult The result of configureCommunityPlugin.
UpdateCommunityPluginResult The result of updateCommunityPlugin.