travsr init
Install Git hooks and build the initial graph of the current repository.
Synopsis
travsr init [--semantic] [--force] [--jobs <N>] [--quiet] [--json]
[--no-connect] [--allow-unsandboxed-lsif]
Flags
| Flag | Default | Description |
|---|---|---|
--semantic | false | Run semantic Phase B (call edges) synchronously before returning. By default Phase B runs in the background via the daemon. Use in CI or scripts that query call edges immediately after init. |
--jobs <N> | CPU cores | Number of parallel parse workers |
--quiet, -q | false | Suppress progress output and post-index tips |
--json | false | Emit machine-readable JSON (summary on stdout, progress on stderr) |
--force, --rebuild | false | Force a full rebuild, bypassing the incremental "already up to date" skip. Re-parses every file even when nothing changed on disk. Use it after changing a flag that affects semantic output, which per-file change detection does not pick up on its own |
--no-connect | false | Skip auto-detecting AI coding tools and wiring them to Travsr. See travsr connect |
--allow-unsandboxed-lsif | false | Let rust-analyzer run without OS sandboxing (bubblewrap on Linux, sandbox-exec on macOS) on hosts that have none. Without it, Rust falls back to structural analysis only on such hosts. Set it only for repositories you fully trust, since Phase B executes the repo's own build configuration |
What it does
- Creates
.travsr/in the repository root and registers the repository. - Installs hooks for
post-commit,post-merge, andpost-checkout. - Builds the structural index and writes the graph to
.travsr/graph.db. - In an interactive terminal, starts the daemon, which watches saves and runs semantic analysis in the background. Noninteractive initialization does not start it automatically. Use
--semanticwhen a script needs semantic analysis before the command returns. - Detects installed coding tools, configures project MCP settings where supported, and prints any remaining setup, unless you pass
--no-connect. Agent rules are opt-in throughtravsr connect --rules.
Check progress
cd my-project
travsr init
travsr status
If the daemon is not running, start it with travsr daemon start from the repository.
Notes
- Running
travsr initagain is safe: it re-installs the hook and re-indexes the repository over the existing.travsr/directory. - The git hook is a thin shell wrapper; it calls
travsr hook-run --from-hookand exits immediately. It does not block the commit. - Add
.travsr/graph.dbto.gitignoreif you don't want to commit the graph to the repository.