v0.6.0

快速開始

最後更新


編譯 kura 執行檔、註冊資料庫、啟動 daemon,並對丟進去的檔案做第一次關鍵字搜尋。

環境需求


項目需求原因
作業系統macOS(APFS/HFS+)或 Linux(ext4/xfs)daemon 以 setsid 脫離終端,watcher 依賴 POSIX 檔案中繼資料
Go1.25.1 以上go.mod 宣告 go 1.25.1
C 編譯工具鏈cgo 可用的任一編譯器SQLite 透過 github.com/mattn/go-sqlite3 存取
pdftotext僅 PDF 檔需要(poppler-utils)PDF 文字以 pdftotext -layout -enc UTF-8 擷取

編譯與安裝


  1. git clone https://github.com/pardnchiu/KuraDB.git
  2. cd KuraDB
  3. make build

Target執行內容
make buildgo build -o bin/kura ./cmd/app
make app停止執行中的 daemon、編譯、以 sudo 把執行檔移到 /usr/local/bin/kura、啟動 daemon
make stopgo run ./cmd/app stop
make testgo test -v -count=1 ./...
make add <name>、make list、make remove <name>、make edit <old> <new>、make port <args>、make help以 go run ./cmd/app 執行對應子指令

註冊資料庫並啟動 daemon


  1. kura add notes
  2. kura

kura add notes 會建立 ~/.config/kuradb/notes/inbox/、建立捷徑 ~/Kura_notes,並把名稱寫進 db.json。不帶參數執行 kura 會把 daemon fork 到背景並印出位址,例如 http://localhost:21182。
daemon 執行期間新增的資料庫,要等 daemon 重啟才會載入:
  1. kura stop
  2. kura

丟入檔案並搜尋


  1. cp ~/Documents/design-notes.md ~/Kura_notes/
  2. curl "$(cat ~/.config/kuradb/endpoint)/api/search?db=notes&q=sqlite"

watcher 每 10 秒掃描一次各 inbox,新檔案約 10 秒內即可搜尋。回應依來源檔案分組列出命中的段落:
  1. {
  2. "keyword": [
  3. {
  4. "source": "/Users/you/.config/kuradb/notes/inbox/design-notes.md",
  5. "matches": [
  6. { "chunk": 2, "content": "Second paragraph about SQLite" }
  7. ]
  8. }
  9. ]
  10. }

要讓 agent 查詢同一份資料,在 MCP client 註冊 stdio MCP 伺服器,例如 Claude Code:
  1. claude mcp add kura -- kura mcp

下一步


EN