⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

s2-cli

@huggingface⭐ 31 stars

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.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐ 31 on GitHubGitHub ↗

Growing

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

s2 CLI and Skill

A fast, read-only command-line client for the Semantic Scholar Graph API, alongside a Skill for coding agents.

Built to power Papers with Code's chat interface.

Use s2 to:

  • list the papers a work cites (s2 refs)
  • list the papers that cite a work (s2 citations)
  • search the Semantic Scholar graph when a paper may not be in a local catalog

This CLI requires an API key. Set PWC_SEMANTIC_SCHOLAR_API_KEY or S2_API_KEY. Request a key at Semantic Scholar's API page.

s2 refs "Attention is All You Need"
s2 citations ARXIV:1706.03762 --limit 50
s2 search "image dehazing" --year 2025-2026 --limit 100 --json

Installation

Python 3.10 or newer is required.

With uv:

uv tool install git+https://github.com/huggingface/s2-cli.git

Or with pipx:

pipx install git+https://github.com/huggingface/s2-cli.git

From a clone:

git clone https://github.com/huggingface/s2-cli.git
cd s2-cli
uv tool install .

Confirm the installation:

s2 version

Add the CLI Skill

Copy SKILL.md into your agent's skills directory:

mkdir -p .agents/skills/s2-cli
curl -LsSf https://raw.githubusercontent.com/huggingface/s2-cli/main/SKILL.md \
  -o .agents/skills/s2-cli/SKILL.md

Quick start

export S2_API_KEY=...   # or PWC_SEMANTIC_SCHOLAR_API_KEY

s2 refs "Attention is All You Need"
s2 refs 1706.03762 --limit 50 --offset 20
s2 citations ARXIV:1706.03762 --json
s2 search "scene graph generation" --limit 100
s2 search "scene graph generation" --year 2025-2026 --limit 100 --json

PAPER accepts a quoted title, an arXiv ID (1706.03762, arXiv:1706.03762), a DOI, a 40-character Semantic Scholar paper ID, a prefixed ID (ARXIV:, DOI:, CorpusId:, PMID:, URL:), or an arXiv / Semantic Scholar URL. Titles are resolved with Semantic Scholar's closest-title match. The matched title, paper ID, arXiv ID, and match score are printed on stderr so a bad match is visible. Pass an ID if the header is wrong.

Command reference

CommandDescription
s2 refs PAPERPapers this paper cites (bibliography)
s2 citations PAPERPapers that cite this paper
s2 search QUERYRelevance search over the Semantic Scholar graph
s2 versionShow the CLI version

Shared flags: --limit, --offset, --json, --fields. s2 search also accepts --year (2025 or 2025-2026). Defaults are --limit 20. Search --limit maxes at 100; refs/citations max at 1000. There is no --all; rerun with --offset when stderr prints # more.

Citation requests must keep offset + limit <= 9999. Highly cited papers are not fully enumerable through this CLI.

Output and scripting

List commands print lossless TSV (paperId, year, cites, arxiv, title). Add --json for the raw Semantic Scholar payload wrapped as:

{
  "schema_version": "v1",
  "paper": {"id": "ARXIV:1706.03762"},
  "data": {}
}

paper is present on refs and citations. Search JSON includes abstracts in data by default.

Stable exit codes:

CodeMeaning
0Success
2Invalid usage or missing API key
3Network, server, or exhausted rate-limit failure
4Not found or invalid API response

Configuration

VariableMeaning
PWC_SEMANTIC_SCHOLAR_API_KEYPreferred API key
S2_API_KEYFallback API key if the preferred key is unset
S2_REQUEST_DELAYSeconds to wait between requests (default 1.5)

The CLI never reads a secondary historical-backfill key. It sends x-api-key, honors Retry-After on HTTP 429, and identifies itself as s2-cli/<version>.

Development

uv run --with pytest pytest tests

// HOW IT'S BUILT

KEY FILES

SKILL.mdREADME.md

// REPO STATS

31 stars