Agent skill

Anserini CLI

by castorini in castorini/anserini

Run Anserini command-line and REST workflows from either a built fatjar or an Anserini source checkout.

Apache-2.0Auto-check passed

Install Anserini CLI

skills CLI
$ npx skills add castorini/anserini --skill anserini-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install castorini/anserini anserini-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/castorini/anserini.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/anserini-cli .claude/skills/anserini-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
anserini-cli
GitHub stars
1.2k
Token cost
~2.2k tokens
SKILL.md length
694 words
Files
2
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Run Anserini command-line and REST workflows from either a built fatjar or an Anserini source checkout.

  • PrebuiltIndexRegistry
  • SKILL.md covers Overview, Runtime Check, Prebuilt Index Registry and Topics Registry, plus 6 more sections
  • Calls java, jq and curl
  • Interactive search

What it does

Anserini CLI is an agent skill from castorini/anserini. Run Anserini command-line and REST workflows from either a built fatjar or an Anserini source checkout. Use for PrebuiltIndexRegistry, TopicsRegistry, ad hoc search, interactive search, output formats, and RestServer examples.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

The repository describes itself as: Anserini is a Lucene toolkit for reproducible information retrieval research. The licence is Apache-2.0.

When your agent uses it

  • PrebuiltIndexRegistry
  • Interactive search
  • RestServer examples

Example prompts

  • “/anserini-cli”

What it can do on your machine

Read from SKILL.md and the folder at commit 1841646. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • java
    • jq
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Anserini CLI loads about 2.2k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 694 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from castorini/anserini at commit 1841646, republished under its Apache-2.0 licence (© castorini). 694 words, ~2,230 tokens.

Download SKILL.mdSave it as .claude/skills/anserini-cli/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
anserini-cli
description
Run Anserini command-line and REST workflows from either a built fatjar or an Anserini source checkout. Use for PrebuiltIndexRegistry, TopicsRegistry, ad hoc search, interactive search, output formats, and RestServer examples.
metadata.version
v0.3.0

Use Anserini CLI

Overview

Use this skill when Anserini is already available through either a resolved fatjar or a source checkout. This skill covers command usage, not environment setup or builds. If no usable fatjar or checkout is present, use $install-anserini-fatjar or $install-anserini-dev-env first.

Do not run commands that trigger large prebuilt-index downloads unless the user explicitly asks for retrieval experiments or index downloads.

Examples below use the fatjar form:

bash
java -cp "$ANSERINI_JAR" <main-class> <args>

From an Anserini source checkout, replace java -cp "$ANSERINI_JAR" with bin/run.sh:

bash
bin/run.sh <main-class> <args>

Keep commands pinned to the same jar or checkout unless the user asks to change versions.

Runtime Check

For a fatjar workflow, confirm ANSERINI_JAR is set and points to an existing jar:

bash
test -n "$ANSERINI_JAR"
test -f "$ANSERINI_JAR"

For a checkout workflow, confirm bin/run.sh is available:

bash
test -x bin/run.sh

A useful functional smoke test is:

bash
java -cp "$ANSERINI_JAR" io.anserini.search.SearchCollection \
  -threads 1 \
  -index cacm \
  -topics cacm \
  -output run.cacm.bm25.txt \
  -hits 1000 \
  -bm25

This command may download the small CACM prebuilt index and topics on first use.

Prebuilt Index Registry

To inspect prebuilt indexes exposed by io.anserini.cli.PrebuiltIndexRegistry, run:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --list

--list emits JSON in current jars, so prefer --filter and jq instead of grepping raw output. If jq is not available, ask the user whether it should be installed before relying on jq examples.

msmarco-v1-passage is a common choice and should be called out when users ask about available prebuilt indexes or MS MARCO passage retrieval setup.

Recommended lookup for the standard MS MARCO V1 passage inverted index:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --list --filter '^msmarco-v1-passage$' \
  | jq '.[0] | {name, type, description, filename}'

Useful variants:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --help
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --list --filter 'msmarco.*passage' | jq '.[].name'
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --type flat --list
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --type inverted --list
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --type impact --list
java -cp "$ANSERINI_JAR" io.anserini.cli.PrebuiltIndexRegistry --type hnsw --list

Topics Registry

To inspect topics exposed by io.anserini.cli.TopicsRegistry, run:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.TopicsRegistry --list

--list emits canonical topic names as JSON. Use --filter <regexp> to narrow the registry with a regular expression:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.TopicsRegistry --list --filter 'msmarco' | jq '.'

--get writes parsed topics as JSON to stdout:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.TopicsRegistry --get <name>

--metadata writes the canonical name, aliases, registered path, reader class, and downloaded local path as JSON to stdout:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.TopicsRegistry --metadata <name>

Both --get and --metadata download the registered topics when needed.

For the standard MS MARCO V1 passage queries that pair with the msmarco-v1-passage prebuilt index, use the canonical name msmarco-passage.dev-subset:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.TopicsRegistry --metadata msmarco-passage.dev-subset | jq '.'

Aliases such as msmarco-v1-passage.dev are also accepted by --get and --metadata.

Qrels Registry

To inspect qrels exposed by io.anserini.cli.QrelsRegistry, run:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.QrelsRegistry --list

--list emits canonical qrels names as JSON. Use --filter <regexp> to narrow the registry with a regular expression:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.QrelsRegistry --list --filter 'msmarco' | jq '.'

--get writes raw qrels to stdout:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.QrelsRegistry --get <name>

--metadata writes the canonical name, aliases, registered path, and downloaded local path as JSON to stdout:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.QrelsRegistry --metadata <name>

Both --get and --metadata download the registered qrels when needed.

For the standard MS MARCO V1 passage relevance judgments that pair with the msmarco-v1-passage prebuilt index, use the canonical name msmarco-passage.dev-subset:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.QrelsRegistry --metadata msmarco-passage.dev-subset | jq '.'

Search CLI

Use io.anserini.cli.Search for ad hoc retrieval against either a local Lucene index path or a prebuilt index name.

Example using the popular msmarco-v1-passage prebuilt index:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.Search --index msmarco-v1-passage --query "what is a lobster roll" --hits 10 --json

Interactive mode:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.Search --index msmarco-v1-passage --interactive --json

Useful output variants:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.Search --index msmarco-v1-passage --query "what is a lobster roll" --json
java -cp "$ANSERINI_JAR" io.anserini.cli.Search --index msmarco-v1-passage --query "what is a lobster roll" --trec
Show full SKILL.md (266 more words)Show less

Get Document CLI

Use io.anserini.cli.GetDocument to fetch the stored raw document for a collection docid from either a local Lucene index path or a prebuilt index name.

Example using the popular msmarco-v1-passage prebuilt index:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.GetDocument --index msmarco-v1-passage --docid 2161721

Interactive mode reads docids from stdin:

bash
java -cp "$ANSERINI_JAR" io.anserini.cli.GetDocument --index msmarco-v1-passage --interactive

This command prints the document's stored raw field. It reports an error when the docid is not found or when the index does not store raw documents.

SearchCollection

Use io.anserini.search.SearchCollection for batch retrieval over a topic set. It writes TREC run files and supports retrieval-model flags such as -bm25, -rm3, -rocchio, -hits, and -threads. Use io.anserini.cli.Search instead for single-query or interactive inspection.

Canonical CACM example using a prebuilt index and built-in topic symbol:

bash
java -cp "$ANSERINI_JAR" io.anserini.search.SearchCollection \
  -index cacm \
  -topics cacm \
  -output run.cacm.bm25.txt \
  -hits 1000 \
  -bm25

Evaluate the CACM run with Anserini's Java trec_eval wrapper:

bash
java -cp "$ANSERINI_JAR" io.anserini.eval.TrecEval \
  -c \
  -m map \
  -m P.30 \
  cacm \
  run.cacm.bm25.txt

Expected scores are MAP 0.3123 and P30 0.1942.

To verify them mechanically:

bash
java -cp "$ANSERINI_JAR" io.anserini.eval.TrecEval \
  -c \
  -m map \
  -m P.30 \
  cacm \
  run.cacm.bm25.txt | tee eval.cacm.bm25.txt

grep -Eq '^map[[:space:]]+all[[:space:]]+0\.3123$' eval.cacm.bm25.txt
grep -Eq '^P_30[[:space:]]+all[[:space:]]+0\.1942$' eval.cacm.bm25.txt

REST API Server

Use io.anserini.api.RestServer to expose search and document lookup over HTTP.

Fatjar invocation:

bash
java -cp "$ANSERINI_JAR" io.anserini.api.RestServer --port 8081

Sample requests against the popular msmarco-v1-passage index:

bash
curl "http://localhost:8081/v1/msmarco-v1-passage/search?query=what%20is%20anserini&hits=5"
curl "http://localhost:8081/v1/msmarco-v1-passage/doc/2161721"

This REST workflow is most useful when users want to query the same prebuilt indexes exposed by the CLI, especially msmarco-v1-passage.

Troubleshooting

  • No fatjar found: use $install-anserini-fatjar to download a released Maven Central fatjar, or $install-anserini-dev-env if the user needs a jar built from the source checkout.
  • Missing bin/run.sh: use $install-anserini-dev-env from an Anserini checkout.
  • ClassNotFoundException: confirm the jar or checkout was built from the expected Anserini version.
  • RestServer reports Port already in use for unused ports in a sandboxed Codex session: local socket binding may be blocked by sandbox permissions. Rerun the server command with escalation, and use an available high local port if the documented port is occupied.

© castorini, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/anserini-cli of castorini/anserini.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 1841646

Compare with similar skills

Anserini CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Anserini CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Anserini CLI this skillcastorini/anserini1.2k—~2.2kAutomated safety check: PassApache-2.0
Agentmemory REST APIrohitg00/agentmemory29k—~404Automated safety check: PassApache-2.0
Phoenix REST APIArize-ai/phoenix12k—~286Automated safety check: PassCustom licence
Onesignal REST API AutomationComposioHQ/awesome-claude-skills77k3 repos~754Automated safety check: PassNone
Shorten REST AutomationComposioHQ/awesome-claude-skills77k3 repos~749Automated safety check: PassNone
Fp Either Refsickn33/agentic-awesome-skills47k2 repos~655Automated safety check: PassMIT

Similar skills

  • Agentmemory REST API

    rohitg00/agentmemory

    Covers the HTTP REST endpoints of the agentmemory server, its primary interface, for hosts without MCP or when MCP is unavailable.

    29k GitHub stars~404 tokensUpdated today
    Backend & APIsAuto-check passed
  • Phoenix REST API

    Arize-ai/phoenix

    REST API development for Phoenix. An agent skill from Arize-ai/phoenix.

    12k GitHub stars~286 tokensUpdated today
    Backend & APIsAuto-check passed
  • Onesignal REST API Automation

    ComposioHQ/awesome-claude-skills

    Automate OneSignal tasks via Rube MCP (Composio). An agent skill from ComposioHQ/awesome-claude-skills.

    77k GitHub starsUsed in 3 repos~754 tokens
    Productivity & AutomationAuto-check passed
  • Shorten REST Automation

    ComposioHQ/awesome-claude-skills

    Automate Shorten Rest tasks via Rube MCP (Composio). An agent skill from ComposioHQ/awesome-claude-skills.

    77k GitHub starsUsed in 3 repos~749 tokens
    Productivity & AutomationAuto-check passed
  • Fp Either Ref

    sickn33/agentic-awesome-skills

    Quick reference for Either type. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~655 tokens
    Auto-check passed
  • Fastapi REST API Design

    open-edge-platform/anomalib

    Designs and reviews REST APIs for FastAPI services using consistent resource naming, HTTP semantics, validation, security, and error handling patterns.

    6.2k GitHub stars~838 tokensUpdated today
    Backend & APIsAuto-check passed

More from castorini/anserini

  • Anserini Reproduction

    castorini/anserini

    Reproduce experimental results with Anserini. An agent skill from castorini/anserini.

    1.2k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Install Anserini Dev Env

    castorini/anserini

    Set up and verify Anserini source-development environments. An agent skill from castorini/anserini.

    1.2k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Install Anserini Fatjar

    castorini/anserini

    Install and verify Anserini quickly by downloading the published fatjar from Maven Central instead of cloning or building the source repository.

    1.2k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Questions about Anserini CLI

What does Anserini CLI do?

Run Anserini command-line and REST workflows from either a built fatjar or an Anserini source checkout. Anserini CLI is an agent skill from castorini/anserini. Run Anserini command-line and REST workflows from either a built fatjar or an Anserini source checkout.

When should I use Anserini CLI?

Anserini CLI fits situations like: prebuiltIndexRegistry; interactive search; restServer examples.

How do I install Anserini CLI in Claude Code?

Run `npx skills add castorini/anserini --skill anserini-cli -a claude-code`. Or copy the skill folder (.agents/skills/anserini-cli in castorini/anserini) into .claude/skills/anserini-cli in your project. Claude Code loads it when a task matches its description.

How do I install Anserini CLI in Codex?

Run `npx skills add castorini/anserini --skill anserini-cli -a codex`. Or copy the skill folder (.agents/skills/anserini-cli in castorini/anserini) into .agents/skills/anserini-cli in your project. Codex loads it when a task matches its description.

Can I use Anserini CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add castorini/anserini --skill anserini-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/anserini-cli, .gemini/skills/anserini-cli, .github/skills/anserini-cli and .opencode/skills/anserini-cli in your project.

What does Anserini CLI need to run?

Going by SKILL.md and its folder, Anserini CLI needs the command-line tools its instructions call (java, jq and curl).

Does Anserini CLI access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Anserini CLI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Anserini CLI use?

Anserini CLI is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Anserini CLI use?

About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Anserini CLI?

Skills that share tags, products or a category with Anserini CLI: Agentmemory REST API (rohitg00/agentmemory, 29k stars), Phoenix REST API (Arize-ai/phoenix, 12k stars), Onesignal REST API Automation (ComposioHQ/awesome-claude-skills, 77k stars) and Shorten REST Automation (ComposioHQ/awesome-claude-skills, 77k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Anserini CLI?

castorini (a GitHub organization) maintains it in castorini/anserini, which has 1,197 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 9, 2026.

Source: castorini/anserini on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.