completion commands#

Completion commands are designed to feed editor completion engines. Both accept a partial query and return a list of matching strings, using a substring match against the index.


completion/slug#

Returns a list of note slugs whose title, path, or slug contains the query string. Intended to power [[link]] completion in the client editor.

Method: completion/slug

Params:

FieldTypeDescription
querystringPartial string to match against note title, path, and slug.

Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "completion/slug",
  "params": {
    "query": "distrib"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": ["distributed-systems", "distributed-consensus", "cap-theorem"]
}

Results are ordered by note creation date, newest first.


completion/tag#

Returns a list of tag names that contain the query string. Intended to power tag completion when editing note frontmatter.

Method: completion/tag

Params:

FieldTypeDescription
querystringPartial string to match against tag names.

Request:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "completion/tag",
  "params": {
    "query": "algo"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": ["algorithms", "algorithm-design"]
}

An empty query string matches all tags.