Skip to content
wiki

Searching and discovering

Full-text search with CirrusSearch operators, prefix suggestions, random articles, and related pages.

wiki search "turing machine"

You get a table of titles with a short description and snippet. In a pipe it is JSONL, so it composes:

wiki search "climate change" -n 50 -o jsonl | wiki get - --summary
wiki search "physics" -o url | head

CirrusSearch operators

Wikipedia's search operators pass straight through, so you can scope a query precisely:

wiki search "incategory:Physics quantum"
wiki search "intitle:learning insource:python"
wiki search "morelike:Albert Einstein"

Cap the result count with -n and pick columns with --fields:

wiki search "volcano" -n 20 --fields title,description -o csv

Prefix suggestions

suggest is autocomplete: give a prefix, get the titles that start with it. It is what shell completion uses under the hood.

wiki suggest "Quantu"
wiki suggest "New Yor" -n 5 -o url

Random articles

wiki random                 # one random article
wiki random -n 5            # five of them
wiki random -N 14           # from a specific namespace

Random results are never cached, so each run is genuinely fresh.

Find articles the reader of one page is likely to want next:

wiki related "Alan Turing"
wiki related "Quantum computing" -o jsonl

Putting it together

Discover, then read. Search for a topic, take the first hit, and read its lead:

wiki search "general relativity" -n 1 -o jsonl | wiki get - --lead