wiki
CLI to read Wikipedia articles, search, query Wikidata, fetch metrics and stream dumps.
Tested on Linux
Use it
Linux x86_64
You need first
- Runtimes:
Go 1.26+ - Needs the network
Download linux_amd64 release tarball and install wiki to ~/.local/bin
curl -sL -o /tmp/wiki.tar.gz https://github.com/tamnd/wikipedia-cli/releases/download/v0.4.9/wiki_0.4.9_linux_amd64.tar.gz && mkdir -p ~/.local/bin && tar -xzf /tmp/wiki.tar.gz -C /tmp && cp /tmp/wiki ~/.local/bin/wiki && chmod +x ~/.local/bin/wiki && ~/.local/bin/wiki --version
Check that it works
wiki --versionThe output should contain “wiki version dev”.
First thing to try
cat > /tmp/sample.xml <<'XML'
<mediawiki version="0.11" xml:space="preserve" xmlns="http://www.mediawiki.org/xml/export-0.11/">
<siteinfo>
<sitename>Wikipedia</sitename>
<dbname>enwiki</dbname>
<base>https://en.wikipedia.org/wiki/Main_Page</base>
<generator>MediaWiki 1.44.0</generator>
<case>first-letter</case>
<namespaces>
<namespace key="0" case="first-letter" />
</namespaces>
</siteinfo>
<page>
<title>Alan Turing</title>
<ns>0</ns>
<id>12345</id>
<revision>
<id>1</id>
<timestamp>2024-01-01T00:00:00Z</timestamp>
<contributor><username>Test</username><id>1</id></contributor>
<comment>test</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="27" xml:space="preserve">'''Alan Turing''' was great.</text>
<sha1>abc</sha1>
</revision>
</page>
<page>
<title>Quantum computing</title>
<ns>0</ns>
<id>12346</id>
<revision>
<id>2</id>
<timestamp>2024-01-02T00:00:00Z</timestamp>
<contributor><username>Test</username><id>1</id></contributor>
<model>wikitext</model>
<format>text/x-wiki</format>
<text bytes="20" xml:space="preserve">Quantum is cool.</text>
<sha1>def</sha1>
</revision>
</page>
</mediawiki>
XML
cat /tmp/sample.xmlwiki dump pages /tmp/sample.xml --quiet -o jsonlRun wiki read "<article title>" to print a Wikipedia article in your terminal.
What it does
- Read Wikipedia articles as textTested
How to use it
- Run
wiki read "<article title>"to print the article.
- Run
- Search the full text of WikipediaTested
How to use it
- Run
wiki search "<your text>"to list matching articles with titles, descriptions, snippets and links.
- Run
- Query Wikidata with SPARQLTested
How to use it
- Run
wiki sparql '<your query>' --quiet -o jsonlto get one JSON result per line.
- Run
- Stream Wikipedia dump filesTested
How to use it
- Run
wiki dump pages <file> --quiet -o jsonlon a pages-articles XML dump. - Read one JSON line per page with its id, title, revision and timestamp.
- Run
How far pickfit got
Linux x86_64
- Installs
- Starts
- 4 of 4 features work
- Works offline
Good for
- read an article as paged text or markdown
- full-text search Wikipedia articles
- query a Wikidata entity
- fetch per-article pageview time series
- stream-parse a pages-articles dump
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
Its main function works
- Replayed from scratch
- Works offline
- Checked on 31 Oct 2026
- Version dev
Differences the test machine hit
- README: go install github.com/tamnd/wikipedia-cli/cmd/wiki@latest (requires Go 1.26+)
In the test: downloaded prebuilt linux_amd64 tarball from GitHub releases and copied wiki binary to ~/.local/bin - README: versioned release binary
In the test: binary prints 'wiki version dev' with no release number