English
Obsidian
Obsidian is a powerful knowledge base that works on top of a local folder of plain text Markdown files. Protocol Launcher allows you to generate deep links to open notes, create new notes, search, and execute commands in Obsidian.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.
openNote and newNote support path and paneType (tab, split, window; window is desktop-only). Obsidian gives path precedence over vault and file. newNote accepts file, path, paneType, clipboard, silent, overwrite, and xSuccess; use silent: true to create without opening. Existing plugin-related helpers remain available, but are outside the core URI documentation.
Open Obsidian
ts
import { open } from 'protocol-launcher/obsidian'
const url = open()Open Note
Open a specific note in Obsidian.
ts
import { openNote } from 'protocol-launcher/obsidian'
const url = openNote({
vault: 'My Vault',
file: 'Notes/Meeting.md',
})New Note
Create a new note in Obsidian.
ts
import { newNote } from 'protocol-launcher/obsidian'
const url = newNote({
vault: 'My Vault',
name: 'New Note',
content: 'Hello World',
})Search
Search for notes in Obsidian.
ts
import { search } from 'protocol-launcher/obsidian'
const url = search({
vault: 'My Vault',
query: 'meeting notes',
})Insert
Insert content into the current note in Obsidian.
ts
import { insert } from 'protocol-launcher/obsidian'
const url = insert({
vault: 'My Vault',
content: '## Heading',
})Command
Execute a command in Obsidian.
ts
import { command } from 'protocol-launcher/obsidian'
const url = command({
vault: 'My Vault',
id: 'editor:save-file',
})Options
Open Obsidian options (quick settings) for a vault.
ts
import { options } from 'protocol-launcher/obsidian'
const url = options({
vault: 'My Vault',
})Settings
Open Obsidian settings.
ts
import { settings } from 'protocol-launcher/obsidian'
const url = settings({
vault: 'My Vault',
page: 'editor',
})Daily Note
Create or open the daily note. Requires the Daily notes core plugin. Supports the parameters of the new action.
ts
import { dailyNote } from 'protocol-launcher/obsidian'
const url = dailyNote({
vault: 'My Vault',
content: 'Daily notes',
append: true
})Unique Note
Create a unique note with the Unique note creator core plugin enabled.
ts
import { uniqueNote } from 'protocol-launcher/obsidian'
const url = uniqueNote({
vault: 'My Vault',
content: 'Hello World'
})Vault Manager
Open the vault manager.
ts
import { chooseVault } from 'protocol-launcher/obsidian'
const url = chooseVault()Get Address for Hook
Return the focused note address to Hook. Without callbacks, copy its Markdown link to the clipboard.
ts
import { hookGetAddress } from 'protocol-launcher/obsidian'
const url = hookGetAddress({
xSuccess: 'hook://x-callback-url/setCurrentNode'
})