note commands#
Note commands modify the index by creating or updating notes.
create note#
Creates a note at a specified directory, and updates the index. Returns the path to the created note. The note content is generated from a template.
Method: note/create
Params:
| Field | Type | Description |
|---|---|---|
title | string | Title for the new note. Used in frontmatter and converted to a slug for the filename. |
templateName | string | Name of the template the note will use. |
directory | string | The directory the note will be placed in, relative to the vault root. |
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "note/create",
"params": {
"title": "dendrite is helping my workflow",
"templateName": "log",
"directory": "worklogs"
}
}Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": "~/vault/worklogs/dendrite-is-helping-my-workflow.md"
}The client can then open the newly created note in a buffer.
save note#
Reads the note corresponding to the supplied path. Wipes the note from the index, if it exists, and does a reindex of the note.
Method: note/save
Params:
| Field | Type | Description |
|---|---|---|
path | string | path to the note to save |
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "note/save",
"params": {
"path": "~/vault/worklogs/dendrite-is-helping-my-workflow.md"
}
}Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}delete note#
Removes a note from the index along with all its associated metadata (links and tags). The note file itself is not deleted from disk.
This command is intended for callers that have their own file-deletion mechanism and can issue the command immediately after deleting a file. Clients that cannot reliably hook into file deletion should use vault/rebuild to re-sync the index instead.
Method: note/delete
Params:
| Field | Type | Description |
|---|---|---|
path | string | Absolute path to the note to remove from the index. |
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "note/delete",
"params": {
"path": "~/vault/worklogs/dendrite-is-helping-my-workflow.md"
}
}Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}