DeepSeek Harness Plugin

MingShi350/kiwix-wiki

Stars ★ 0 Downloads (30d) 1,030 Category Tools & Capabilities Added 2026-10-16 npm dsh-kiwix-wiki

Offline Wikipedia and ZIM lookups through your own kiwix-serve: the wiki_search, wiki_read and wiki_books tools run full-text search with snippets, read an article by exact title, and list the local ZIM library.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-kiwix-wiki

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:MingShi350/kiwix-wiki

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

English | 中文

kiwix-wiki — offline Wikipedia database query plugin

Adds a fully offline encyclopedia lookup channel to models / agents inside DSH: the wiki_search / wiki_read / wiki_books tools query your own kiwix-serve (the official ghcr.io/kiwix/kiwix-serve image) for pre-downloaded ZIM archives, and return article text, search hits and catalog facts that really exist.

What it is

  • Not a web search: no search engines, no page scraping, no API key, no outbound traffic. Every request goes only to the baseUrl you configure (default http://127.0.0.1:8090), and the data comes from a ZIM snapshot already on disk.
  • Not real-time information: the content is a snapshot, frozen at that ZIM's dump date (for example the 2026-08 Chinese Wikipedia with 3.54 million articles). Recent events are not in it; to update, drop in a newer ZIM — the plugin follows the newest dump by itself, with no config change.

When to use it: intranets / air-gapped environments / weak or missing outbound connectivity; giving a small local model some factual grounding; answers that must be reproducible and verifiable (what comes back is the original ZIM text, unaffected by search-ranking drift); or when your lookups should not leave the network. When you do have internet, it is a complement to web_search / web_fetch, not a replacement for them.

Starting from zero? See docs/quickstart.md: run kiwix-serve from the official Docker image, download a ZIM, install the plugin, how to change baseUrl (default http://127.0.0.1:8090), troubleshooting and security notes.

Registered model tools

Tool What it does Key parameters
wiki_search Full-text search (with snippet and total count) or exact title lookup (mode=title) query, mode, book, limit, offset
wiki_read Read a whole article by exact title (plain text, truncated automatically) title, book, maxChars
wiki_books List the local ZIM library (name / language / article count / full-text index yes-no) language, query

Default library: Chinese Wikipedia (the built-in default is the alias zh, which follows the newest ZIM automatically; you can also pin the exact filename of a local book). book accepts an exact ZIM name, an alias (zh / en / medicine / simple), a series name with the date stripped, or a substring of the book name.

Requirements and installation

This plugin contains no data; you provide two things yourself:

  1. a kiwix-serve HTTP service — the official image ghcr.io/kiwix/kiwix-serve (or the official kiwix-tools binaries);
  2. ZIM data files — download them from the official library https://download.kiwix.org/zim/ or https://library.kiwix.org, and put them in kiwix-serve's serving directory.

Install into DSH (the package is dsh-kiwix-wiki; pick either source):

# Option 1: from npm (simplest)
dsh plugin --profile web add dsh-kiwix-wiki

# Option 2: from a local directory (source checkout; this repository lives at /path/to/kiwix-wiki)
dsh plugin --profile web add /path/to/kiwix-wiki
# or add one line by hand in the profile's package.json: "dsh-kiwix-wiki": "link:/path/to/kiwix-wiki"

dsh web        # Host plugins only take effect after a restart

Full steps (Docker deployment, choosing a ZIM, how to configure, troubleshooting table) are in docs/quickstart.md.

Configuration (Config, every key optional, defaults shown)

config:
  baseUrl: http://127.0.0.1:8090   # kiwix-serve address, changeable at any time
  defaultBook: zh                  # prefer an alias (zh/en/medicine/simple); follows the newest ZIM
  timeoutMs: 15000
  maxTextChars: 24000
  catalogTtlMs: 60000              # catalog cache in ms; lower it to notice newly added ZIMs sooner

baseUrl defaults to localhost http://127.0.0.1:8090. To talk to a LAN / remote server, change this one key — pick one of two ways:

  • write it into the profile patch $DSH_HOME/profiles/<profile>/cordis.patch.yml (highest precedence, recommended);
  • or use an overlay file without touching the profile: dsh web --patch examples/kiwix-wiki.patch.yml.

Complete examples of both are in docs/quickstart.md section 5 and examples/kiwix-wiki.patch.yml. When the address is unreachable, the error names the baseUrl outright.

Swapping ZIMs needs no config change: defaultBook is best set to an alias (zh) or a date-free series name (wikipedia_zh_all_maxi), either of which selects the newest dump in that series. If you did pin a date-stamped exact name (such as wikipedia_zh_all_maxi_2025-09) while the server only has the newer one (…_2026-08), the plugin falls back to the newest dump of the same series and adds a note to the result; a book passed explicitly to a tool is never substituted — if it cannot be found you get an error listing the available library.

Zero dependencies: only Node's built-in node:http / node:https, no npm dependencies, no build step (global fetch is deliberately avoided — the reason is in the header comment of lib/kiwix.js).

Tests

npm test                   # offline unit tests + integration tests (integration tests skip themselves when the Kiwix server is unreachable)

Integration tests connect to http://127.0.0.1:8090 by default; point them at another server with the KIWIX_TEST_URL environment variable.

Deployment material

License

Plugin code: MIT, see LICENSE. ZIM data is not part of this repository and remains the copyright of its respective content providers (details in docs/quickstart.md section 10); this project is not affiliated with the Wikimedia Foundation or Kiwix/openZIM.

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.