Skip to content

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.

Open Obsidian

On-Demand
ts
import { open } from 'protocol-launcher/obsidian'

const url = open()

Open Note

Open a specific note in Obsidian.

On-Demand
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.

On-Demand
ts
import { newNote } from 'protocol-launcher/obsidian'

const url = newNote({
  vault: 'My Vault',
  name: 'New Note',
  content: 'Hello World',
})

Search for notes in Obsidian.

On-Demand
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.

On-Demand
ts
import { insert } from 'protocol-launcher/obsidian'

const url = insert({
  vault: 'My Vault',
  content: '## Heading',
})

Command

Execute a command in Obsidian.

On-Demand
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.

On-Demand
ts
import { options } from 'protocol-launcher/obsidian'

const url = options({
  vault: 'My Vault',
})

Settings

Open Obsidian settings.

On-Demand
ts
import { settings } from 'protocol-launcher/obsidian'

const url = settings({
  vault: 'My Vault',
  page: 'editor',
})