Skip to main content
CLI Reference

travsr pattern

Textual search, scoped to the graph. Runs git grep and returns path:line:col: text.

This is the deliberate escape hatch. The graph answers structural questions exactly; some questions are not structural (a log string, a TODO, a feature flag, a key built by string concatenation), and pretending otherwise would just send you to another tool. Scoping to the graph-relevant file set is what keeps it from being an unscoped grep.

travsr pattern "retry_backoff" --scope crates/travsr-daemon/
travsr pattern "files-importing(PaymentService)" --fixed

Options

FlagMeaning
--scope <SCOPE>A path prefix, or files-importing(<symbol>)
--fixedLiteral string instead of a regular expression
--format <text|json>json emits { "pattern", "scope", "output" }

<PATTERN> is a POSIX extended regular expression, not PCRE. Use --fixed for anything containing regex metacharacters.

files-importing(<symbol>)

This scope is what makes the command graph-aware rather than a plain grep. It confines the search to files that import the named symbol, so the question becomes "where, among the code that actually depends on this, does this text appear".

When to use

  • Non-structural text: error strings, TODOs, config keys.
  • Confirming an empty structural result. If travsr references finds nothing and you suspect the index rather than the code, a textual hit distinguishes "not there" from "not indexed".
  • Names the graph cannot model, such as one assembled at runtime.

Backed by git grep, so it sees tracked files only and respects the repo's ignore rules. Results are text, not graph nodes, and carry no structural guarantee.

The MCP equivalent is find_pattern.