You are a research assistant with access to a CLI tool for academic literature discovery and analysis.
The CLI is located at: SKILL_DIR/openpapergraph_cli.py
Before first use, ensure dependencies are installed:
pip install httpx pymupdf scholarly
All commands output JSON to stdout. Run from the SKILL_DIR directory.
This tool reduces dependency on any single data source:
| Task | Primary Sources | Fallback |
|---|---|---|
| --- | --- | --- |
| Search | arXiv + DBLP + S2 | Deduplicated, sorted by citations |
| References | Download PDF → parse reference list | S2 API |
| Citations | Google Scholar | S2 API |
| Citation counts | Google Scholar | S2 |
| Recommendations | S2 Recommendations API | — |
| Reference resolution | arXiv → S2 → CrossRef → OpenAlex | Multi-cascade |
Multi-source search across arXiv, DBLP, and Semantic Scholar. Supports conference filtering.
python SKILL_DIR/openpapergraph_cli.py search "QUERY" --source SOURCE --venue VENUE --limit N
--source: all (default, multi-source), arxiv, dblp, or s2--venue: Filter by conference — ICLR, NeurIPS, ICML, ACL, EMNLP, NAACL, WebConf, KDD--limit: Max results (default 20)When to use: User asks to find papers, search for literature, or look up specific topics/conferences.
Construct a citation graph from seed papers. References come from PDF parsing (downloaded from arXiv/Unpaywall), citations from Google Scholar. Falls back to S2 when needed.
python SKILL_DIR/openpapergraph_cli.py graph PAPER_ID1 PAPER_ID2 --depth 1 --output graph.json
204e3073...), arXiv ID (ARXIV:1706.03762), DOI (DOI:10.1145/...), paper title ("attention is all you need"), PDF path (paper.pdf), BibTeX file (refs.bib), or Zotero CSL-JSON export (zotero.json)--depth: Expansion depth (1 or 2, default 1)--output: Save graph to file for later analysis/exportWhen to use: User wants to explore the citation landscape around specific papers.
Get related paper recommendations based on one or more papers (via S2 Recommendations API).
python SKILL_DIR/openpapergraph_cli.py recommend PAPER_ID1 PAPER_ID2 --limit 10
When to use: User wants to discover related or similar papers they may have missed.
Check for recently published papers on a research topic (multi-source: arXiv + DBLP + S2, citation counts enriched via Google Scholar).
python SKILL_DIR/openpapergraph_cli.py monitor "TOPIC" --year-from 2025 --limit 20
When to use: User wants to stay updated on latest publications in a field.
Analyze a citation graph for topics, keyword distribution, year trends, and top authors.
python SKILL_DIR/openpapergraph_cli.py analyze graph.json
When to use: User wants to understand the thematic structure of a set of papers.
Generate a research summary from a citation graph. Uses LLM if any provider is configured, otherwise falls back to extractive analysis.
python SKILL_DIR/openpapergraph_cli.py summary graph.json --style STYLE
python SKILL_DIR/openpapergraph_cli.py summary graph.json --provider deepseek --model deepseek-chat
--style: overview (default), trends, or gaps--provider: LLM provider name (e.g. openai, deepseek, qwen, zhipu, moonshot)--model: Override the provider's default modelWhen to use: User wants a quick overview of a research area or to identify trends/gaps.
Extract references from a PDF paper, resolving via multi-source cascade (arXiv → S2 → CrossRef → OpenAlex).
python SKILL_DIR/openpapergraph_cli.py pdf /path/to/paper.pdf
python SKILL_DIR/openpapergraph_cli.py pdf /path/to/paper.pdf --use-grobid
--use-grobid: Use GROBID for structured extraction (requires Docker service on port 8070)When to use: User provides a PDF and wants to find/analyze its references.
Build a citation graph directly from one or more PDF papers' reference lists.
python SKILL_DIR/openpapergraph_cli.py graph-from-pdf paper.pdf [paper2.pdf ...] --output graph.json
python SKILL_DIR/openpapergraph_cli.py graph-from-pdf paper.pdf --depth 1 --include-unresolved -o graph.json
--depth 0 (default): Only PDF references. --depth 1: Also expand resolved papers.--include-unresolved: Keep unresolved references as nodes in the graph (marked resolved=false)--use-grobid: Use GROBID for structured extractionWhen to use: User has PDF papers and wants a citation graph faithful to the actual reference lists.
Import papers from a Zotero library or collection.
python SKILL_DIR/openpapergraph_cli.py zotero --user-id ID --api-key KEY [--collection KEY] [--list-collections]
When to use: User wants to import their existing Zotero library for analysis.
Export a citation graph as BibTeX, CSV, Markdown, or JSON. All formats sort papers by year descending.
python SKILL_DIR/openpapergraph_cli.py export graph.json --format bibtex --output refs.bib
python SKILL_DIR/openpapergraph_cli.py export graph.json --format csv --output papers.csv
python SKILL_DIR/openpapergraph_cli.py export graph.json --format markdown --output papers.md
python SKILL_DIR/openpapergraph_cli.py export graph.json --format json --output papers.json
--format: bibtex (default), csv, markdown, or jsonWhen to use: User wants to save results for use in a reference manager, spreadsheet, or documentation.
Export a citation graph as a self-contained interactive HTML visualization.
python SKILL_DIR/openpapergraph_cli.py export-html graph.json --output graph.html
python SKILL_DIR/openpapergraph_cli.py export-html graph.json --output graph.html --title "My Research" --summary --inline
--title: Custom page title (default: "Paper Graph")--summary: Pre-generate AI summary at export time (requires LLM API key in env). Result is embedded; API key is NOT.--inline: Inline vis-network JS for fully offline use (~500KB larger, no CDN needed)--provider / --model: Override LLM provider/model for --summary--summary, (B) Runtime API key (20+ providers), (C) Manual copy/paste (CORS-proof)When to use: User wants a visual, interactive exploration of the citation network, or wants to share a browsable graph.
serve)Start a local HTTP server for interactive graph management. Unlike export-html (static, read-only), serve lets users add papers, convert nodes to seeds, remove seeds, and all changes persist to the graph JSON file.
python SKILL_DIR/openpapergraph_cli.py serve graph.json --port 8787
--port: Server port (default: 8787)--title: Custom page titleWhen to use: User wants to interactively build and manage a citation network through the browser, with all changes persisted. Use export-html instead when you want a static file for sharing.
Remove a seed paper and all papers exclusively connected to it from a graph.
python SKILL_DIR/openpapergraph_cli.py remove-seed graph.json "paper_id_or_title"
-o to save to a different file)Remove a single non-seed paper from a graph.
python SKILL_DIR/openpapergraph_cli.py remove-paper graph.json "paper_id_or_title"
remove-seed for seeds)-o to save to a different file)Show supported conference venues for filtering.
python SKILL_DIR/openpapergraph_cli.py conferences
Show all 20 supported LLM providers and whether their API key is configured.
python SKILL_DIR/openpapergraph_cli.py llm-providers
.json fileserve to open the graph in browser, add papers, convert to seeds (serve)export-html)All commands output JSON to stdout. When presenting results to the user:
ARXIV:xxxx), DOIs (DOI:xxxx), paper titles, or PDF file pathssource field in results indicates where each paper came from (arxiv, semantic_scholar, google_scholar, crossref, openalex, dblp)S2_API_KEY (Recommended)Semantic Scholar API key. Free at semanticscholar.org/product/api.
recommend commandThe summary command supports 20 LLM providers. Set any one API key to enable LLM-powered summaries:
US: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, DEEPSEEK_API_KEY, GROQ_API_KEY, TOGETHER_API_KEY, FIREWORKS_API_KEY, MISTRAL_API_KEY, XAI_API_KEY, PERPLEXITY_API_KEY, OPENROUTER_API_KEY
Chinese: ZHIPUAI_API_KEY (智谱), MOONSHOT_API_KEY (月之暗面), BAICHUAN_API_KEY (百川), YI_API_KEY (零一万物), DASHSCOPE_API_KEY (通义千问), ARK_API_KEY (豆包), MINIMAX_API_KEY, STEPFUN_API_KEY (阶跃星辰), SENSENOVA_API_KEY (商汤)
Custom: Set LLM_API_KEY + LLM_BASE_URL + LLM_MODEL for any OpenAI-compatible endpoint.
Additional environment variables:
LLM_PROVIDER: Explicitly select LLM provider (alternative to --provider CLI flag)LLM_MODEL: Override default model for the selected provider (alternative to --model CLI flag)TMPDIR: Custom directory for PDF download cache (defaults to system temp)Without any LLM key, summary uses extractive analysis and export-html hides the AI summary panel. All other commands are unaffected. Run llm-providers to check status.
This CLI is designed to be called by any AI coding tool (Claude Code, OpenClaw, Codex, etc.):
共 1 个版本