Rust CLI + daemon providing LSP-backed code intelligence for AI coding agents. Single binary, zero config, Unix composable. The ripgrep of code navigation.
v0.1 — complete. Phases 1-12 done, all 305 tests passing, zero clippy warnings.
- Run
cargo checkafter every file edit - Run
cargo testafter completing any task - Use
anyhowfor error handling in binaries,thiserrorfor library code - No
.unwrap()in library code — always propagate errors - Write tests alongside implementation (#[cfg(test)] mod tests)
- Keep functions under 50 lines — extract helpers
krait init Set up .krait/ and pre-warm index
krait status Daemon health, LSP state, cache stats
krait check [path] LSP diagnostics (errors/warnings)
krait find symbol <name> Locate symbol definition
krait find refs <name> Find all references to symbol
krait list symbols <path> Semantic outline of file
krait read file <path> Read file with line numbers
krait read symbol <name> Extract symbol body/code
krait edit replace <symbol> Replace symbol body (stdin)
krait edit insert-after <symbol> Insert code after symbol (stdin)
krait edit insert-before <symbol> Insert code before symbol (stdin)
krait server list Show installed LSP servers
krait server install <lang> Install/update a language server
krait server clean Remove managed servers
krait server status Show running LSP processes
krait search <pattern> [path] Text search with regex, context, type filter
krait daemon start|stop|status Daemon management (usually auto)
src/
main.rs → Binary entry point
lib.rs → Library root
cli.rs → Clap command definitions
client.rs → CLI-to-daemon socket client
protocol.rs → Wire protocol types (Request/Response)
daemon/ → UDS server, lifecycle, dispatch
lsp/ → LSP client, transport, config, pool, install
index/ → SQLite symbol index + cache
commands/ → Business logic per command
output/ → Formatting (compact, json, human)
detect/ → Language + project root detection
lang/ → Language-specific helpers (go, typescript)
cargo test # all tests
cargo test <module> # specific moduleTests use fixture projects in tests/fixtures/.