跳到內容

tmd doctor

對 vault 進行全面的健康檢查,涵蓋 8 個類別。是 tmd type validate 的超集,額外包含結構完整性檢查。

Terminal window
tmd doctor

驗證所有 type schema(同 tmd type validate 階段 1)。

依據 type schema 驗證 object 屬性(同階段 2)。

檢查所有 relation 端點是否參照存在的 object(同階段 3)。

偵測壞掉的 [[target]] 參照(同階段 4)。

檢查設定 unique: true 的 type 是否有重複的 name(同階段 5)。

偵測損壞的 object 檔案——objects/ 下的檔案若有無法解析的 YAML frontmatter 或缺少 --- 分隔符號,在一般操作中會被靜默跳過,doctor 會主動報告。

檢查 SQLite index 是否與磁碟上的檔案同步。自動修復:若 index 過時,會自動重建。

偵測 objects/templates/ 下沒有對應 type schema 的目錄。以警告方式報告。

結果按類別分組,以 / 標示:

✓ Schemas
✓ Objects
✓ Relations
✓ Wiki-links
✓ Uniqueness
✗ Files
[error] book/bad-file.md: yaml: did not find expected key
✓ Index (auto-fixed)
✗ Orphans
[warn] object directory objects/ghost has no type schema
2 issue(s) found, 1 auto-fixed.
  • 0——沒有發現問題(自動修復的項目不算在內)
  • 1——發現一個或多個問題