Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

clean

Delete the search index.

Usage

mdvs clean [path]

Flags

FlagDefaultDescription
path.Directory containing mdvs.toml

Global flags (-o, -v, --logs) are described in Configuration.

What it does

clean deletes the .mdvs/ directory, which contains the Lance dataset that makes up the search index (plus the cached embedding model). The mdvs.toml configuration file is never touched — you can rebuild the index at any time with build.

The command is idempotent — running it when .mdvs/ doesn’t exist is a no-op. It also refuses to delete if .mdvs/ is a symlink, as a safety measure.

Output

Compact (default)

mdvs clean example_kb
Cleaned "example_kb/.mdvs"

┌──────────────────────────┬───────────────────────────────────────────────────┐
│ removed                  │ true                                              │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ path                     │ example_kb/.mdvs                                  │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ files removed            │ 2                                                 │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ size                     │ 113.7 KB                                          │
└──────────────────────────┴───────────────────────────────────────────────────┘

When there’s nothing to clean:

Nothing to clean — "example_kb/.mdvs" does not exist

┌──────────────────────────┬───────────────────────────────────────────────────┐
│ removed                  │ false                                             │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ path                     │ example_kb/.mdvs                                  │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ files removed            │ 0                                                 │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ size                     │ 0 B                                               │
└──────────────────────────┴───────────────────────────────────────────────────┘

Verbose (-v)

Verbose output adds pipeline timing lines before the result:

Delete index: example_kb/.mdvs (2 files, 113.8 KB) (0ms)
Cleaned "example_kb/.mdvs"

┌──────────────────────────┬───────────────────────────────────────────────────┐
│ removed                  │ true                                              │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ path                     │ example_kb/.mdvs                                  │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ files removed            │ 2                                                 │
├──────────────────────────┼───────────────────────────────────────────────────┤
│ size                     │ 113.8 KB                                          │
└──────────────────────────┴───────────────────────────────────────────────────┘

Exit codes

CodeMeaning
0Success (including when nothing to clean)
2Pipeline error (symlink detected, I/O failure)

Errors

ErrorCause
.mdvs is a symlinkRefuses to delete symlinks for safety — remove it manually