COMMANDS / OBSERVE

Perception &
Structure.

The observe command is the sensory organ of the Weaver agent. It fuses raw file content with semantic metadata from Tree-sitter and LSP servers to produce a high-fidelity, structured representation of the codebase.

Synopsis

Each observe operation queries code structure and relationships via the daemon. The daemon speaks JSONL internally; the CLI either forwards the inner payload in JSON mode or renders recognised responses for humans when stdout is a TTY.

SYNTAX
weaver observe <OPERATION> [ARG ...]
Language inferred from file extension

Operations

Operation Source Status Description
get-definition LSP Current Jump to definition. Requires --uri and --position.
find-references LSP Current Find all usages of a symbol. Same flags as get-definition.
call-hierarchy LSP Current Incoming/outgoing call graph. Returns nodes and edges.
query Tree-sitter Current AST-aware structural query via --pattern and --path.
grep Tree-sitter Current Shipped alias of query. Same --pattern and --path contract.
get-card Jacquard Planned Structured symbol card (signature, docstring, locals). Progressive detail levels.
graph-slice Jacquard Planned Budgeted subgraph rooted at a symbol, with typed edges.

Integration Examples

1. Jump to Definition

Point at any symbol with a URI and cursor position. Weaver starts the appropriate language server, resolves the definition, and returns the location as structured JSON.

TERMINAL
$ weaver observe get-definition \
  --output json \
  --uri file:///src/main.rs \
  --position 10:5
CLI JSON Output
// raw payload forwarded by the CLI
[{"uri":"file:///src/auth.rs","line":42,"column":17}]

2. Find All References

Same shape, different operation. Finds every call-site, import, and usage of the symbol at the given position — useful for impact analysis before a refactor.

TERMINAL
$ weaver observe find-references \
  --output json \
  --uri file:///src/auth.rs \
  --position 42:17
CLI JSON Output
// raw payload forwarded by the CLI
{"references":[{"uri":"file:///src/main.rs","line":10,"column":5},{"uri":"file:///tests/auth_test.rs","line":7,"column":12}]}
ARCHITECTURE

Semantic Fusion Engine

How Weaver constructs the "truth" about your code.

FIG 3.1: DATA FUSION
Illustration of raw source text, syntax trees, and language server metadata fusing into a structured semantic stream.

Ready to take action?

Now that the agent can see, learn how it manipulates the world.

Next: Act Command