cli-anything-zotero 是做什么的?
cli-anything-zotero 是一款面向AI代理的原生CLI工具,用于与Zotero桌面版交互。它并不重新实现Zotero,而是通过组合Zotero真实的本地表面来实现功能:
安装
pip install -e .
入口点
cli-anything-zotero
python -m cli_anything.zotero
重要约束
search items、item export、item citation和item bibliography需要启用 Zotero 的本地 API。note add依赖于实时的 Zotero GUI 上下文,并期望在应用中选择了相同的库。- 导入时的 PDF 附件支持仅限于在同一连接器会话中创建的条目;对任意现有条目附加文件的功能仍超出范围。
- 实验性的 SQLite 写入命令仅限本地、用户库操作,应视为非稳定的高级用户操作。
- 如果裸键在多个库中重复,应在后续命令前使用
session use-library <id>。
命令组
App
应用和运行时检查命令。
| 命令 | 描述 |
|---|---|
status | 执行 status。 |
version | 执行 version。 |
launch | 执行 launch。 |
enable-local-api | 执行 enable-local-api。 |
ping | 执行 ping。 |
Collection
集合检查和选择命令。
| 命令 | 描述 |
|---|---|
list | 执行 list。 |
find | 执行 find。 |
tree | 执行 tree。 |
get | 执行 get。 |
items | 执行 items。 |
use-selected | 执行 use-selected。 |
create | 执行 create。 |
Item
条目检查和渲染命令。
| 命令 | 描述 |
|---|---|
list | 执行 list。 |
find | 执行 find。 |
get | 执行 get。 |
children | 执行 children。 |
notes | 执行 notes。 |
attachments | 执行 attachments。 |
file | 执行 file。 |
export | 执行 export。 |
citation | 执行 citation。 |
bibliography | 执行 bibliography。 |
context | 执行 context。 |
analyze | 执行 analyze。 |
add-to-collection | 执行 add-to-collection。 |
move-to-collection | 执行 move-to-collection。 |
Search
已保存搜索的检查命令。
| 命令 | 描述 |
|---|---|
list | 执行 list。 |
get | 执行 get。 |
items | 执行 items。 |
Tag
标签检查命令。
| 命令 | 描述 |
|---|---|
list | 执行 list。 |
items | 执行 items。 |
Style
已安装的 CSL 样式检查命令。
| 命令 | 描述 |
|---|---|
list | 执行 list。 |
Import
官方 Zotero 导入和写入命令。
| 命令 | 描述 |
|---|---|
file | 执行 file。 |
json | 执行 json。 |
Note
读取和添加子笔记。
| 命令 | 描述 |
|---|---|
get | 执行 get。 |
add | 执行 add。 |
Session
会话和 REPL 上下文命令。
| 命令 | 描述 |
|---|---|
status | 执行 status。 |
use-library | 执行 use-library。 |
use-collection | 执行 use-collection。 |
use-item | 执行 use-item。 |
use-selected | 执行 use-selected。 |
clear-library | 执行 clear-library。 |
clear-collection | 执行 clear-collection。 |
clear-item | 执行 clear-item。 |
history | 执行 history。 |
示例
运行时状态
检查 Zotero 路径和后端可用性。
cli-anything-zotero app status --json
读取选定集合
持久化 Zotero GUI 中选择的集合。
cli-anything-zotero collection use-selected --json
渲染引用
使用 Zotero 本地 API 渲染引用。
cli-anything-zotero item citation <item-key> --style apa --locale en-US --json
添加子笔记
在现有 Zotero 条目下创建子笔记。
cli-anything-zotero note add <item-key> --text "关键要点" --json
构建 LLM 上下文
为下游模型分析组装结构化上下文。
cli-anything-zotero item context <item-key> --include-notes --include-links --json
版本
0.1.0