Skip to main content

Kiwix ZIM file search CLI for LLM coding agents

Project description

kiwix-llm-cli

Kiwix ZIM file search CLI/Skill for coding agents.

Agentic search for Wikipedia, DevDocs, StackExchange, and other offline content from ZIM files.

Installation

uv tool install kiwix-llm-cli

kwxlc -h

Quick Start

  1. Initialize configuration (shows download directory):

    kwxlc init                    # Global config
    kwxlc init -p .               # Local config for project (./.kiwix-llm-cli.yaml)
    

    Config locations (Linux example, OS-dependent, see init output):

    • Global: ~/.config/kiwix-llm-cli/config.yaml
    • Download: ~/.local/share/kiwix-llm-cli/
  2. Get ZIM files:

    # Search and download from library.kiwix.org
    kwxlc remote catalog --lang eng --query wikipedia --count 5
    kwxlc remote download wikipedia_en_100_2026-04
    
    # Or download manually from https://library.kiwix.org/
    # Place in: ~/.local/share/kiwix-llm-cli/ (see your config.yaml)
    
  3. List discovered ZIM files:

    kwxlc list
    
  4. Search:

    kwxlc search "machine learning"
    

Skill Installation

Installs SKILL.md for coding agents (default: .claude/skills):

 # ./.claude/skills (default)
kwxlc install-skills

# ./.agents/skills
kwxlc install-skills -a opencode

# Both
kwxlc install-skills -a opencode -a claude-code

Commands Reference

kwxlc init [-p PATH]              # Generate config file
kwxlc list [-f FORMAT]            # List discovered ZIM files
kwxlc delete NAME [NAME...] [-f]  # Delete ZIM files (use -f to skip confirmation)
kwxlc search QUERY [-l LIMIT]     # Full-text search
kwxlc suggest TERM [-l LIMIT]     # Title suggestion
kwxlc get TITLE [-f FORMAT]       # Get article (markdown/html/raw)
kwxlc info                        # Show ZIM file info
kwxlc install-skills [-a AGENT]   # Install skill for coding agents
kwxlc --version                   # Show version

kwxlc remote catalog [OPTIONS]    # Search library.kiwix.org
kwxlc remote download NAME [-o DIR] # Download ZIM file

Options:
  -c, --config PATH       Config file path
  -b, --backend {libzim,api}  Backend selection
  -u, --kiwix-api-url URL     API endpoint URL
  -z, --zim NAME              ZIM file name/path

Configuration

Config File Locations (Linux example)

Type Location
Global ~/.config/kiwix-llm-cli/config.yaml
Local ./.kiwix-llm-cli.yaml (auto-detected)

Config Structure

default_zim: wikipedia_en_wp1-0.8_nopic_2026-04
backend: libzim # Default backend (libzim or api)
kiwix_api_url: http://localhost:8080 # API endpoint URL
search_dirs: # Directories to search for ZIM files
  - ~/.local/share/kiwix-llm-cli # Default (OS-dependent)
  - ~/Documents/zim
download_dir: ~/.local/share/kiwix-llm-cli

Priority (low to high)

  1. Global config
  2. Local config (./.kiwix-llm-cli.yaml)
  3. Environment variables (KWXLC_*)
  4. Command-line options (-c, --zim, --backend)

Environment Variables

KWXLC_DEFAULT_ZIM=wikipedia_en_wp1-0.8_nopic_2026-04
KWXLC_BACKEND=api
KWXLC_KIWIX_API_URL=http://localhost:8080

API Backend

Use kiwix-serve to serve ZIM files via HTTP UI/API.

When backend: api in config, commands default to API backend.

# Start kiwix-serve (example)
kiwix-serve --port 8080 ~/.local/share/kiwix-llm-cli/*.zim

# Config with backend: api
kwxlc search "query"  # Uses kiwix-serve automatically

# Or override explicitly
kwxlc search "query" --backend api --kiwix-api-url http://custom:9999

Development

# Setup
mise trust
uv sync --dev

# Lint & Format
uv run ruff check .
uv run ruff format .

# Type check
uv run ty check src/

# Test
uv run pytest

# Pre-commit
uv run pre-commit run --all-files

# Pin GitHub Actions versions
pinact run

Tips

  • OR/NOT operators are not supported (Xapian limitation)

Related Projects

  • Kiwix: Offline content reader

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kiwix_llm_cli-0.2.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kiwix_llm_cli-0.2.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file kiwix_llm_cli-0.2.0.tar.gz.

File metadata

  • Download URL: kiwix_llm_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kiwix_llm_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fcc58a13e2b2b1a5816a969cd53a9d996c460d9a8daf7da8357faf4dc80a3110
MD5 3f790e86f94dd52a03cc478b56c75d1b
BLAKE2b-256 8aa35bd508cb4595ead9dec553978c4aeec13239f70cd0a3b55f8a0125596068

See more details on using hashes here.

File details

Details for the file kiwix_llm_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: kiwix_llm_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kiwix_llm_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff0e081cf1d75404e7d15ae0f4ae2d53e105c2d75221b98a5c99fcc1104910a
MD5 b092cfdc72f390b7ad68d986ea9a7c9b
BLAKE2b-256 6577e168e9a1fbe63b07e0dd583c1170346ac136e9d2b5136a36dcda2f702a33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page