| name | wiki-search |
| description | Search the local LLM wiki for matching pages, titles, and content snippets. |
/wiki-search — Search the LLM Wiki
Usage
/wiki-search <query> [--wiki <wiki_dir>]
Search the wiki for pages matching a query. Searches titles, content, and tags.
--wiki <wiki_dir> overrides the default wiki location (~/llm_wiki/wiki).
Execution
Phase 1: Resolve wiki path
WIKI="$HOME/llm_wiki/wiki"
QUERY="<first positional arg>"
if args contain "--wiki <path>"; then
WIKI="<path>"
fi
Phase 2: Grep search
results=$(grep -rl "$QUERY" "$WIKI"/**/*.md 2>/dev/null | head -20)
title_results=$(grep -rl "title:" "$WIKI"/**/*.md 2>/dev/null | xargs grep -l -i "$QUERY" 2>/dev/null | head -10)
combined=$(echo "$results"$'\n'"$title_results" | sort -u | head -20)
Phase 3: Extract context
For each result, extract:
- File path (relative to wiki/)
- Title from frontmatter
- First matching line snippet (50 chars context around match)
Phase 4: Output
## Wiki Search: "<query>"
Found N results:
1. **[Page Title](path/to/page.md)**
~path/to/page.md~
> ...snippet of matching content...
2. **[Page Title](path/to/page.md)**
...
If no results: No wiki pages match "<query>".