kdex

All your knowledge. One search. AI-ready.

Index your code, docs, notes, and wikis locally.
Let AI assistants search everything you know.

$ curl -sSf https://urbanisierung.github.io/kdex/install.sh | sh

or cargo install kdex ยท more options

๐Ÿ˜ฉ The Problem

  • Code scattered across dozens of repos
  • Notes buried in Obsidian vaults
  • Docs lost in markdown wikis
  • AI assistants can't see YOUR files

โœจ The Solution

  • Index everything with one command
  • Search instantly across all sources
  • AI tools query your knowledge directly
  • 100% local โ€” data never leaves your machine

โšก Features

๐Ÿ” Instant Search

SQLite FTS5 gives sub-millisecond full-text search across all your indexed content.

๐Ÿค– AI-Ready

MCP server for GitHub Copilot, Claude Desktop, and Ollama integration.

๐Ÿ“ Universal

Code repos, Obsidian vaults, markdown wikis, any text-based knowledge.

๐Ÿ”’ Local-First

Your data stays on your machine. Works offline. No cloud dependencies.

๐ŸŒ Remote Repos

Add GitHub repos by URL. Auto-cloned, auto-synced, always up-to-date.

๐Ÿ“ฆ Portable Config

Export/import your setup. One command to replicate on any machine.

๐Ÿ”Œ AI Integrations

Works with your favorite AI tools via MCP:

GitHub Copilot
Claude Desktop
Gemini CLI
Ollama

๐Ÿš€ Quickstart

1. Install kdex
cargo install kdex
2. Index your knowledge
kdex index ~/code/my-project
kdex add --remote owner/repo  # Index a GitHub repo
3. Search everything
kdex "authentication"  # Just type your query!
4. Enable AI access
kdex mcp  # Start MCP server for AI assistants

๐Ÿ“– Documentation

Installation

Quick Install (recommended)

curl -sSf https://urbanisierung.github.io/kdex/install.sh | sh

Downloads the latest binary to ~/.local/bin. No Rust required. To update, re-run the same command.

From crates.io

cargo install kdex

From source

git clone https://github.com/urbanisierung/kdex.git
cd kdex
cargo install --path .

Pre-built binaries

Download from GitHub Releases for Linux, macOS, and Windows.

App Mode (TUI)

Launch the full-screen interactive interface:

kdex
KeyAction
TabSwitch between Search and Repos views
?Toggle help overlay
Ctrl+QQuit application
โ†‘/โ†“Navigate results or browse search history
EnterSelect / Open file
EscClear search / Go back
Ctrl+PToggle preview panel
Ctrl+OOpen file in editor

CLI Commands

search

Search indexed content (default command โ€” just type your query!)

kdex "your query"
kdex search "pattern" --repo my-project --file-type rust
kdex "auth" --fuzzy --limit 20
FlagShortDescription
--repo-rFilter by repository name
--file-type-tFilter by file type (rust, markdown, python...)
--limit-lMaximum results (default: 10)
--semantic-sUse semantic (vector) search
--hybrid-HCombine lexical + semantic search
--fuzzyTypo-tolerant fuzzy matching
--regexRegular expression search
--group-by-repo-gCluster results by repository

index

Add and index a local directory

kdex index /path/to/project
kdex index . --name "my-docs"
FlagDescription
--nameCustom name for the repository

add

Add a remote GitHub repository

kdex add --remote owner/repo
kdex add --remote https://github.com/owner/repo.git --branch develop
kdex add --remote owner/repo --shallow
FlagDescription
--remoteGitHub repo (owner/repo or full URL)
--branchBranch to clone (default: main)
--nameCustom repository name
--shallowShallow clone (faster, less disk)

list

List all indexed repositories

kdex list
kdex list --json

remove

Remove a repository from the index

kdex remove my-project

sync

Sync remote repositories

kdex sync          # Sync all remote repos
kdex sync owner/repo  # Sync specific repo

stats

Show index statistics

kdex stats

graph

Export knowledge graph

kdex graph > knowledge.dot       # DOT format for Graphviz
kdex graph --json > graph.json   # JSON format

health

Check index health (orphans, broken links)

kdex health

backlinks

Find files linking to a target

kdex backlinks my-note

tags

List all tags from indexed markdown

kdex tags

context

Build AI context from search results

kdex context "authentication" --tokens 4000 --format markdown
FlagDescription
--tokensMax token limit (default: 8000)
--formatOutput format: markdown, text, json

mcp

Start MCP server for AI assistants

kdex mcp

add-mcp

Automatically configure MCP for AI tools

kdex add-mcp copilot    # Configure GitHub Copilot CLI
kdex add-mcp gemini     # Configure Gemini CLI
kdex add-mcp claude     # Configure Claude Desktop

self-update

Update kdex (script-based installs only)

kdex self-update

config

Manage configuration

kdex config show              # Show current config
kdex config export -o backup.yaml   # Export to file
kdex config import backup.yaml      # Import from file

completions

Generate shell completions

kdex completions bash >> ~/.bashrc
kdex completions zsh >> ~/.zshrc
kdex completions fish > ~/.config/fish/completions/kdex.fish

MCP Integration

Connect kdex to AI assistants via the Model Context Protocol. Use kdex add-mcp <tool> to auto-configure, or manually add:

Claude Desktop

kdex add-mcp claude or add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "kdex": { "command": "kdex", "args": ["mcp"] }
  }
}

GitHub Copilot CLI

kdex add-mcp copilot or add to ~/.config/github-copilot/mcp.json:

{
  "mcpServers": {
    "kdex": { "command": "kdex", "args": ["mcp"] }
  }
}

Gemini CLI

kdex add-mcp gemini or add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "kdex": { "command": "kdex", "args": ["mcp"], "timeout": 30000 }
  }
}

Ollama (with Open WebUI)

Run kdex MCP server and configure Open WebUI to use it:

# Start kdex MCP server
kdex mcp

# Configure Open WebUI's MCP client to connect to kdex

MCP Tools

ToolDescription
searchSearch indexed content with query, limit, repo, file_type filters
list_reposList all indexed repositories with status and file counts
get_fileGet full content of a file by path
get_contextGet lines of context around a specific line number

Global Options

FlagDescription
--jsonOutput as JSON for scripting
--quietSuppress non-error output
--no-colorDisable colored output
-v, --verboseEnable verbose output
--debugEnable debug mode with backtraces

Vault Detection

kdex auto-detects knowledge vault types:

IconTypeDetection
๐Ÿ““Obsidian.obsidian/ folder
๐Ÿ“”Logseqlogseq/ folder
๐ŸŒณDendrondendron.yml file
๐Ÿ“GenericDefault for all other repos

Configuration

Config file location: ~/.config/kdex/config.toml

# Example config.toml
max_file_size_mb = 10
enable_semantic_search = true
default_search_mode = "hybrid"
strip_markdown_syntax = false
index_code_blocks = true