Obsidian SDK
Productivity

Daily

Programmatic access to daily notes, tasks, and template insertion.

Daily Module

Overview

The Daily module mirrors the Obsidian CLI daily family of commands, providing access to the daily note, its path, and its built‑in task system.

Quick Start

await obsidian.daily.open({ paneType: "tab" });
await obsidian.daily.addTask({ content: "Review SDK docs" });

Usage

MethodCLI CommandDescription
open(input?)obsidian dailyOpen today's daily note.
read()obsidian daily:readRetrieve raw markdown of the daily note.
append(input)obsidian daily:appendAppend text to the note.
prepend(input)obsidian daily:prependInsert text at the top.
path()obsidian daily:pathGet the filesystem path.
tasks(input?)obsidian tasks dailyReturn all tasks.
todo(input?)obsidian tasks daily todoReturn only incomplete tasks.
addTask(input)obsidian daily:addInsert a new task line.
markDone(input)obsidian task doneMark a task as completed.
markTodo(input)obsidian task todoRe‑open a completed task.
insertTemplate(input)obsidian template:insertInsert a template into the daily note.

Examples

Open in a Window

await obsidian.daily.open({ paneType: "window" });

Read Content

const content = await obsidian.daily.read();
console.log('Daily note content:', content);

Append and Prepend

await obsidian.daily.append({ content: "- Quick thought: refactor docs" });
await obsidian.daily.prepend({ content: "# Daily Summary" });

Task Management

await obsidian.daily.addTask({ content: "Write detailed docs" });
await obsidian.daily.addTask({ content: "Publish release notes", done: true });
await obsidian.daily.markDone({ ref: "2026-05-06.md:12" });
await obsidian.daily.markTodo({ ref: "2026-05-06.md:12" });

Insert Template

await obsidian.daily.insertTemplate({ name: "MorningAgenda" });

Error Handling

try {
  await obsidian.daily.markDone({ ref: "2026-05-06.md:999" });
} catch (e) {
  console.error('Failed to mark task done:', e.message);
}

Best Practices

  • Use addTask for programmatic task creation; keep ref format (path:line) stable.
  • Prefer append for quick notes, prepend for headers.
  • Store template names in a dedicated folder for consistency.

On this page