You’re reading the ZotLit v2 docs. Still on v1? Read the v1 docs

Simplified Chinese content is not ready. English content is shown.

Read in English
ZotLit

Commands

Every ZotLit command, its entry points, and its Obsidian CLI parameters.

This reference lists every ZotLit command, its entry points, availability, and Obsidian CLI parameters.

ZotLit is a desktop-only plugin. These commands are not available on Obsidian Mobile.

Database

ZotLit: 刷新 Zotero 数据库

Reloads the Zotero database from disk. Use this after making changes in Zotero when automatic watching is disabled.

Entry pointDetails
Command paletteAlways available

Update notes

ZotLit: 更新笔记

Opens the 更新笔记 dialog, the recommended place to start an update. 更新当前笔记 updates the active literature note and appears only when one is active. 更新全部笔记 updates all existing literature notes in your library scope. The checkbox 更新全部笔记时,也为没有笔记的条目创建笔记 is off by default; turn it on to also create notes for items that have none.

Entry pointDetails
Command paletteAlways available

The commands below stay available for keyboard shortcuts. ZotLit: 更新文献笔记 and ZotLit: 更新文献笔记元数据 run with no dialog. ZotLit: 覆盖文献笔记 and ZotLit: 创建或更新所有文献笔记 still ask for confirmation. A run that creates nothing reads 更新 … 篇文献笔记? and lists items without a note under 没有笔记 (…). The Zotero metadata batch works the same way.

Library-wide update

ZotLit: 创建或更新所有文献笔记

Creates or updates a literature note for every item in every library of your library scope. Opens the same batch confirmation modal as a multi-item update from Zotero.

Entry pointDetails
Command paletteAlways available
ZoteroRight-click a library or collection > ZotLit > 创建或更新文献笔记

The Zotero entry scopes the batch to the row you right-click: a library covers every item in it, a collection covers that collection and its subcollections. That target is exact, so it runs whether or not the row is in your library scope.

Library-wide note import

ZotLit: 导入所有子笔记和独立笔记

Imports all child notes attached to regular items and all standalone notes in every library of your library scope. Opens the same batch confirmation modal as a multi-note import from Zotero.

Entry pointDetails
Command paletteAlways available
ZoteroRight-click a library or collection > ZotLit > 导入子笔记与独立笔记

The Zotero entry scopes the import to the row you right-click, subcollections included. That target is exact, so it runs whether or not the row is in your library scope.

Library View

ZotLit: 打开 Zotero 文库

Opens the Library View, a tab titled Zotero 文库 that lists your Zotero library, and puts the cursor in its search box. If the tab is already open, the command brings it forward. See Browse your library in the Library View.

Entry pointDetails
Command paletteAlways available
RibbonThe ZotLit icon
Quick switcherAlt+Enter (Option+Enter on macOS) on a result opens the view on that item. See below.
AutomaticOpens once on a new install and once after a v1-to-v2 upgrade, with the setup banner above it

A selected row in the view answers the quick switcher's chords below, and its right-click menu lists every action on the item. See Open, write, and cite from a row.

ZotLit: 在 Zotero 文库中显示条目

Reveals the active literature note's item in the Library View. Opens the Library View if closed, clears any active search text and filters so the paper is not hidden, and flashes the paper's row to highlight it.

Entry pointDetails
Command paletteActive on a literature note
File menuActive on a literature note (在 Zotero 文库中显示)
Tab menuActive on a literature note tab (在 Zotero 文库中显示)

Literature note quick switcher

ZotLit: 打开文献笔记快速切换器

Opens a modal to search every library in your library scope and jump to (or create) the corresponding literature note.

Entry pointDetails
Command paletteAlways available

A result takes five chords, listed along the bottom of the modal:

ChordResult
EnterOpens the literature note, creating it first when none exists.
Ctrl+Enter (Cmd+Enter on macOS)The same, in a new pane.
Shift+EnterOpens the item's PDF in Obsidian's PDF reader, without the note.
Ctrl+Shift+Enter (Cmd+Shift+Enter on macOS)The same, in a new pane.
Alt+Enter (Option+Enter on macOS)Shows the item in the Library View.

Alt+Enter opens the Library View on the item's first collection, or on its library when the item is in no collection, and selects its row. It clears the view's search and turns off its reading-state filters, so nothing hides the row. When the item falls beyond the view's limit of 1,000 papers, nothing is selected and a notice says so.

The two PDF chords run 打开 PDF on the selected result, listed under Literature note actions.

Citations

ZotLit: 插入 Markdown 引用

Opens a modal to search every library in your library scope and insert a Markdown citation at the cursor.

Insertion remains available independently of Pandoc 引用, Wiki 链接引用, 显示格式化引用, and 将引用作为链接打开.

Entry pointDetails
Command paletteActive when an editor is open
Editor suggesterTriggered by typing [@ in the editor, or @ at a word boundary when @ trigger is on. Both settings are under Settings > ZotLit > 引文.

Citation navigation

The following commands open the recognized Pandoc citation under the cursor. They have no default hotkeys.

Entry pointDetails
Command paletteActive while Pandoc 引用 and 将引用作为链接打开 are on, with the cursor on a recognized citation key
HotkeyNone by default; assign one under Settings > Hotkeys
ZotLit: 打开光标处的文献引用标识(citation key)

Opens or creates the Literature Note in the current tab.

ZotLit: 在新标签页中打开光标处的文献引用标识(citation key)

Opens or creates the Literature Note in a new tab.

ZotLit: 在右侧打开光标处的文献引用标识(citation key)

Opens or creates the Literature Note in a split to the right.

ZotLit: 在新窗口中打开光标处的文献引用标识(citation key)

Opens or creates the Literature Note in a new window.

References and export

ZotLit: 打开参考文献

Opens the 参考文献 Sidebar for the active note.

Entry pointDetails
Command paletteAlways available
ZotLit: 显示被引用

Opens the 被引用 Sidebar, which lists the notes in your vault that cite the active literature note. Each result is grouped by source file and links to the citation inside it. The sidebar follows the active note, so it asks for a literature note before it shows results.

Entry pointDetails
Command paletteAlways available
ZotLit: 设置引文呈现方式

Opens a modal that sets the citation and references style and the document language of the active Markdown note. Confirming writes the zotlit-csl and lang properties of that note together. Choosing the vault style or the language reset removes the matching property.

Entry pointDetails
Command paletteActive on a Markdown note
More optionsThe note's More options menu (⋮)
ZotLit: 导出带引文的笔记

Opens the built-in export modal for the active Markdown note. The command requires the Pandoc 引擎 when you run it.

The export uses its own citation membership. Citation source, presentation, and navigation settings do not change exported content.

Entry pointDetails
Command paletteActive on a Markdown note

Citation text

ZotLit: 自定义引文文本

Opens the citation text in the Template Workbench View. When the vault holds no citation document, the command creates zotlit-citation.md from the built-in citation text first.

Entry pointDetails
Command paletteAlways available
SettingsThe 打开引文文本 button on the 引文文本 row at Settings > ZotLit > 引文
Template Workbench ViewThe pane menu's 自定义引文文本 item

Graph view

ZotLit: 打开引用关系图谱

Opens Obsidian's graph view with the Citation Graph preset applied, where Obsidian's own Open graph view opens it: the tab you are in, or the new tab, split, or window a modifier-held invocation asks for. See Explore citations in the graph view for what the preset sets.

Entry pointDetails
Command paletteAlways available
ZotLit: 打开局部引用关系图谱

Opens a local Citation Graph for the active note in a vertical split, grouped to the pane it was opened from so the graph follows that pane's file.

Entry pointDetails
Command paletteActive on a note

Neither command has a default hotkey. Where a Citation Graph cannot be opened, the command shows a notice naming the one thing to put right: the Graph view core plugin, the 在关系图谱中显示引用 setting, or Citation Graph availability.

Literature note actions

The following commands operate on a literature note: the file currently open in the editor must be a ZotLit literature note. They also appear in the file menu (right-click the tab or use the file menu icon) under the zotlit section. The Template Workbench view raises the same zotlit section in its pane menu. While its Preview panel is shown, the pane menu adds the choices that shape the preview, such as 自动刷新预览 and 显示 Markdown.

ZotLit: 更新文献笔记

Re-renders the full literature note (frontmatter and managed body region) from the current Zotero data.

Entry pointDetails
Command paletteActive on a literature note
File menuyes
ZotLit: 更新文献笔记元数据

Re-renders only the frontmatter of the literature note from the current Zotero data. Body content is unchanged.

Entry pointDetails
Command paletteActive on a literature note
File menuyes
ZotLit: 覆盖文献笔记

Destructively replaces the entire literature note with a fresh render. A confirmation modal appears before proceeding.

Entry pointDetails
Command paletteActive on a literature note
File menuyes
ZotLit: 从 Zotero 导入子笔记

Imports the Zotero notes attached to the current item into the vault.

Entry pointDetails
Command paletteActive on a literature note
File menuyes
ZotLit: 复制 Zotero 标识符

Copies the note's Zotero key to the clipboard.

Entry pointDetails
Command paletteActive on a file with a Zotero key
File menuLabel: 复制 Zotero 标识符. Single file only.

To edit the profile that a literature note uses, run ZotLit: 打开模板工作台 from the note. See Templates and profiles.

ZotLit: 切换文献笔记配置方案

Opens the profile picker for the note, then asks for consent before writing anything. The switch re-renders the note with the chosen profile. The dialog also offers to move the note into that profile's folder. The checkbox names the folder the note moves into, for example 移动到 books/2024/. The move keeps the subfolders the note has under its current profile's folder: literatures/2024/Smith2020.md moves to books/2024/Smith2020.md. A note outside its profile's folder, or a note whose profile ZotLit does not recognize, moves by its file name alone.

Entry pointDetails
Command paletteActive on a literature note
ZotLit: 打开 PDF

Opens the item's PDF attachment in Obsidian's own PDF reader, whether the file sits inside your vault or in Zotero's storage folder. One PDF opens straight away; several open a picker whose search box reads 选择要打开的 PDF.

Only PDF attachments are offered. An item with none shows 此条目没有 PDF 附件。 A PDF whose file is no longer on disk shows PDF 文件缺失。 Neither case falls back to Zotero's own reader. See Open an item's PDF in Obsidian.

Entry pointDetails
Command paletteActive on a literature note
File menuyes
Quick switcherShift+Enter on a result. See Literature note quick switcher.
ZoteroRight-click a PDF attachment, or an item that has one > 在 Obsidian 中打开 PDF in the top-level menu
Zotero readerRight-click inside the PDF you are reading > 在 Obsidian 中打开 PDF
Annotation viewPane menu > 打开 PDF. Absent when an Obsidian PDF view already shows the attachment.
File linkClick a link to a PDF in your Zotero library, when 在 Obsidian 中打开 PDF 文件链接 is on

Imported note actions

ZotLit: 覆盖导入的笔记

Overwrites an imported note with its latest content from Zotero. The file is replaced, so local edits are lost. A confirmation modal appears first, and its button reads 覆盖.

Entry pointDetails
Command paletteActive on an imported note (file has a Zotero note key)
File menuyes

Annotations

ZotLit: 打开 Zotero 标注

Opens the annotation view in the right sidebar, or brings it forward when it is already open. The view keeps the follow mode you last chose. A new view starts in 活动标签页.

Entry pointDetails
Command paletteAlways available
Ribbonyes (tooltip: "打开 Zotero 标注")
ZotLit: 在 Zotero 标注中跟随活动标签页 ZotLit: 在 Zotero 标注中跟随 Zotero 阅读器 ZotLit: 在 Zotero 标注中固定当前条目 ZotLit: 选择要固定在 Zotero 标注中的条目 ZotLit: 在 Zotero 标注中取消固定条目

These five change what the annotation view follows. Each acts on the open annotation view, and the command palette offers it only where it applies — so the mode the view already follows, and a pin with no item to take, are absent rather than inert. See Use the annotation view.

Entry pointDetails
Command paletteActive with an annotation view open, where the mode applies
Pane menuThe same three switches, plus the item picker
ZotLit: 撤销标注更改 ZotLit: 重做标注更改

Undo takes back the last annotation change ZotLit saved to Zotero for the PDF you have open. Redo applies an undone change again. The command palette offers each one only where there is a step to take that way. See Undo and redo a change.

Entry pointDetails
Command paletteActive in a PDF view of a Zotero attachment, or in the annotation view, when there is a step to take
More optionsThe PDF view's More options menu (⋮). Both entries appear, dimmed when there is no step to take.
HotkeyNone by default; assign one under Settings > Hotkeys

Query files

ZotLit: 新建查询文件

Creates a query file named Untitled.zotquery and opens it in a tab. The file has two views. The default view, Items, is a Table of the papers in your whole library, newest first by date modified, with a limit of 100 rows. The second view, Annotations, shows the annotations of your whole library, grouped by paper, with a limit of 100 rows. See Use query files and query blocks.

Entry pointDetails
Command paletteAlways available. The file goes in the folder for new notes.
File explorerRight-click a folder, or a file in it > 新建查询文件. The file goes in that folder. Hold Ctrl (Windows and Linux) or Command (macOS) to open it in a new tab.

另存为查询文件… in the annotation view's More options menu also creates a query file. See Save the annotation sidebar as a query file. The Library View's view menu has the same entry. See Save the view as a query file.

Template data explorer

ZotLit: 打开模板数据浏览器

Opens the template data explorer, showing the full data object available to templates for the current item. The explorer is a view of its own, with its own item choice, and it changes no Template Workbench View.

Entry pointDetails
Command paletteAlways available
File menuLabel: 探索模板数据. Appears on files that carry an item key.

Templates and profiles

These commands open template documents in the Template Workbench and import a profile that someone shared with you.

ZotLit: 打开模板工作台

Opens the Template Workbench View for the active document, in the Workbench's own window, with the Preview panel shown. A profile document, a partial, or the citation text opens directly. A literature note opens the profile document it resolves against, with the note's item selected, and the Workbench can then update that note. A note with no profile stamp resolves against the Default profile. A profile the vault cannot resolve shows a notice instead. See Profiles for what a profile decides.

When a Workbench window already shows the document, the command brings that window to the front. From inside the view, it brings the view's own window to the front. To move a view to another window, use Obsidian's Move to new window.

Entry pointDetails
Command paletteActive on a profile document, a partial, the citation text, or a literature note, and in the Workbench view
File menuLabel: 打开模板工作台. Same files as the palette entry.
View headerThe 打开模板工作台 action on a template document open as Markdown
ZotLit: 导入配置方案…

Imports a profile that someone shared with you, from the clipboard or from a file. The import sheet previews the partials, citation style, and Profile Match it carries before anything is written.

Entry pointDetails
Command paletteAlways available
SettingsThe import button on the profile list of Settings > ZotLit > 文献笔记配置方案

Template Workbench pane menu

The Workbench view's pane menu is where most template work starts. These entries sit in the zotlit section:

Menu itemWhat it does
选择条目Picks the Zotero item that the tabs, the Fields panel, and the Preview panel read.
选择标注Picks the annotation to render. Not offered for the citation text.
片段Opens another partial in a new tab of the Workbench window, creates one with 新建片段…, or unpacks the partials a shared profile still carries with 解包片段.
自定义引文文本Opens the citation text, zotlit-citation.md, in a new tab of the Workbench window.

显示字段 opens or closes the view's Fields panel: the Fields popover, or the pinned panel beside the editor. 显示预览 shows or hides the Preview panel. Each has a check mark while it is on. Both are also view actions in the view header, where the Fields panel's action is named 字段. While the Fields panel is pinned beside the editor, the menu also holds 调整字段宽度. Beside them in the view header, 帮助 opens a menu of the template guide, the syntax and data references, and the community.

选择条目

is also the button in the row above the panels, which names the chosen item. While the Preview panel is shown, the menu also holds the preview choices.

Four entries join the pane menu outside the zotlit section. 更改语言 switches the document between Liquid and Eta (JavaScript), and is not offered for a profile document. 将模板数据保存为 JSON saves the current template data as a JSON file, for the root the Fields panel shows while it is open, and for the editor's root otherwise; with the annotation root selected, the same entry reads 导出所选论文数据 when it can export the whole paper instead. 以 Markdown 打开 opens the document as Markdown. 恢复内置 moves the Default profile's custom document to the trash, so the built-in profile applies again, and is offered on that document only.

Onboarding & release

ZotLit: 打开欢迎视图

Opens the Library View and shows the setup banner above it, even after you dismissed it or setup is complete. The banner holds the setup steps, after a v1-to-v2 upgrade the link to the migration guide, and after ZotLit updates the link to the release notes.

Entry pointDetails
Command paletteAlways available
AutomaticThe banner shows over the Library View on a new install, after a v1-to-v2 upgrade, and after ZotLit updates, until you dismiss it or what it says is done
ZotLit: 打开发行说明

Opens the release notes for the installed ZotLit version.

Entry pointDetails
Command paletteAlways available
SettingsThe 查看发行说明 button in the v… 的新功能 row of the settings tab
Welcome bannerThe 新增内容 button on the banner shown above the Library View after ZotLit updates

Entry-point summary

CommandPaletteRibbonFile menuAvailable when
刷新 Zotero 数据库yesnonoAlways
更新笔记yesnonoAlways
创建或更新所有文献笔记yesnonoAlways
导入所有子笔记和独立笔记yesnonoAlways
打开 Zotero 文库yesyesnoAlways
在 Zotero 文库中显示条目yesnoyesActive on a literature note
打开文献笔记快速切换器yesnonoAlways
插入 Markdown 引用yesnonoAn editor is open
打开光标处的文献引用标识(citation key)yesnonoCursor on a recognized citation key
在新标签页中打开光标处的文献引用标识(citation key)yesnonoCursor on a recognized citation key
在右侧打开光标处的文献引用标识(citation key)yesnonoCursor on a recognized citation key
在新窗口中打开光标处的文献引用标识(citation key)yesnonoCursor on a recognized citation key
打开参考文献yesnonoAlways
显示被引用yesnonoAlways
设置引文呈现方式yesnoMore optionsActive Markdown note
导出带引文的笔记yesnonoActive Markdown note
自定义引文文本yesnonoAlways
打开引用关系图谱yesnonoAlways
打开局部引用关系图谱yesnonoActive on a note
更新文献笔记yesnoyesActive on a literature note
更新文献笔记元数据yesnoyesActive on a literature note
覆盖文献笔记yesnoyesActive on a literature note
从 Zotero 导入子笔记yesnoyesActive on a literature note
复制 Zotero 标识符yesnoyesActive on a file with a Zotero key
切换文献笔记配置方案yesnonoActive on a literature note
打开 PDFyesnoyesActive on a literature note
覆盖导入的笔记yesnoyesActive on an imported note
打开 Zotero 标注yesyesnoAlways
在 Zotero 标注中跟随活动标签页yesnonoAnnotation view open, in another mode
在 Zotero 标注中跟随 Zotero 阅读器yesnonoAnnotation view open, in another mode
在 Zotero 标注中固定当前条目yesnonoAnnotation view open on an item, not already pinned
选择要固定在 Zotero 标注中的条目yesnonoAnnotation view open
在 Zotero 标注中取消固定条目yesnonoAnnotation view open and pinned
新建查询文件yesnoexplorerAlways
打开模板数据浏览器yesnoyesAlways
打开模板工作台yesnoyesActive on a template document or a literature note
导入配置方案…yesnonoAlways
打开欢迎视图yesnonoAlways
打开发行说明yesnonoAlways

Query CLI

The Query CLI reads works, files, and reading marks for agents and scripts. One zotlit:query command selects a Query Dataset with from. How ZotLit Query works explains the datasets, filters, and groups.

CommandParametersResult
zotlit:queryfrom, filter, fields, formulas, sort, group, limit, library, output, id, this-item, this-attachmentOne Query Row per matching Item, Attachment, or Annotation
zotlit:query-schemafromThe schema URL, source custom fields, dataset fields, and defaults
zotlit:query-valueskind, library, match, limitThe exact Collection paths or Tag names of each Library
zotlit:query-guidetopicInstructions for one topic, or the full guide when topic is omitted
zotlit:annotation-imagekeyThe local PNG path, format, and provenance for an image or ink Annotation
zotlit:query-cancelidWhether ZotLit found the named query and requested its cancel

zotlit:query uses these parameters:

ParameterValue
fromitems, attachments, or annotations. The default is items.
filterA Filter Expression over the selected dataset and its related records.
fieldsA comma list of Projection Paths or a JSON array. fields=[] returns identity-only rows.
formulasA JSON object from Formula names to Filter Expressions. Read a Formula as formula.<name> in fields, filter, or another Formula. See Compute a value with a formula.
sortA comma list or a JSON array of { "field", "direction" } objects. Use -field for descending order and field or +field for ascending order.
groupOne scalar Projection Path, or a path with one [] such as tags[].name. The result contains one group for each value.
limitA positive integer or all. The default is 100. In a grouped query, the limit applies inside each group.
librarypersonal, group:<groupID>, a comma list, a JSON array, or all. The default comes from the Library Scope setting.
outputA new absolute file path for the complete JSON result.
idA query ID used by zotlit:query-cancel.
this-itemAn Item Indexed Key. A filter reads that Item as this.item. See Query Context.
this-attachmentAn Attachment Indexed Key. A filter reads that Attachment as this.attachment. See Query Context.

ZotLit splits fields and sort at commas outside quotes and brackets.

Query datasets

Choose the dataset that represents one result row:

from valueOne row representsDataset contentsRelated records
itemsA workTop-level Items outside the trashattachments, annotations, notes
attachmentsA file or URLNon-trashed Attachments of top-level, non-trashed Itemsitem, annotations
annotationsA reading markNon-trashed Annotations on non-trashed Attachments of top-level, non-trashed Itemsitem, attachment

Standalone Attachments are outside these datasets. Relation Lists contain records from the same dataset universes. Use list methods in filters and an explicit [] in Projection Paths.

notes lists the Child Notes of an Item that are outside the trash, in note key order. A note record has indexedKey, key, title, dateAdded, dateModified, library, and its parent item. No dataset reads notes as rows. This query finds papers with a Child Note and lists the note titles:

obsidian zotlit:query filter='!notes.isEmpty()' fields='title,notes[].title'

For example, this query finds papers with no PDF that ZotLit can open on this computer:

obsidian zotlit:query filter='attachments.filter(value.contentType == "application/pdf" && value.exists).isEmpty()' fields=title,citationKey

Start from Attachments when each file must be one row. This query finds missing linked files:

obsidian zotlit:query from=attachments filter='linkMode == "linked_file" && !exists' fields=item.title,path

Select a record by Indexed Key in the filter. Use indexedKey for a row, item.indexedKey for its parent Item, or attachment.indexedKey for an Annotation's parent Attachment. A key outside the Target Libraries gives a Query Warning. The Target Libraries stay unchanged.

Query Context

this-item and this-attachment set the Query Context of a query: the Item and the Attachment that a filter reads as this.item and this.attachment. Query files and query blocks set the same context from the note that shows them. See this: the paper of the note.

DatasetRecords of the bound ItemRecords of the bound Attachment
itemsindexedKey == this.item.indexedKey
attachmentsitem == this.itemindexedKey == this.attachment.indexedKey
annotationsitem == this.itemattachment == this.attachment
obsidian zotlit:query from=annotations filter='item == this.item' this-item=ABCD2345 limit=all

A filter that reads this.item or this.attachment without its parameter fails with the unbound-context diagnostic.

Projection and grouping

A path such as attachments[].path returns one value for each Attachment. It keeps source order and keeps null in its original position. A complete related record has a fixed summary:

RecordSummary fields
ItemindexedKey, title, citationKey
AttachmentindexedKey, title, contentType, linkMode, path, exists
AnnotationindexedKey, type, text, comment, pageLabel, pageIndex
NoteindexedKey, title

group accepts one scalar path. This command counts Attachments by fileType, which is pdf, epub, web, or other:

obsidian zotlit:query from=attachments group=fileType

Each group contains value, count, and rows. count is the number of matches before the per-group limit. totalCount counts all matched records, and returnedCount counts the row entries returned across all groups.

A path with one [] groups by each element of a list. This command counts papers per tag:

obsidian zotlit:query group='tags[].name' fields='[]' limit=1

A paper joins one group for each of its tags, and a paper without tags is in the null group. Groups can overlap, so their counts can add up to more than totalCount. Use collections[] for papers per Collection and attachments[].fileType for papers per file type.

This command returns the three most recent marks for each paper:

obsidian zotlit:query from=annotations group=item.indexedKey sort=-dateModified limit=3 fields=text,item.title

Collection and Tag values

zotlit:query-values lists the names that a filter matches exactly. Run it before you filter by a Collection or Tag.

ParameterValue
kindcollections or tags. Required.
librarypersonal, group:<groupID>, or all. The default comes from the Library Scope setting.
matchKeeps the names that contain this text, ignoring letter case.
limitA positive integer or all, applied to each Library. The default is 100.

Collection values are full paths joined by /, including empty Collections. Tag values are { name, type }, where type is manual, auto, or unknown. Each Library reports its library selector, name, values, totalCount, returnedCount, and truncated.

obsidian zotlit:query-values kind=collections match=thesis

A Collection path in collections.contains or collections.within that no Target Library holds gives an unknown-collection Query Warning. Its suggestions lists the nearest paths, and a library value when another Library holds the path.

Schema, guide, and results

The single query.schema.json catalog has datasets.items, datasets.attachments, and datasets.annotations. It also has the shared functions, methods, properties, and types. zotlit:query-schema returns the catalog URL, source custom fields, and defaults by dataset. Add from=items, from=attachments, or from=annotations to narrow the live response.

zotlit:query-guide accepts datasets, filter, fields, sort, group, results, schema, values, or cancel as its topic. Omit topic to print the full guide.

Query results use CLI Contract version 3. The JSON envelope has command: "zotlit:query"; request.from names the dataset, and request.library names its Libraries. The top-level libraries field describes the Libraries that ZotLit read.

Read warnings before you report an empty result. On failure, read diagnostic.report and follow its final recovery action.

Every Attachment Row contains the Attachment and parent Item Indexed Keys. Every Annotation Row also contains its parent Attachment Indexed Key. Annotation default values include pageLabel, pageIndex, hasExcerptImage, Attachment details, Item title, and Citation Key. Request position in fields when source geometry is required. Read attachment.path to open the source document when attachment.exists is true.

When hasExcerptImage is true, pass the Annotation Indexed Key as key to zotlit:annotation-image. The command returns a file path instead of image bytes.

The zotlit-query agent skill reads zotlit:query-guide and zotlit:query-schema before it composes a query. See Ask an AI agent.

Template Workbench CLI

The Template Workbench registers its own commands with the Obsidian CLI, for agents and scripts rather than for the command palette. Five answer live:

  • zotlit:template-inspect inspects one template document and verifies that its saved source is current.
  • zotlit:template-check checks every saved component of every profile.
  • zotlit:template-status reports the state of the Workbench for the vault.
  • zotlit:template-data returns the template data for one root.
  • zotlit:template-guide prints the Workbench guide.

The earlier schema, rendering, source, and managed-frontmatter commands are retired. Each stays registered and answers a COMMAND_RETIRED diagnostic.

See Template Workbench CLI for every command, live and retired, with its flags and diagnostics, and Template Workbench for the concept.

See also

Last updated on

On this page