s2-cli
Skill31 starsChanged 3 months agoApache-2.0View on GitHub
Semantic Scholar CLI (`s2`) for on-demand citation graph lookup: papers a work cites, papers that cite a work, and graph search across 200M+ papers. Use whenever the user asks for Semantic Scholar, S2, cited papers, references, bibliography, citing papers, citation count from Semantic Scholar, or papers outside a local catalog. Prefer `s2` over curl or ad-hoc Graph API requests.
- Reads credentials
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- huggingface/paperswithcodeedited, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- huggingface/paperswithcode★ 31547% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use compact TSV for reading.
- Very specific: line 29
Default --limit is 20. Search max --limit is 100.
- Very specific: line 35
Use s2 search QUERY --limit 100 --json for graph-wide discovery.
- Very specific: line 36
Run a second s2 search QUERY --year 2025-2026 --limit 100 --json for a recent slice.
- Very specific: line 38
Use s2 refs PAPER for a bibliography and s2 citations PAPER for citing work.
- Very specific: line 41
Do not curl api.semanticscholar.org while this CLI is available.
- Distinctive: line 47
Default request pacing is 1.5s.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
The s2 CLI is read-only. It queries the Semantic Scholar Graph API and
requires S2_API_KEY or PWC_SEMANTIC_SCHOLAR_API_KEY. Run s2 --help or a
nested --help command when the live parser and this skill disagree; the
parser is authoritative.
Install with uv tool install git+https://github.com/huggingface/s2-cli.git.
Use compact TSV for reading. Add --json for programmatic filtering, joining,
or schema-dependent processing.
PAPER accepts a modern or legacy arXiv ID, a DOI, a 40-character Semantic
Scholar paper ID, a prefixed ID (ARXIV:, DOI:, CorpusId:, PMID:,
URL:), an arXiv or Semantic Scholar URL, or a quoted title. Title matching
uses Semantic Scholar's closest-title endpoint and prints a header with the
matched title, ID, arXiv ID, and match score. If the header is wrong, rerun
with an ID. Do not fall back to s2 search to resolve a specific paper.
Commands
s2 refs PAPER [--limit LIMIT] [--offset OFFSET] [--fields FIELDS] [--json]— papers this paper cites.s2 citations PAPER [--limit LIMIT] [--offset OFFSET] [--fields FIELDS] [--json]— papers that cite this paper.s2 search QUERY [--limit LIMIT] [--offset OFFSET] [--year YEAR] [--fields FIELDS] [--json]— search the Semantic Scholar graph.s2 version— show CLI and API contract versions.
Default --limit is 20. Search max --limit is 100; refs/citations max is
1000. There is no --all. When stderr prints # more: rerun with --offset N,
pass that offset. Citations must keep offset + limit <= 9999.
Research workflow
- Use
s2 search QUERY --limit 100 --jsonfor graph-wide discovery. - Run a second
s2 search QUERY --year 2025-2026 --limit 100 --jsonfor a recent slice. Do not treat one search as both the classic and recent lists. - Use
s2 refs PAPERfor a bibliography ands2 citations PAPERfor citing work. Quote titles. PreferARXIV:IDs after the first resolution. - Extract arXiv IDs from the
arxivTSV column orexternalIds.ArXivin JSON. - Do not curl
api.semanticscholar.orgwhile this CLI is available.
Output and limits
- Stable exit codes are
0success,2invalid usage or missing key,3network/rate-limit failure, and4not found or invalid API response. - Default request pacing is 1.5s. Do not page citations of famous papers up to the 10k cap unless the user explicitly asks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

