Skip to main content

Module codegraph

Module codegraph 

Source
Expand description

CodeGraph integration for code symbol indexing and search.

Integrates CodeGraph (https://github.com/colbymchenry/codegraph) for:

  • Symbol search across the codebase
  • Call graph analysis (callers/callees)
  • Impact analysis for code changes
  • Task context building for AI agents

Uses SQLite direct access for fast queries, and CLI for index building.

§Auto-sync

CodeGraphWatcher provides automatic file watching and index synchronization. When source files change, it automatically runs codegraph sync to keep the index up-to-date.

Structs§

CodeGraphCalleesTool
Tool for finding callees of a symbol.
CodeGraphCallersTool
Tool for finding callers of a symbol.
CodeGraphManager
Manages CodeGraph index for a project.
CodeGraphSearchTool
Tool for searching symbols in CodeGraph index.
CodeGraphStatusTool
Tool for checking CodeGraph status.
CodeGraphSyncTool
Tool for syncing CodeGraph index.
CodeGraphWatcher
CodeGraph file watcher for auto-sync.
Edge
Edge representing relationship between nodes.
FileInfo
File information for indexing.
IndexStatus
Index status information.
Node
Code symbol node from CodeGraph index.
PendingChanges

Enums§

CodeGraphEnv
Environment type for CodeGraph.

Constants§

WATCH_EXTENSIONS
Extensions to watch (source files only).

Functions§

codegraph_tools
Create CodeGraph tools for a project path.
codegraph_tools_if_installed
Create CodeGraph tools if installed.
codegraph_tools_with_auto_detect
Create CodeGraph tools with automatic project root detection.
ensure_codegraph
Ensure CodeGraph is available with optional auto-install.
find_project_root
Find project root directory from a given starting path.
get_codegraph_path
Get CodeGraph CLI path (returns the executable path or command name).
is_codegraph_installed
Check if CodeGraph CLI is installed.
should_inject_codegraph_tools
Check if CodeGraph tools should be injected.