# LeanKG Commands

## leankg:status

Check if LeanKG MCP server is connected and initialized.

**Usage:** `leankg:status`

## leankg:init

Initialize LeanKG for the current project.

**Usage:** `leankg:init [path]`

## leankg:index

Index the codebase for LeanKG knowledge graph.

**Usage:** `leankg:index [source_dir]`

## leankg:search

Search for code elements by name or pattern.

**Usage:** `leankg:search <query> [--kind name|pattern]`

## leankg:impact

Calculate the impact radius of changes to a file.

**Usage:** `leankg:impact <file> [depth]`

## leankg:context

Get AI-optimized context for a file.

**Usage:** `leankg:context <file>`