| name | wikidata |
| description | Use wd-cli for Wikidata lookup and querying tasks, including name resolution, entity profiling, statement inspection, hierarchy traversal, and SPARQL execution. |
wikidata
When to use this skill
Use this skill when a user asks to retrieve or inspect Wikidata information from the terminal, especially when they ask for:
- disambiguating an entity name into likely QIDs
- concise entity profile summaries (company/person/place)
- item/property lookups by label
- direct statements for an entity
- values for a specific property on an entity
instance of / subclass of hierarchy traversal
- ad-hoc SPARQL queries against Wikidata Query Service
Tool overview
wd-cli is a CLI for querying Wikidata and related services.
Install globally:
npm i -g @osolmaz/wd-cli
Or run without installing:
npx -y @osolmaz/wd-cli --help
Command map
wd-cli search-items <query>
wd-cli search-properties <query>
wd-cli resolve <query>
wd-cli profile <entity-id>
wd-cli get-statements <entity-id>
wd-cli get-statement-values <entity-id> <property-id>
wd-cli get-instance-and-subclass-hierarchy <entity-id>
wd-cli execute-sparql [query]
Useful aliases:
search-items -> si
search-properties -> sp
get-statements -> statements
get-statement-values -> statement-values, values
get-instance-and-subclass-hierarchy -> hierarchy
execute-sparql -> sparql
High-signal usage patterns
Resolve then profile (recommended default flow):
wd-cli resolve "Marie Curie" --limit 5
wd-cli profile Q7186 --type person
Search entities:
wd-cli search-items "Douglas Adams"
wd-cli search-properties "occupation"
Inspect entity facts:
wd-cli get-statements Q42
wd-cli get-statement-values Q42 P106
wd-cli hierarchy Q42 --max-depth 2
wd-cli profile Q42 --type person
Run SPARQL:
wd-cli execute-sparql 'SELECT ?human WHERE { ?human wdt:P31 wd:Q5 } LIMIT 2'
wd-cli execute-sparql --file ./query.sparql
Machine-readable output:
wd-cli --json search-items "Douglas Adams"
wd-cli --json resolve "Marie Curie"
wd-cli --json profile Q7186 --type person
wd-cli --json sparql --query 'SELECT ?item WHERE { ?item wdt:P31 wd:Q5 } LIMIT 2'
Operational guidance
- Default output is text; use
--json for automation.
- Prefer QIDs/PIDs when known (
Q42, P31) to avoid ambiguity.
- For ambiguous names, use
resolve first, then run downstream commands on selected QID.
- Use
profile --type company|person|place for concise summaries before deep dives.
- Use
--no-vector on search commands when you need strict keyword search behavior.
- Use
--timeout for slow networks/services.
- For SPARQL, provide only one query source at a time: positional arg,
--query, or --file.
Relevant global flags
--json
--timeout <duration>
--user-agent <userAgent>
--wikidata-api-url <url>
--wikidata-query-url <url>
--textifier-url <url>
--vector-search-url <url>
--vector-api-secret <secret>
Environment variables
WD_API_URI
WD_QUERY_URI
TEXTIFER_URI / TEXTIFIER_URI
VECTOR_SEARCH_URI
WD_VECTORDB_API_SECRET
USER_AGENT
REQUEST_TIMEOUT_SECONDS