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 point | Details |
|---|---|
| Command palette | Always 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 point | Details |
|---|---|
| Command palette | Always 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 point | Details |
|---|---|
| Command palette | Always available |
| Zotero | Right-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 point | Details |
|---|---|
| Command palette | Always available |
| Zotero | Right-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 point | Details |
|---|---|
| Command palette | Always available |
| Ribbon | The ZotLit icon |
| Quick switcher | Alt+Enter (Option+Enter on macOS) on a result opens the view on that item. See below. |
| Automatic | Opens 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 point | Details |
|---|---|
| Command palette | Active on a literature note |
| File menu | Active on a literature note (在 Zotero 文库中显示) |
| Tab menu | Active 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 point | Details |
|---|---|
| Command palette | Always available |
A result takes five chords, listed along the bottom of the modal:
| Chord | Result |
|---|---|
Enter | Opens the literature note, creating it first when none exists. |
Ctrl+Enter (Cmd+Enter on macOS) | The same, in a new pane. |
Shift+Enter | Opens 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 point | Details |
|---|---|
| Command palette | Active when an editor is open |
| Editor suggester | Triggered 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 point | Details |
|---|---|
| Command palette | Active while Pandoc 引用 and 将引用作为链接打开 are on, with the cursor on a recognized citation key |
| Hotkey | None by default; assign one under Settings > Hotkeys |
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 point | Details |
|---|---|
| Command palette | Always available |
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 point | Details |
|---|---|
| Command palette | Always available |
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 point | Details |
|---|---|
| Command palette | Active on a Markdown note |
| More options | The note's More options menu (⋮) |
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 point | Details |
|---|---|
| Command palette | Active 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 point | Details |
|---|---|
| Command palette | Always available |
| Settings | The 打开引文文本 button on the 引文文本 row at Settings > ZotLit > 引文 |
| Template Workbench View | The 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 point | Details |
|---|---|
| Command palette | Always available |
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 point | Details |
|---|---|
| Command palette | Active 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 point | Details |
|---|---|
| Command palette | Active on a literature note |
| File menu | yes |
Re-renders only the frontmatter of the literature note from the current Zotero data. Body content is unchanged.
| Entry point | Details |
|---|---|
| Command palette | Active on a literature note |
| File menu | yes |
Destructively replaces the entire literature note with a fresh render. A confirmation modal appears before proceeding.
| Entry point | Details |
|---|---|
| Command palette | Active on a literature note |
| File menu | yes |
Imports the Zotero notes attached to the current item into the vault.
| Entry point | Details |
|---|---|
| Command palette | Active on a literature note |
| File menu | yes |
Copies the note's Zotero key to the clipboard.
| Entry point | Details |
|---|---|
| Command palette | Active on a file with a Zotero key |
| File menu | Label: 复制 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 point | Details |
|---|---|
| Command palette | Active on a literature note |
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 point | Details |
|---|---|
| Command palette | Active on a literature note |
| File menu | yes |
| Quick switcher | Shift+Enter on a result. See Literature note quick switcher. |
| Zotero | Right-click a PDF attachment, or an item that has one > 在 Obsidian 中打开 PDF in the top-level menu |
| Zotero reader | Right-click inside the PDF you are reading > 在 Obsidian 中打开 PDF |
| Annotation view | Pane menu > 打开 PDF. Absent when an Obsidian PDF view already shows the attachment. |
| File link | Click 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 point | Details |
|---|---|
| Command palette | Active on an imported note (file has a Zotero note key) |
| File menu | yes |
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 point | Details |
|---|---|
| Command palette | Always available |
| Ribbon | yes (tooltip: "打开 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 point | Details |
|---|---|
| Command palette | Active with an annotation view open, where the mode applies |
| Pane menu | The same three switches, plus the item picker |
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 point | Details |
|---|---|
| Command palette | Active in a PDF view of a Zotero attachment, or in the annotation view, when there is a step to take |
| More options | The PDF view's More options menu (⋮). Both entries appear, dimmed when there is no step to take. |
| Hotkey | None 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 point | Details |
|---|---|
| Command palette | Always available. The file goes in the folder for new notes. |
| File explorer | Right-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 point | Details |
|---|---|
| Command palette | Always available |
| File menu | Label: 探索模板数据. 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 point | Details |
|---|---|
| Command palette | Active on a profile document, a partial, the citation text, or a literature note, and in the Workbench view |
| File menu | Label: 打开模板工作台. Same files as the palette entry. |
| View header | The 打开模板工作台 action on a template document open as Markdown |
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 point | Details |
|---|---|
| Command palette | Always available |
| Settings | The 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 item | What 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 point | Details |
|---|---|
| Command palette | Always available |
| Automatic | The 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 |
Opens the release notes for the installed ZotLit version.
| Entry point | Details |
|---|---|
| Command palette | Always available |
| Settings | The 查看发行说明 button in the v… 的新功能 row of the settings tab |
| Welcome banner | The 新增内容 button on the banner shown above the Library View after ZotLit updates |
Entry-point summary
| Command | Palette | Ribbon | File menu | Available when |
|---|---|---|---|---|
| 刷新 Zotero 数据库 | yes | no | no | Always |
| 更新笔记 | yes | no | no | Always |
| 创建或更新所有文献笔记 | yes | no | no | Always |
| 导入所有子笔记和独立笔记 | yes | no | no | Always |
| 打开 Zotero 文库 | yes | yes | no | Always |
| 在 Zotero 文库中显示条目 | yes | no | yes | Active on a literature note |
| 打开文献笔记快速切换器 | yes | no | no | Always |
| 插入 Markdown 引用 | yes | no | no | An editor is open |
| 打开光标处的文献引用标识(citation key) | yes | no | no | Cursor on a recognized citation key |
| 在新标签页中打开光标处的文献引用标识(citation key) | yes | no | no | Cursor on a recognized citation key |
| 在右侧打开光标处的文献引用标识(citation key) | yes | no | no | Cursor on a recognized citation key |
| 在新窗口中打开光标处的文献引用标识(citation key) | yes | no | no | Cursor on a recognized citation key |
| 打开参考文献 | yes | no | no | Always |
| 显示被引用 | yes | no | no | Always |
| 设置引文呈现方式 | yes | no | More options | Active Markdown note |
| 导出带引文的笔记 | yes | no | no | Active Markdown note |
| 自定义引文文本 | yes | no | no | Always |
| 打开引用关系图谱 | yes | no | no | Always |
| 打开局部引用关系图谱 | yes | no | no | Active on a note |
| 更新文献笔记 | yes | no | yes | Active on a literature note |
| 更新文献笔记元数据 | yes | no | yes | Active on a literature note |
| 覆盖文献笔记 | yes | no | yes | Active on a literature note |
| 从 Zotero 导入子笔记 | yes | no | yes | Active on a literature note |
| 复制 Zotero 标识符 | yes | no | yes | Active on a file with a Zotero key |
| 切换文献笔记配置方案 | yes | no | no | Active on a literature note |
| 打开 PDF | yes | no | yes | Active on a literature note |
| 覆盖导入的笔记 | yes | no | yes | Active on an imported note |
| 打开 Zotero 标注 | yes | yes | no | Always |
| 在 Zotero 标注中跟随活动标签页 | yes | no | no | Annotation view open, in another mode |
| 在 Zotero 标注中跟随 Zotero 阅读器 | yes | no | no | Annotation view open, in another mode |
| 在 Zotero 标注中固定当前条目 | yes | no | no | Annotation view open on an item, not already pinned |
| 选择要固定在 Zotero 标注中的条目 | yes | no | no | Annotation view open |
| 在 Zotero 标注中取消固定条目 | yes | no | no | Annotation view open and pinned |
| 新建查询文件 | yes | no | explorer | Always |
| 打开模板数据浏览器 | yes | no | yes | Always |
| 打开模板工作台 | yes | no | yes | Active on a template document or a literature note |
| 导入配置方案… | yes | no | no | Always |
| 打开欢迎视图 | yes | no | no | Always |
| 打开发行说明 | yes | no | no | Always |
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.
| Command | Parameters | Result |
|---|---|---|
zotlit:query | from, filter, fields, formulas, sort, group, limit, library, output, id, this-item, this-attachment | One Query Row per matching Item, Attachment, or Annotation |
zotlit:query-schema | from | The schema URL, source custom fields, dataset fields, and defaults |
zotlit:query-values | kind, library, match, limit | The exact Collection paths or Tag names of each Library |
zotlit:query-guide | topic | Instructions for one topic, or the full guide when topic is omitted |
zotlit:annotation-image | key | The local PNG path, format, and provenance for an image or ink Annotation |
zotlit:query-cancel | id | Whether ZotLit found the named query and requested its cancel |
zotlit:query uses these parameters:
| Parameter | Value |
|---|---|
from | items, attachments, or annotations. The default is items. |
filter | A Filter Expression over the selected dataset and its related records. |
fields | A comma list of Projection Paths or a JSON array. fields=[] returns identity-only rows. |
formulas | A 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. |
sort | A comma list or a JSON array of { "field", "direction" } objects. Use -field for descending order and field or +field for ascending order. |
group | One scalar Projection Path, or a path with one [] such as tags[].name. The result contains one group for each value. |
limit | A positive integer or all. The default is 100. In a grouped query, the limit applies inside each group. |
library | personal, group:<groupID>, a comma list, a JSON array, or all. The default comes from the Library Scope setting. |
output | A new absolute file path for the complete JSON result. |
id | A query ID used by zotlit:query-cancel. |
this-item | An Item Indexed Key. A filter reads that Item as this.item. See Query Context. |
this-attachment | An 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 value | One row represents | Dataset contents | Related records |
|---|---|---|---|
items | A work | Top-level Items outside the trash | attachments, annotations, notes |
attachments | A file or URL | Non-trashed Attachments of top-level, non-trashed Items | item, annotations |
annotations | A reading mark | Non-trashed Annotations on non-trashed Attachments of top-level, non-trashed Items | item, 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,citationKeyStart 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,pathSelect 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.
| Dataset | Records of the bound Item | Records of the bound Attachment |
|---|---|---|
items | indexedKey == this.item.indexedKey | |
attachments | item == this.item | indexedKey == this.attachment.indexedKey |
annotations | item == this.item | attachment == this.attachment |
obsidian zotlit:query from=annotations filter='item == this.item' this-item=ABCD2345 limit=allA 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:
| Record | Summary fields |
|---|---|
| Item | indexedKey, title, citationKey |
| Attachment | indexedKey, title, contentType, linkMode, path, exists |
| Annotation | indexedKey, type, text, comment, pageLabel, pageIndex |
| Note | indexedKey, 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=fileTypeEach 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=1A 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.titleCollection and Tag values
zotlit:query-values lists the names that a filter matches exactly. Run it before you filter by a Collection or Tag.
| Parameter | Value |
|---|---|
kind | collections or tags. Required. |
library | personal, group:<groupID>, or all. The default comes from the Library Scope setting. |
match | Keeps the names that contain this text, ignoring letter case. |
limit | A 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=thesisA 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-inspectinspects one template document and verifies that its saved source is current.zotlit:template-checkchecks every saved component of every profile.zotlit:template-statusreports the state of the Workbench for the vault.zotlit:template-datareturns the template data for one root.zotlit:template-guideprints 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
Query your Zotero library
Find works, inspect files, and summarize reading marks from the Obsidian CLI.
How ZotLit Query works
Query Datasets, Relation Lists, grouping, and exact Collection and Tag names.
Install the ZotLit skills
Install the agent workflow that uses the Template Workbench.
Settings
Every ZotLit setting: key, label, default, and location.
Export a note with citations
Export an active Markdown note to a Word document or web page.
Protocol links
obsidian://zotlit/* actions for scripting workflows.
Template syntax
Liquid markup reference for ZotLit templates.
Last updated on