Construct an ObsidianLauncher.
Optional
cacheDir?: stringPath to the cache directory. Defaults to "OBSIDIAN_CACHE" env var or ".obsidian-cache".
Optional
versionsUrl?: stringCustom obsidian-versions.json
url. Can be a file URL.
Optional
communityPluginsUrl?: stringCustom community-plugins.json
url. Can be a file URL.
Optional
communityThemesUrl?: stringCustom community-css-themes.json
url. Can be a file URL.
Optional
cacheDuration?: numberIf the cached version list is older than this (in ms), refetch it. Defaults to 30 minutes.
Optional
interactive?: booleanIf it can prompt the user for input (e.g. for Obsidian credentials). Default false.
Readonly
cacheReadonly
versionsReadonly
communityReadonly
communityReadonly
cacheReadonly
interactiveGet information about all available Obsidian versions.
Get information about all available community plugins.
Get information about all available community themes.
Resolves Obsidian app and installer version strings to absolute versions.
specific version or one of
minAppVersion
set in your manifest.json
specific version or one of
appVersion
appVersion
See also: Obsidian App vs Installer Versions
[appVersion, installerVersion] with any "latest" etc. resolved to specific versions.
Gets details about an Obsidian version.
Obsidian app version
Parses a string of Obsidian versions into [appVersion, installerVersion] tuples.
versions
should be a space separated list of Obsidian app versions. You can optionally specify the installer
version by using "appVersion/installerVersion" e.g. "1.7.7/1.8.10"
.
Example:
launcher.parseVersions("1.8.10/1.7.7 latest latest-beta/earliest")
See also: Obsidian App vs Installer Versions
string to parse
[appVersion, installerVersion][] resolved to specific versions.
Gets details about the Obsidian installer for the given platform.
Obsidian installer version
Optional
platform?: PlatformPlatform/os (defaults to host platform)
Optional
arch?: ArchitectureArchitecture (defaults to host architecture)
Downloads the Obsidian installer for the given version and platform/arch (defaults to host platform/arch). Returns the file path.
Obsidian installer version to download
Optional
platform?: PlatformPlatform/os of the installer to download (defaults to host platform)
Optional
arch?: ArchitectureArchitecture of the installer to download (defaults to host architecture)
Downloads the Obsidian asar for the given version. Returns the file path.
To download Obsidian beta versions you'll need to have an Obsidian Insiders account and either set the
OBSIDIAN_EMAIL
and OBSIDIAN_PASSWORD
env vars (.env
file is supported) or pre-download the Obsidian beta
with npx obsidian-launcher download app -v latest-beta
Obsidian version to download
Downloads chromedriver for the given Obsidian version.
wdio will download chromedriver from the Chrome for Testing API automatically (see https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints). However, Google has only put chromedriver since v115.0.5763.0 in that API, so wdio can't automatically download older versions of chromedriver for old Electron versions. Here we download chromedriver for older versions ourselves using the @electron/get package which fetches chromedriver from https://github.com/electron/electron/releases.
Obsidian installer version
Downloads the Obsidian apk.
Downloads a list of plugins to the cache and returns a list of DownloadedPluginEntry with the downloaded
paths. Also adds the id
property to the plugins based on the manifest.
You can download plugins from GitHub using {repo: "org/repo"}
and community plugins using {id: 'plugin-id'}
.
Local plugins will just be passed through.
List of plugins to download.
Installs plugins into an Obsidian vault
Path to the vault to install the plugins in
List plugins to install
Downloads a list of themes to the cache and returns a list of DownloadedThemeEntry with the downloaded
paths. Also adds the name
property to the plugins based on the manifest.
You can download themes from GitHub using {repo: "org/repo"}
and community themes using {name: 'theme-name'}
.
Local themes will just be passed through.
List of themes to download
Installs themes into an Obsidian vault
Path to the theme to install the themes in
List of themes to install
Sets up the config dir to use for the --user-data-dir
in obsidian. Returns the path to the created config dir.
Obsidian app version
Obsidian version string.
Optional
appPath?: stringPath to the asar file to install. Will download if omitted.
Optional
vault?: stringPath to the vault to open in Obsidian
Optional
localStorage?: Record<string, string>items to add to localStorage. $vaultId
in the keys will be replaced with the vaultId
Optional
chromePreferences?: Record<string, any>Chrome preferences to add to the Preferences file
Sets up a vault for Obsidian, installing plugins and themes and optionally copying the vault to a temporary directory first.
Path to the vault to open in Obsidian
Optional
copy?: booleanWhether to copy the vault to a tmpdir first. Default false
Optional
plugins?: PluginEntry[]List of plugins to install in the vault
Optional
themes?: ThemeEntry[]List of themes to install in the vault
Path to the copied vault (or just the path to the vault if copy is false)
Downloads and launches Obsidian with a sandboxed config dir and a specifc vault open. Optionally install plugins and themes first.
Optional
appVersion?: stringObsidian app version. Default "latest"
Optional
installerVersion?: stringObsidian installer version. Default "latest"
Optional
copy?: booleanWhether to copy the vault to a tmpdir first. Default false
Optional
vault?: stringPath to the vault to open in Obsidian
Optional
plugins?: PluginEntry[]List of plugins to install in the vault
Optional
themes?: ThemeEntry[]List of themes to install in the vault
Optional
args?: string[]CLI args to pass to Obsidian
Optional
localStorage?: Record<string, string>items to add to localStorage. $vaultId
in the keys will be replaced with the vaultId
Optional
spawnOptions?: SpawnOptionsOptions to pass to spawn
The launched child process and the created tmpdirs
Updates the info in obsidian-versions.json. The obsidian-versions.json file is used in other launcher commands and in wdio-obsidian-service to get metadata about Obsidian versions in one place such as minInstallerVersion and the internal Electron version.
Optional
original: ObsidianVersionListReturns true if the Obsidian version is already in the cache.
on of "app" or "installer"
Obsidian app/installer version
Returns true if we either have the credentials to download the version or it's already in cache. This is only relevant for Obsidian beta versions, as they require Obsidian insider credentials to download.
Obsidian app version
The
ObsidianLauncher
class.Helper class that handles downloading and installing Obsidian versions, plugins, and themes and launching Obsidian with sandboxed configuration directories.