travsr daemon
Manage the background daemon for the current repository. The daemon is the git hook reindex, the file watcher, and the MCP server in one process, and it schedules semantic analysis in the background.
There is one daemon per repository. Run these commands from inside the repository you mean.
Synopsis
travsr daemon <subcommand> [flags]
Subcommands
| Subcommand | Description |
|---|---|
travsr daemon start | Start the daemon (detaches to the background unless --foreground is given) |
travsr daemon stop | Stop the running daemon |
travsr daemon status | Check whether the daemon is running |
travsr daemon restart | Stop the running daemon and start a fresh one |
travsr daemon stop-embed | Pause background embed reindexing and cancel any in-flight reindex. Partial embeddings are preserved. The pause lasts until resume-embed or a daemon restart |
travsr daemon resume-embed | Resume background embed reindexing paused by stop-embed |
travsr daemon lsp | Show the last diagnostics overlay the editor extension reported. Held in memory by the daemon, so a restart clears it |
travsr daemon logs | Print daemon log entries |
travsr daemon start
travsr daemon start [--foreground] [--verbose]
| Flag | Default | Description |
|---|---|---|
--foreground | false | Run the daemon in the foreground instead of the background |
--verbose | false | Log at debug level instead of info. The log file is otherwise written at info, so debug-only events are absent from it entirely; daemon logs --level debug cannot recover what was never written |
If a daemon already owns this repository, start says so and exits without spawning a second one. While it starts, it relays the startup log lines to your terminal (trimmed):
$ travsr daemon start
[travsr] starting…
[travsr] 16:43:11 daemon daemon starting event=daemon.session.start log_level=info log_level_from=default pid=67128 pruned_logs=0 version=1.4.0+<build-id>
[travsr] 16:43:13 daemon travsr daemon started event=daemon.ready
[travsr] 16:43:13 daemon control socket bound event=daemon.socket.bound sock=.travsr/daemon-d99ec82447e573ae.sock transport=unix
[travsr] 16:43:13 daemon semantic call and reference indexing starting commit=8d6d3ffa event=phase_b.start
[travsr] ready in 2.0s
The CLI talks to the daemon over a per-repository control socket, <repo>/.travsr/daemon-<hex>.sock, where <hex> is derived from the repository path. If that path is too long for a Unix socket, it falls back to a short per-user directory under $XDG_RUNTIME_DIR, $TMPDIR or /tmp. On Windows it is a named pipe.
travsr daemon stop
travsr daemon stop
Sends a shutdown request over the control socket and waits for the process to exit, then prints travsr daemon stopped. Stopping a daemon that is not running is not an error: it prints travsr daemon is not running and exits 0.
travsr daemon status
$ travsr daemon status
daemon: running [transport=unix]
nodes: 17718 | edges: 33690 | last_commit: 8d6d3ffa
semantic: running
embedding: no backend active
When no daemon is up it prints daemon: not running, or daemon: starting (control socket not ready yet) while one is still coming up.
travsr daemon logs
travsr daemon logs [-f] [--lines <n>] [--repo <repo>] [--level <level>]
[--since <age>] [--json] [--utc] [--global]
Reads the log files in .travsr/ directly, so it works after a crash and does not need a running daemon.
| Flag | Default | Description |
|---|---|---|
-f, --follow | false | Stream new lines as they are written, following rotation |
--lines <n> | 50 | Lines to show from the end of the log, spanning rotated files. 0 prints the whole retained history |
--repo <repo> | Show only lines tagged with this repo. --global logs tag by name, while a repo's own log tags by full path, so a bare basename will not match there | |
--level <level> | Show only this severity and above: trace, debug, info, warn, error | |
--since <age> | Show only lines newer than this age, for example 45s, 10m, 2h, 1d | |
--json | false | Print the stored JSON lines verbatim, for jq or a log collector |
--utc | false | Render times in UTC, as stored, rather than local time |
--global | false | Read the global log in ~/.travsr instead of this repo's, which is where travsr mcp --global writes |
Upgrades restart the daemon
After you upgrade the travsr binary (npm, or travsr install), an already-running daemon would keep serving queries with the old build. The CLI compares the daemon's reported version, including a build id carried as semver build metadata, against its own on every terminal query, on travsr mcp start-up and on travsr init, and restarts the daemon when they differ. A daemon old enough to report no version at all is treated as out of date too. A lock file makes this single-flight, so two callers upgrading at once cannot race each other's restart. You can still run travsr daemon restart yourself at any time.
A client replaces a skewed daemon only from the binary path that daemon is running, so a scratch build or an editor's bundled copy cannot knock out a daemon that belongs to another install. The exception is a daemon whose binary has been deleted: nothing at that path can ever replace it, so any client may.
Auto-start
On Windows, travsr daemon start registers a Task Scheduler logon task so the daemon comes back after a reboot, and travsr daemon stop removes it. There is no auto-start service on macOS or Linux: travsr init starts the daemon (except when the CI environment variable is set), travsr mcp starts one if none is running, and otherwise you run travsr daemon start.