§07The index
chi index
Build or refresh this repository's knowledge graph.
chi index [OPTIONS] [PATH]Works out for itself what is needed: an empty graph is indexed whole, an existing one has only its changed files recompiled and its deleted ones forgotten. Name a file to refresh just that file. --full rebuilds from scratch.
Optional either way: the graph refreshes itself when a model asks it something. Running this is the explicit path.
Arguments
| Argument | What it is |
|---|---|
[PATH] | What to index. A directory is a tree, a file is that file alone. Defaults to this repository |
Options
| Flag | What it does |
|---|---|
--full | Rebuild from scratch instead of updating what changed. What --json and --timings have always reported on |
--no-prune | Index everything: dependencies, build output, hidden directories, and whatever .chignore says to skip. An order of magnitude more work, so it is asked for rather than assumed. Implies --full, because a wider scope is not a difference against a narrower one |
--detect | Report the languages found and how well each is supported. Writes no graph unless --opaque is given too |
--encrypt | Seal this repository's index at rest, converting it if it is not sealed already. Ordinarily decided for you — an index is sealed whenever this machine has a key — so this is for a repository indexed before, or one that opted out. Converting rebuilds the index and sets the plaintext store aside rather than overwriting it |
--no-encrypt | Index in the clear, for a corpus meant to be inspectable with ordinary tools. Decides only for an index that does not exist yet: forgetting a flag can never downgrade a sealed one |
Advancedbenchmarking, A/B comparison and debugging
| Flag | What it does |
|---|---|
--opaque | With --detect, also record the files no adapter understands, so they are findable even though nothing can parse them |
--timings | Per-stage timings, file taxonomy and the canonical graph hash. Implies --json |
Global options
Accepted here as on every command. Repeated on each page so a reader who arrived from a search engine sees them too.
| Flag | What it does |
|---|---|
--json | Machine-readable output |
--db <PATH> | Knowledge graph to read. Defaults to this repository's .chi, found by walking up the way git finds .git |
--sessions <PATH> | Session memory to read. Same default as --db |
--repo <PATH> | Repository to act on. Defaults to the current one |
--tokenizer <TOKENIZER> | Tokenizer to count with |
--color <WHEN> | When to colour the output: auto (a terminal, and NO_COLOR unset), always, or never |