travsr index
Index a directory of source files and emit a graph JSON, for CI and tooling.
Unlike travsr init, it installs no hooks, starts no daemon, and writes nothing into .travsr/. It parses the directory structurally and writes the result to one file.
Synopsis
travsr index <DIR> --output <OUTPUT> [--corpus <CORPUS>]
Arguments
| Argument | Description |
|---|---|
<DIR> | Directory to index recursively |
Flags
| Flag | Default | Description |
|---|---|---|
-o, --output <OUTPUT> | required | Output path for the graph JSON |
--corpus <CORPUS> | ci | Corpus label for emitted nodes |
Output
Nothing is printed on success. The output file is one JSON object with schema_version, nodes and edges:
travsr index fixtures/lang-sanity/typescript -o graph.json
{
"schema_version": 1,
"nodes": [
{"corpus": "ci", "kind": "class", "language": "typescript", "path": "greeter.ts", "signature": "class:Greeter"}
],
"edges": [
{"kind": "defines/binding",
"src": {"language": "typescript", "path": "greeter.ts", "signature": "file"},
"dst": {"language": "typescript", "path": "greeter.ts", "signature": "interface:Greeting"}}
]
}
(Trimmed to one node and one edge.)