# csb reindex

Refresh the qmd search index from any directory. It picks up new and changed files and regenerates the vector embeddings.

## Usage

```bash
csb reindex [<name>…] [--brain <name>] [--path <dir>] [--all]
```

With no target, `csb reindex` shows a multi-select of your registered brains with the default brain preselected, and reindexes each one you pick. When there's no terminal to prompt in, it reindexes the default brain.

It's a thin wrapper: it runs `pnpm qmd:reindex` inside each vault, the same as [`/brain-refresh`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-refresh). If the vault has no `node_modules`, it runs `pnpm install` first. It uses the pnpm on your PATH when it's version 10 or newer, otherwise `mise exec -- pnpm` (set `CSB_USE_MISE=1` to always use mise). The first run downloads about 2GB of embedding models.

Exits 1 if any target fails or isn't a brain vault (no `scripts/qmd/reindex.ts`). The other targets still run.

## Options

### `<name>`, --brain \<name>

Reindex a registered brain. Repeat to reindex several.

```bash
csb reindex work personal
```

### --path \<dir>

Reindex any brain vault folder, registered or not. Repeatable. `--vault` is an alias.

```bash
csb reindex --path ~/notes/my-vault
```

### --all

Reindex every registered brain.

### -h, --help

Displays help message.

```bash
csb reindex --help
```
