@hastycapybara/tasks-api
v1.1.9
Published
TypeScript types for the public API of the Tasks for Markdown VS Code/Cursor extension (getAPI(1)): queries, edits, notes, events. Types only — no runtime code.
Maintainers
Readme
@hastycapybara/tasks-api
TypeScript types for the public API of Tasks for Markdown, the Obsidian Tasks-compatible task manager for VS Code and Cursor. Types only — the API itself is provided by the installed extension.
npm i -D @hastycapybara/tasks-apiimport * as vscode from 'vscode';
import type { TasksExtensionExports, TasksApi } from '@hastycapybara/tasks-api';
const ext = vscode.extensions.getExtension<TasksExtensionExports>('HastyCapybara.tasks-for-markdown');
if (!ext) throw new Error('Tasks for Markdown is not installed');
const tasks: TasksApi = (await ext.activate()).getAPI(1, { extensionId: 'my-publisher.my-extension' });
const due = await tasks.query.run('not done\ndue before tomorrow\nsort by urgency');
if (tasks.features.includes('notes.add')) await tasks.edit.addNote({ path: due.tasks[0].path, line: due.tasks[0].line }, 'Started');Check optional capabilities with tasks.features (or await tasks.info()), not by version number. For example links (1.1.0) adds ui.link(ref), which returns a vscode:// / cursor:// link that opens the task from any app.
- API reference: docs/api.en.md (Korean: docs/api.md)
- The same types are in the repository as one self-contained file: src/api/types.ts
- Outside the editor, use the CLI / MCP server
@hastycapybara/tasks-clior the library@hastycapybara/tasks-core.
MIT. Task syntax and query language come from Obsidian Tasks (MIT); see NOTICE.md.
