AiCodeGraph.Cli 0.3.0

dotnet tool install --global AiCodeGraph.Cli --version 0.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local AiCodeGraph.Cli --version 0.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=AiCodeGraph.Cli&version=0.3.0
                    
nuke :add-package AiCodeGraph.Cli --version 0.3.0
                    

AI Code Graph

A Roslyn-based static analysis tool for .NET codebases. Builds semantic code graphs with call relationships, complexity metrics, and duplicate detection.

For LLM/AI agents: See LLM-QUICKSTART.md for minimal-token workflows.

Features

  • Call Graph - Method relationships including interface dispatch
  • Complexity Metrics - Cognitive complexity, LOC, nesting depth
  • Duplicate Detection - Structural and semantic clone detection
  • Coupling Analysis - Afferent/efferent coupling, instability
  • Dead Code Detection - Methods with no callers
  • Staleness Detection - Know when to re-analyze
  • MCP Server - IDE and AI agent integration

Installation

dotnet tool install --global AiCodeGraph.Cli

Requires: .NET 8.0 SDK

Quick Start

# Analyze a solution
ai-code-graph analyze YourSolution.sln

# Check database status
ai-code-graph status

# Get method context before editing
ai-code-graph context "ValidateUser"

# Find complexity hotspots
ai-code-graph hotspots --top 10

# Check blast radius
ai-code-graph impact --id "<method-id>"

Commands

Command Description
analyze Build the code graph database
status Show DB info and staleness check
context Method summary (callers, callees, metrics)
callgraph Explore call relationships
impact Transitive caller analysis
hotspots High-complexity methods
dead-code Uncalled methods
coupling Coupling/instability metrics
duplicates Code clone detection
tree Code structure display
drift Compare with baseline

All commands support --format compact|table|json (default: compact for agent commands).

AI Integration

Claude Code

# One-command setup
ai-code-graph setup-claude

Creates slash commands (/cg:context, /cg:hotspots, etc.) and MCP server config.

MCP Server

ai-code-graph mcp --db ./ai-code-graph/graph.db

Configure in .mcp.json:

{
  "mcpServers": {
    "ai-code-graph": {
      "type": "stdio",
      "command": "ai-code-graph",
      "args": ["mcp", "--db", "./ai-code-graph/graph.db"]
    }
  }
}

Documentation

Building from Source

git clone https://github.com/your-org/ai-code-graph.git
cd ai-code-graph
dotnet build
dotnet test

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.3.0 92 2/4/2026
0.2.0 89 1/28/2026
0.1.0 91 1/28/2026