Skip to content

query command

Arham-Qureshi edited this page Jul 21, 2026 · 1 revision

query — Inspect Dependencies

Shows all dependencies (outbound edges) and dependents (inbound edges) for a given file in your project.

codebase-vis query <target>

query output

How It Works

  1. Resolves the target using fuzzy partial-name matching
  2. If multiple nodes match, shows an interactive selector
  3. Loads the graph from graph.json
  4. Prints all outbound edges (what this file imports) and inbound edges (what imports this file)

Color-Coded Output

Color Symbol Node Type
Cyan Local file
Yellow External package (npm, etc.)
Magenta Entity (class, function, method)

Fuzzy Matching

query uses case-insensitive partial matching. If the exact path isn't found, it searches all node keys and labels for matches. If multiple nodes match, you get an interactive picker:

$ codebase-vis query cache
? Multiple matches, pick one: (Use arrow keys)
❯ src/utils/cache.js
  src/utils/cache.js::loadCache
  src/utils/cache.js::saveCache

The selector is capped at 25 matches.

Examples

# Query a file by full path
codebase-vis query src/utils/cache.js

# Query by partial name
codebase-vis query cache

# Query an entity
codebase-vis query "cache.js::loadCache"

# Query by visual label
codebase-vis query "loadCache"

Notes

  • Run codebase-vis generate first — query reads from the existing graph.json
  • Parallel edges (multiple edges between the same two nodes in a multi-graph) are deduplicated in the output
  • Useful for answering "what does this file depend on?" and "what depends on this file?" without opening the browser

Clone this wiki locally