# @obsidian-api/sdk TypeScript SDK for this HTTP wrapper around the **official Obsidian CLI**. The SDK is built for Node 18+, n8n Code nodes, Prism, and other TypeScript agent harnesses. ## Install locally ```bash npm install /path/to/obsidian-api/sdk/typescript ``` ## Usage ```ts import { ObsidianCliClient } from '@obsidian-api/sdk'; const obsidian = new ObsidianCliClient({ baseUrl: 'http://localhost:8080', token: 'change-me', }); await obsidian.create({ path: 'Inbox/Hello.md', content: '# Hello from n8n/Prism', overwrite: true, }); const note = await obsidian.read({ path: 'Inbox/Hello.md' }); console.log(note.stdout); const results = await obsidian.search('Hello', { format: 'json' }); console.log(JSON.parse(results.stdout)); ``` ## Multiple vaults Use the official CLI `vault=` prefix directly: ```ts await obsidian.runInVault('work', 'create', 'path=Inbox/Task.md', 'content=Hello'); ``` Or create a scoped client: ```ts const workVault = obsidian.inVault('work'); await workVault.create({ path: 'Inbox/Task.md', content: 'Hello', overwrite: true }); await workVault.read({ path: 'Inbox/Task.md' }); ``` You can also set a default vault in the constructor: ```ts const obsidian = new ObsidianCliClient({ baseUrl: 'http://localhost:8080', token: 'change-me', vault: 'work', }); ``` ## Raw command escape hatch Still safe: sends an args array, not a shell command string. ```ts await obsidian.runRaw('create', 'name=Scratch', 'content=Test', 'overwrite'); ```