CLI tool
yashsinghcodes/wik avatar
yashsinghcodes/wik

wik is a Wikipedia reader for the terminal with a disk cache

wik is use to get information about anything on the shell using Wikipedia.

687 stars27 forksPythonMIT

At a glance

What is it?
wik is a small Python command line tool that pulls Wikipedia article text, summaries, searches and random pages into your shell, with an on-disk cache that lets repeat queries work offline. It suits a Linux or macOS user who wants a fact without opening a browser, and it scrapes the HTML rather than using the API.
Who is it for?
Adopt wik when you want quick reference lookups from a terminal, on a machine with a working network connection, and keep a browser or a proper API client for anything that needs citations, images or a stable contract. Verify first that the page format you depend on still parses, because the tool reads Wikipedia through beautifulsoup4 rather than through the MediaWiki API, and note that the only published release is dated 2021.06 even though the last push was on 2026-09-18.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 35 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Four flags cover the whole interaction, and the help text is short

The tool does one thing, which is why its entire command line fits in a few lines. The usage string is wik [-h] [-s SEARCH] [-i INFO] [-q QUICK] [-l LANG] [-x] [--no-cache] [--clear-cache]. The -s and --search flag searches any topic, -i and --info gets info on any topic, and -q and --quick gets the summary on any topic. The -l and --lang flag gets the info in your native language, with English as the default. The -x and --rand flag gets a random Wikipedia article, which is a small touch but the kind of thing that turns a utility into something you keep. The remaining two are cache controls. The design reads as a decision to keep the interface to a size you can hold in your head, which is the right call for a tool whose only purpose is a quick lookup.

The on-disk cache is what makes repeat queries instant and offline capable

The cache section is short but changes the character of the tool. WIK stores pages on disk so repeated queries are instant and can work offline, and you can disable caching per run with --no-cache or clear the cache with --clear-cache. The two cache commands look like this:

bash
wik --no-cache -i Linux
wik --clear-cache

The offline capability is the interesting part. A tool that only worked online would be a browser shortcut, but one that keeps what it has fetched can answer a question on a train with no signal, provided you have looked that page up before. The trade is freshness, which is the usual trade for any cache and is worth naming because Wikipedia articles change. A cached answer is an answer as of the last fetch, and for a reference lookup that is usually fine. The flag design also tells you the cache is per run, not a mode you toggle, so the default behaviour is the cached one and the exceptions are explicit.

Installation is one pip command on Linux and macOS

The requirements are Python3 and beautifulsoup4, and both installation routes are documented. From PyPI, on Linux and macOS it is a single command:

bash
python3 -m pip install wik

The from source route is three commands, and it shows how the project is built. You install the build backend and the parser first, then clone, then install the package itself:

bash
python3 -m pip install beautifulsoup4 flit_core
git clone https://github.com/yashsinghcodes/wik.git
cd wik
python3 -m pip install .

The flit_core dependency is the build system, which the pyproject metadata confirms with a build backend of flit_core.buildapi and a build requirement of flit_core 3.2 or newer below 4. On Windows the same three commands are given with python instead of python3, plus a note that Windows users should add Python to their environment variables. The package is published as wik on PyPI with a homepage pointing at the repository, and the console script is registered as wik = wik.wik:arguments, which is a slightly unusual entry point shape since it points at a module attribute rather than a function.

The parsing is done with beautifulsoup4, not the MediaWiki API

The dependency list in the pyproject metadata is beautifulsoup4 and requests, and the requirements section names beautifulsoup4 as well. That combination tells you the mechanism. The tool fetches a Wikipedia page over HTTP with requests and then parses the returned HTML with beautifulsoup4 to extract the article text. There is no mention of the MediaWiki action API or of the REST endpoints, so the content is being read out of the rendered page. That is a design decision with consequences in both directions. In its favour, it needs no API key and no registration, and it works against the same public page a browser would show, so there is nothing to configure. Against it, the extraction depends on the shape of the Wikipedia HTML, which is not a stable contract, and it will pick up whatever is in the page structure rather than a structured response. A tool built on the API would give you clean extracts, revision identifiers and a documented contract, at the cost of a network call to a different endpoint. If the parsing breaks, this is the first thing to check.

The packaging is minimal, which is also the maintenance story

The pyproject metadata is short and says a lot. The project is named wik, authored by Yash Singh, requires Python 3.0 or newer, and carries a licence file reference with MIT terms and the matching classifier, plus a Production/Stable development status classifier and an Environment Console classifier. The version and description are dynamic, which is the flit convention of reading them from the module rather than duplicating them in the metadata. The optional dependency group is a single dev entry, flit itself, and the tool module is configured through tool.flit.module with the name wik. The repository layout matches: a wik/ directory holding the package, a test/ directory, a docs/ directory with the screenshot used in the README, a pyproject.toml, a .pyup.yml for dependency updates, and a LICENSE. There is no configuration file, no plugin mechanism and no daemon, which is the right shape for this kind of tool, and also means there is nothing to tune when something does not behave as expected.

The release and commit dates tell two different stories

The maintenance picture needs both dates, and reading only one of them would mislead you. The repository is not archived, and the last push was on 2026-09-18, so somebody is committing to the code. The published release list, however, contains a single entry, 2021.06 as a June Release dated 2021-06-19, and the recent releases field carries no version numbers beyond that. So the code is being touched while the version on PyPI is years old. That is consistent with a small personal project where the author keeps fixing things in the repository and the PyPI upload has not been repeated, and it has a concrete consequence for anyone installing from PyPI. You get the 2021 release, not the current state of the tree, and the difference may include the fixes made since. The MIT licence is standard, so there is no obstacle to forking or vendoring the code, and the contributor section invites issues, pull requests and direct email feedback. The entry point into the project is the PyPI project page.

Where wik is the wrong tool

Three cases argue against it. The first is anything that needs a citable, current or structured answer. The tool gives you article text from a page, without a revision identifier, without a permalink to the exact revision, and without the reference list in a form you could cite. For anything where the source matters, a browser and the Wikipedia article itself is the better path, and the API is better still. The second is a task that needs more than prose. Images, tables, infoboxes, disambiguation handling and section structure are all outside what this tool promises, and the parse is by nature text oriented. The third is a scripting environment where you want reliability rather than convenience, because a tool that scrapes rendered HTML has no interface contract, so a markup change upstream turns into a silently wrong answer rather than an error. The alternative worth naming is not another scraper but the MediaWiki API itself, which returns structured JSON with a documented schema and is what an automated pipeline should call. wik is at its best in the gap between that and a browser, which is the moment you want one fact and you want it now. It also has the virtue of being small enough to read. The whole implementation is a wik/ package and a test/ directory, so if you want to know exactly what it returns, you can read it.

Editorial conclusion

Adopt wik when you want quick reference lookups from a terminal, on a machine with a working network connection, and keep a browser or a proper API client for anything that needs citations, images or a stable contract. Verify first that the page format you depend on still parses, because the tool reads Wikipedia through beautifulsoup4 rather than through the MediaWiki API, and note that the only published release is dated 2021.06 even though the last push was on 2026-09-18.

Frequently asked questions

What does the wik command do?

It is a command line tool to view Wikipedia pages from your terminal and to search Wikipedia articles with a single query. The options include search, info, quick summary, language selection, a random article flag and two cache controls.

How do I install wik?

On Linux and macOS, install it from PyPI with python3 -m pip install wik, or clone the repository and run python3 -m pip install . after installing beautifulsoup4 and flit_core. On Windows the same commands work with python instead of python3, and Python has to be on the environment path.

Can wik work offline?

Yes, for pages it has already fetched. WIK stores pages on disk so repeated queries are instant and can work offline, and you can skip the cache for one run with --no-cache or remove it with --clear-cache.

How does wik fetch Wikipedia content?

The project dependencies are beautifulsoup4 and requests, so pages are fetched over HTTP and parsed out of the HTML rather than being requested through the MediaWiki API. The build uses flit_core, the package requires Python 3.0 or newer, and the console script is registered as wik = wik.wik:arguments.

Is wik still maintained?

The repository is not archived and the last push was on 2026-09-18, but the only published release is 2021.06 from 2021-06-19, so a PyPI install gives you the 2021 release rather than the current state of the tree. The licence is MIT and the project is published under the name wik on PyPI.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. yashsinghcodes/wik on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/yashsinghcodes-wik.svg)](https://hysenlabs.com/projects/yashsinghcodes-wik)

Was this useful?