关于 cli-anything-zotero
cli-anything-zotero 是面向 Agent 的命令行工具,通过 Zotero 桌面端的本地接口操作文献库,适用于文献检索、引用处理和整理模型分析所需的结构化上下文。
主要功能
- 01查看分类、条目、标签和已保存搜索
- 02导出条目并生成引用或参考文献表
- 03读取和添加条目笔记
- 04向 Zotero 导入文件或 JSON
- 05整理条目的结构化上下文
- 06维护文献库和条目的会话上下文
适用场景
- 01查找并查看 Zotero 文献库中的参考资料
- 02按指定样式生成引用和参考文献表
- 03为现有条目添加子笔记
- 04为后续模型分析准备条目上下文
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ hkuds/ cli-anything --skill cli-anything-zotero安装后在 Claude Code 中输入/cli-anything-zotero确认已加载。
详细介绍
cli-anything-zotero
cli-anything-zotero 是面向 Zotero 桌面应用的原生 Agent 命令行工具。它不重新实现 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 "Key takeaway" --json
构建大模型上下文
为下游模型分析组装结构化上下文。
cli-anything-zotero item context <item-key> --include-notes --include-links --json
版本
0.1.0
评论
支持 Markdown