$npx -y skills add neuromechanist/research-skills --skill openciteUse this skill for "search for papers", "find citations", "look up a DOI", "get BibTeX", "download PDF", "convert PDF to markdown", "find canonical papers", "convert identifiers", "batch download papers", "configure opencite", "literature review", "find related papers", "what pap
| 1 | # OpenCite CLI |
| 2 | |
| 3 | OpenCite is a CLI tool for academic literature search and citation management. It aggregates results from Semantic Scholar, OpenAlex, PubMed, arXiv, and bioRxiv/medRxiv, deduplicates them, and outputs formatted results. It also supports PDF retrieval, PDF-to-markdown conversion, and batch operations. |
| 4 | |
| 5 | ## Installation |
| 6 | |
| 7 | ```bash |
| 8 | # Recommended |
| 9 | uv pip install opencite |
| 10 | |
| 11 | # Alternative: run without installing |
| 12 | uvx opencite --version |
| 13 | ``` |
| 14 | |
| 15 | PDF conversion support (markitdown and markit-mistral) is included by default. When `MISTRAL_API_KEY` is set, markit-mistral handles math, tables, and complex layouts. Otherwise, markitdown (free, local) is the fallback. |
| 16 | |
| 17 | For development: |
| 18 | ```bash |
| 19 | uv sync --extra dev |
| 20 | ``` |
| 21 | |
| 22 | ## Research Workflow |
| 23 | |
| 24 | Follow this end-to-end workflow for literature research, paper retrieval, or reading material on a topic. |
| 25 | |
| 26 | ### 1. Search for relevant papers |
| 27 | |
| 28 | Choose the search strategy based on the request: |
| 29 | |
| 30 | - **Canonical/foundational papers**: `uvx opencite canonical "topic" --max 10` |
| 31 | - **Recent or specific papers**: `uvx opencite search "query" --max 20 --sort citations` |
| 32 | - **Citation graph exploration**: `uvx opencite cite "DOI" --direction both` |
| 33 | - Combine strategies when appropriate (e.g., canonical for background + search for recent work) |
| 34 | |
| 35 | ### 2. Evaluate and select papers |
| 36 | |
| 37 | Review results considering citation count, relevance, recency, and open access availability. Present a summary and confirm which papers to retrieve. |
| 38 | |
| 39 | ### 3. Download and convert |
| 40 | |
| 41 | **For multiple papers (preferred):** Save search results as JSON and use batch-fetch: |
| 42 | |
| 43 | ```bash |
| 44 | uvx opencite search "topic" --max 10 -f json -o results.json |
| 45 | uvx opencite batch-fetch --from-json results.json --convert -o ./papers --summary report.json |
| 46 | ``` |
| 47 | |
| 48 | `batch-fetch --convert` automatically creates this directory structure: |
| 49 | |
| 50 | ``` |
| 51 | papers/ |
| 52 | ├── pdf/ # downloaded PDFs |
| 53 | └── markdown/ # converted markdown files |
| 54 | └── img/ # per-paper image directories (mistral only) |
| 55 | ``` |
| 56 | |
| 57 | **For individual papers:** |
| 58 | |
| 59 | ```bash |
| 60 | uvx opencite pdf "10.1234/example" -o papers/pdf/ --convert |
| 61 | ``` |
| 62 | |
| 63 | Note: `pdf --convert` places the markdown file next to the PDF and does not extract images. For the organized subdirectory layout with image extraction, use `batch-fetch`. |
| 64 | |
| 65 | ### 4. Read and synthesize |
| 66 | |
| 67 | Read the converted markdown files for deeper analysis: |
| 68 | |
| 69 | - Summarize key findings across papers |
| 70 | - Identify common themes and disagreements |
| 71 | - When using `batch-fetch`, markdown is in `papers/markdown/` and extracted images (markit-mistral only) are in per-paper subdirectories under `papers/markdown/img/` |
| 72 | - Generate BibTeX for citation: `uvx opencite lookup "DOI" -f bibtex --append-bib refs.bib` |
| 73 | |
| 74 | ## Command Summary |
| 75 | |
| 76 | | Command | Purpose | |
| 77 | |---------|---------| |
| 78 | | `search` | Find papers matching a query across multiple APIs | |
| 79 | | `lookup` | Look up a specific paper by DOI, PMID, PMCID, or other identifier | |
| 80 | | `cite` | Get citing/cited-by papers for a given identifier | |
| 81 | | `canonical` | Find the most-cited, foundational papers for a topic | |
| 82 | | `pdf` | Download a PDF for a paper by identifier | |
| 83 | | `convert` | Convert a local PDF file to markdown | |
| 84 | | `ids` | Convert between identifier types (DOI, PMID, PMCID) | |
| 85 | | `batch-fetch` | Download PDFs for multiple papers with optional conversion | |
| 86 | | `config` | Manage opencite configuration (init, show, path) | |
| 87 | |
| 88 | For full option listings, see [references/cli-reference.md](references/cli-reference.md). |
| 89 | |
| 90 | ## Configuration Essentials |
| 91 | |
| 92 | Initialize configuration and check resolved values: |
| 93 | |
| 94 | ```bash |
| 95 | uvx opencite config init # create ~/.opencite/config.toml template |
| 96 | uvx opencite config show # display resolved config (keys masked) |
| 97 | ``` |
| 98 | |
| 99 | Key environment variables: |
| 100 | - `SEMANTIC_SCHOLAR_API_KEY` - Semantic Scholar API |
| 101 | - `PUBMED_API_KEY` - NCBI/PubMed API |
| 102 | - `OPENALEX_API_KEY` - OpenAlex API (required since Feb 2026) |
| 103 | - `MISTRAL_API_KEY` - Enhanced PDF-to-markdown conversion (optional) |
| 104 | |
| 105 | For full configuration details including publisher tokens and loading priority, see [references/api-keys-and-config.md](references/api-keys-and-config.md). |
| 106 | |
| 107 | ## Error Handling |
| 108 | |
| 109 | - **Rate limits**: Semantic Scholar has aggressive rate limiting (1 req/sec). When rate limit errors occur, wait and retry. |
| 110 | - **Missing API keys**: Commands warn about missing keys but still query available sources. |
| 111 | - **Timeouts**: Retry the command or try a different source with `--source`. |
| 112 | - **PDF not found**: opencite reports which sources were tried and why each failed. Papers behind paywalls |