/install cnki-download
CNKI 知网下载
什么时候用
用户说「知网下载」「cnki 下载」「帮我下几篇知网文献」「从知网搜点论文」时直接用本 skill。
第 0 步:启动前 agent 自检(用户不用动手脚)
不要让用户自己去 npm install、装 Node、装 Edge —— 全部由 agent 跑前自检、自行装好。
启动脚本前依次跑下面 4 项检查,全部 ✅ 才进入工作流第 1 步:
- Node 可用:
node --version能输出 v18+。如果不通过,提示用户装 Node 后由 agent 重试。 - Edge 可用:检测
C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe或C:\Program Files\Microsoft\Edge\Application\msedge.exe是否存在。缺失则提示用户装 Microsoft Edge(https://www.microsoft.com/edge)。 - Playwright 可用且版本够:在
scripts/目录下跑node -e "import('playwright').then(m=>process.exit(0)).catch(e=>process.exit(1))",exit 0 即通过。Node 会沿父目录向上找node_modules/,所以 workspace 根目录已装的 playwright 也能复用。 - Playwright 不够/缺失时:自己跑
npm install。重要:执行时设环境变量PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1(这个 skill 用的是系统 Edge,不需要再下载 playwright 自带的 chromium,能省几百 MB)。cd C:\Users\lfp\.openclaw\workspace\skills\cnki-download\scripts $env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1" npm install
自检全通过后告诉用户「环境 OK,开始干」,再进入第 1 步反问参数。
如果用户第一次说"知网下载"时已经在聊天里走了一段时间了,先做这 4 步自检再问参数 —— 自检可能也要十几秒,提前跑能省一次往返。
工作流(agent 视角)
1. 收到「知网下载」触发 → 先建议 demo 试跑
不要一上来就问一堆参数。用一段话先建议 demo 试跑,小白用户可以先看到完整流程怎么走的(demo 关键词是「区块链」,下载 5 篇,筛选北大核心/CSSCI + 2024-2025 年)。
示范话术:
「好的,知网下载。在开始之前,要不要先用 demo 跑一下测试?
demo 用的是内置默认配置:关键词『区块链』、北大核心 + CSSCI、2024-2025 年、下载 5 篇。
请选择 : 1、跑demo 2、自定义检索下载
- 重要提示:
-
- 第一次会手动登录,后续几个小时内不需要再登录 - 我会开启一个新的终端窗口,后续的指令和提示会在新窗口进行输出(主要涉及用户登录); - 登录以后请 **自行链接** 到知网搜索页面,搜索将自动进行 - 用最醒目的字体颜色提醒用户: download文件保存的绝对路径 -
」
- 用户选 1 → 直接
- 在当前技能目录下启动
Start-Process powershell -ArgumentList "-NoExit", "-Command", "node scripts/search_cnki.js"。- 用户选 2 → 跳到第 2 步。
2. 补全缺失参数
按下面 4 项问清楚:
「好,自定义检索。请告诉我:
- 检索关键词?(必填)
- 下载几篇?(必填,默认 5)
- 要不要筛选?
- 要不要排序? 明确提示可以指定的筛选与排序字段见
references/config-schema.md不筛不排的话只回关键词和篇数也行,剩下的我用默认。」
。
3. 写一份 config JSON
把用户的回答翻译成 config,写到一个临时文件,比如 scripts/_user-config-{YYYYMMDD-HHmm}.json:
{
"keyword": "\x3C用户说的关键词>",
"download_count": \x3C用户说的篇数>,
"sort": { "field": "\x3C相关度|发表时间|被引|下载|综合>", "order": "\x3CDESC|ASC>" }, // 可选
"filters": [ { "col": "...", "values": ["..."] } ] // 可选
}
只有 keyword 和 download_count 是必填。
4. 启动 pipeline
// 在当前技能目录下启动
`Start-Process powershell -ArgumentList "-NoExit", "-Command", "node scripts/search_cnki.js \x3Cconfig 路径>"`
exec与process工具调用规定:
通过exec执行node脚本后,会打开一个新的进程和新窗口,把控制权完全交给它,不要一直查看进程状态,直接结束。
关键约束
- 不要自己用
browser工具去探 CNKI(已经有 Playwright 跑着了),避免多开冲突 - 不要修改
scripts/下的脚本;如发现 bug 写进references/troubleshooting.md等用户决定 - 不要让用户自己装 Node / Edge / 跑
npm install(agent 全包,见第 0 步) - 不要把
browser_data//download//_login_state.png提交进 git(参考references/troubleshooting.md的.gitignore写法)
相关文件
references/config-schema.md—— config 字段详情、枚举值、3 种调用方式assets/default-config.json—— 默认 demo(node scripts/search_cnki.js不带参数就用这个的 hard-coded 等价物)
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install cnki-download - After installation, invoke the skill by name or use
/cnki-download - Provide required inputs per the skill's parameter spec and get structured output
What is 知网论文下载?
从中国知网(CNKI,中南大学图书馆代理入口)检索并批量下载学术文献 PDF。一句话触发:"知网下载"、"cnki 下载"、"帮我下几篇知网文献"。负责:用自然语言收集参数(关键词/篇数/筛选/排序)→ 启动 Playwright+Edge pipeline →第一次会手动登录,登录态保留在 `browser_d... It is an AI Agent Skill for Claude Code / OpenClaw, with 34 downloads so far.
How do I install 知网论文下载?
Run "/install cnki-download" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is 知网论文下载 free?
Yes, 知网论文下载 is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does 知网论文下载 support?
知网论文下载 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created 知网论文下载?
It is built and maintained by lfp1979 (@lfp1979); the current version is v1.0.0.