vx deps

vx deps queries the dependency graph for a file and returns two things: what it imports, and every file in the repo that depends on it — with line numbers.

Command

Terminal

vx deps <file>

Pass the file path relative to your repository root.

Terminal

vx deps src/components/Button.tsx

Output

deps: src/components/Button.tsx

imports (3):
  src/lib/utils
  src/styles/tokens
  src/components/Icon

used by (12):
  src/app/page.tsx:14
  src/components/Header.tsx:8
  src/components/Footer.tsx:22
  ...
  • imports — internal dependencies this file pulls in, resolved to repo-root paths
  • used by — every file in the repo that imports this file, with the exact line number

Why vx deps over grep

Grep requires you to know where to look. vx deps walks the entire repo at index time — including subdirectories, monorepo packages, and test directories you might not think to search. It also resolves TypeScript path aliases and Go module paths correctly, which grep cannot.

Staleness Warning

If files have changed since the last snapshot was built, vx deps will print a warning:

warning: snapshot is stale (3 file(s) changed) — run 'vx init' to rebuild

Results are still returned, but rebuilding with vx init ensures full accuracy.

Supported Languages

  • Go — resolves via go.mod module name
  • TypeScript / TSX — resolves relative imports and tsconfig.json path aliases
  • Python — resolves relative imports

Was this page helpful?