# CLI

The bookmark-context command.

`bookmark-context <command>`. Installed by `pip install -e .`.

| Command | Effect |
|---|---|
| `serve` | Start the daemon on `127.0.0.1:<port>` (default 7331). Creates the API token on first run, prints it, and writes `~/.config/bookmark-context/token` (mode 0600). |
| `mcp` | Start the MCP server on stdio. Your editor spawns this; you don't run it by hand. |
| `vacuum` | Reconcile the SQLite and Chroma stores and reset bookmarks stuck in `indexing`. **Stop the daemon first** — two processes must not open the Chroma store at once. Safe to run repeatedly. |

Any other argument prints usage and exits non-zero.

## `vacuum` in detail

Removes data the two stores no longer agree on:

- Rows orphaned while SQLite foreign keys were off.
- Chroma collections whose SQLite collection is gone.
- Vectors no chunk row points at any more — the surplus left when a re-indexed
  page yields fewer chunks than before.

It also resets bookmarks left in `indexing` by a daemon that stopped, so they
show as retryable errors rather than sitting in progress forever. It prints a
count for each category.

## Next

- [REST API](/docs/reference/rest-api/) — the daemon's HTTP endpoints
- [MCP tools](/docs/reference/mcp-tools/) — `list_collections`, `search_collection`, `ask_collection`
- [Configuration](/docs/reference/configuration/) — `config.toml` keys and env vars
- [File locations](/docs/reference/file-locations/) — where data lives on disk
