$ show filiparag/wikiman
Wikiman is a CLI-based offline documentation search engine that aggregates multiple documentation sources (man pages, ArchWiki, Gentoo Wiki, FreeBSD docs, DevDocs, TLDR pages) into a unified fuzzy-search interface. The architecture is a monolithic shell script with a modular source handler pattern - each documentation source is implemented as an independent shell script in the sources/ directory that implements a consistent interface (available, describe, info, list, search functions). The main script (wikiman.sh) orchestrates parallel searches across sources, combines results, and presents them through a fuzzy finder (fzf/skim) with preview capability. Shell integration is provided via key-binding widgets for bash, fish, and zsh. The codebase demonstrates solid shell engineering practices: POSIX compatibility checks, clear function separation, proper error handling, and a clean extensible architecture for adding new documentation sources. The source module pattern is particularly well-designed - any new documentation source can be added by implementing the standard interface. The Makefile handles comprehensive packaging for multiple distributions (Arch, Debian, RPM, FreeBSD) and manages source database downloads. CI/CD pipelines automate package building and source database updates. The heavy reliance on awk for text processing is a double-edged sword - it enables powerful data manipulation in pure shell but creates maintenance complexity. The main script is monolithic (~500 lines) and could benefit from further modularization. However, the code is functional, well-structured, and demonstrates genuine craftsmanship in shell scripting.
The LLM identified 5 files worth highlighting for reuse:
Main executable demonstrating clean shell engineering with clear separation of concerns: initialization, configuration parsing, dependency checking, parallel source searching, result combination, and TUI presentation. The modular source loading pattern (dynamically discovering and executing source modules) is reusable for any CLI tool with pluggable backends. Configuration parsing via awk is robust and handles both user and system config files with proper fallback logic.
Exemplary source module implementation showing how to handle complex data structures (man pages with sections and languages). The search logic combines name-based and description-based (apropos) searches, handles language filtering, and implements both quick search and full-text modes. The awk-based text processing for extracting metadata from file paths is reusable for similar file-structure-based searches.
Sophisticated source module handling DevDocs' unique book-selection syntax (=book1,book2). The query parsing logic that extracts book names from the search query and validates them against available books demonstrates reusable patterns for tools with hierarchical or multi-level search parameters. The auto_mode function shows how to handle different search contexts based on query structure.
Well-implemented bash completion script that dynamically discovers available sources, fuzzy finders, browsers, and locales at runtime. The pattern of using WIKIMAN_INTERNAL=1 to invoke internal completion functions is a clean separation of concerns. Similar patterns in fish and zsh completions show consistent cross-shell UX design.
Comprehensive build system handling installation, packaging for multiple distributions, and source database management. The source download logic using embedded awk scripts to parse GitHub API responses and download documentation snapshots is a reusable pattern for tools that need to maintain local copies of external documentation. The local vs system install distinction for BSD compatibility shows thoughtful cross-platform engineering.