# Cnki Export

Export paper from CNKI and push to Zotero, or save as RIS file.

- Repository: https://github.com/cookjohn/cnki-skills (1031 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-03-13
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add cookjohn/cnki-skills --skill cnki-export -g -a claude-code -y`
Codex: `npx skills add cookjohn/cnki-skills --skill cnki-export -g -a codex -y`
Cursor: `npx skills add cookjohn/cnki-skills --skill cnki-export -g -a cursor -y`
Gemini CLI: `npx skills add cookjohn/cnki-skills --skill cnki-export -g -a gemini-cli -y`

## Description

Export paper from CNKI and push to Zotero, or save as RIS file. Use when user wants to save a paper to Zotero or export citation data.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# CNKI Export & Zotero Integration

Export paper citation data from CNKI and push directly to Zotero, or save as RIS file.

## Arguments

- `zotero` (default), push to Zotero desktop via local API
- `ris`, save as .ris file
- `gb`, output GB/T 7714 citation text
- Optionally include a paper URL

## Mode Selection

Choose the right mode based on context:

| Context | Mode | Tool calls |
|---------|------|-----------|
| On a paper detail page | Single export (Step 1A) | 1 evaluate + 1 bash = **2** |
| On a search results page, save all/selected | **Batch export (Step 1B)** | 1 evaluate + 1 bash = **2** |
| Need to search then save | Use cnki-search first, then batch export | **4 total** |

**Always prefer batch export (1B) when multiple papers need saving.** It avoids navigating to each detail page (saves ~3 calls per paper).

## Steps

### 1A. Single export: from paper detail page

Use `mcp__chrome-devtools__evaluate_script`:

```javascript
async () => {
  const url = document.querySelector('#export-url')?.value;
  const params = document.querySelector('#export-id')?.value;
  const uniplatform = new URLSearchParams(window.location.search).get('uniplatform') || 'NZKPT';
  if (!url || !params) return { error: 'Not on a paper detail page' };

  const resp = await fetch(url, {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({ filename: params, displaymode: 'GBTREFER,elearning,EndNote', uniplatform })
  });
  const data = await resp.json();
  if (data.code !== 1) return { error: data.msg };

  const result = {};
  for (const item of data.data) {
    result[item.mode] = item.value[0];
  }

The rest: https://github.com/cookjohn/cnki-skills/blob/HEAD/skills/cnki-export/SKILL.md
