Command Reference

Complete guide to every LORE CLI command. Master the tools for deep code archaeology.

All commands: Run lore --help to see the full list of available commands and global options at any time.

Overview

LORE provides a comprehensive CLI with 8 commands designed for different stages of code archaeology. Whether you are running a quick health check, setting up continuous monitoring, or comparing architectural changes between commits, there is a command for every workflow.

Command Description Use Case
lore init Initialize LORE on a project First-time setup
lore status Full architectural analysis report Quick health check
lore doctor Health check with auto-fix suggestions Diagnose and fix issues
lore ignore Manage analysis ignore rules Exclude files from analysis
lore watch Monitor project for architectural changes Continuous monitoring
lore diff Compare architecture between commits Change impact analysis
lore plugins List and manage analyzer plugins Plugin management
lore mcp Start MCP server mode AI tool integration

lore init

Initializes LORE in the current project directory. This is the first command you should run on any new project. It creates the .lore/ directory for storing cached analysis results, generates a default configuration file (.lore/config.json), and runs an initial scan of your codebase to establish a baseline understanding of the architecture.

# Initialize in current directory
lore init

# Initialize in a specific directory
lore init /path/to/project

# Force re-initialization (overwrites existing config)
lore init --force

After running lore init, you will see a summary showing the number of files discovered, the detected framework (if any), and the initial analysis results. The command creates several artifacts in the .lore/ directory including the dependency graph cache, analyzer results, and a Markdown report at .lore/status.md.

lore status

Runs all 13 analyzers on your project and produces a comprehensive architectural report. This is the most commonly used command and provides a complete snapshot of your codebase health. It reads from the cached results when available for faster subsequent runs, and performs a full re-analysis when files have changed since the last run.

# Full status report
lore status

# Output in JSON format (for scripting / CI)
lore status --json

# Output in SARIF format (for GitHub Code Scanning)
lore status --sarif

# Run specific analyzers only
lore status --analyzers circular-deps,hotspot,type-safety

# Verbose output with detailed explanations
lore status --verbose

The status report includes scores for entropy, type safety, and overall health. It highlights hotspots (high-change modules), circular dependencies, hidden coupling links, and provides AI-generated recommendations for improvement. The --json flag outputs structured data suitable for consumption by other tools or CI pipelines, while --sarif produces a standard SARIF report compatible with GitHub Code Scanning integration.

lore doctor

Performs a health check on your project and provides actionable suggestions. Unlike lore status which reports the current state, lore doctor actively diagnoses problems and recommends fixes. It checks for common issues like missing TypeScript strictness flags, inconsistent error handling patterns, and modules that exceed complexity thresholds.

# Run diagnostics
lore doctor

# Auto-fix detected issues where possible
lore doctor --fix

# Focus on specific areas
lore doctor --focus types
lore doctor --focus structure
lore doctor --focus config

The --fix flag enables automatic remediation for issues that can be safely fixed, such as adding missing .loreignore entries for generated files, updating configuration settings, and creating recommended directory structures. More complex fixes are reported as suggestions that you can apply manually.

lore ignore

Manages the .loreignore file, which controls which files and directories LORE excludes from analysis. This is similar in concept to .gitignore but specific to LORE's analysis scope. Use it to exclude generated code, test fixtures, vendor directories, and other files that would skew the analysis results without providing meaningful architectural insight.

# Add a pattern to ignore
lore ignore add "dist/**"
lore ignore add "*.spec.ts"
lore ignore add "node_modules/**"

# Remove a pattern
lore ignore remove "dist/**"

# List all ignored patterns
lore ignore list

# Generate recommended ignore patterns based on project
lore ignore suggest

Best Practice: Always ignore node_modules/, dist/, build/, and generated code. These directories add noise to analysis without contributing architectural insight.

lore watch

Starts a file watcher that monitors your project for changes and re-runs analysis automatically. This is invaluable during active development when you want to see the architectural impact of your changes in real-time. As you add, modify, or delete files, LORE provides instant feedback on how the architecture is evolving.

# Start watching current project
lore watch

# Watch with debouncing interval (default: 500ms)
lore watch --debounce 1000

# Watch specific directories only
lore watch --include "src/**"

# Watch and output to a specific format
lore watch --output json

The watch command runs an initial full analysis when started, then performs incremental updates as files change. It highlights only the differences from the previous analysis, making it easy to track the architectural impact of each change you make. Press Ctrl+C to stop the watcher.

lore diff

Compares the architectural state between two Git commits, branches, or time points. This is essential for understanding how a pull request or refactoring effort affected the codebase architecture. It shows what modules changed, which dependency relationships were added or removed, and whether the overall health score improved or degraded.

# Compare current state with last commit
lore diff HEAD~1

# Compare two branches
lore diff main..feature/new-auth

# Compare specific commits
lore diff abc1234 def5678

# Output only the summary
lore diff main..feature --summary

The diff output shows four categories of changes: added dependencies (new imports), removed dependencies (deleted imports), modified modules (files that changed), and score changes (entropy, type safety, overall health). This makes it easy to review whether a PR improved or harmed the architecture before merging.

lore plugins

Lists all available analyzer plugins and their status. LORE ships with 13 built-in analyzers, and the plugin system allows you to extend functionality. This command shows which plugins are active, their configuration, and provides information about custom plugin development.

# List all plugins
lore plugins

# Show detailed info for a specific plugin
lore plugins info circular-deps

# Enable a plugin
lore plugins enable circular-deps

# Disable a plugin
lore plugins disable circular-deps
Plugin Category Description
dependency-graphStructureMaps all module relationships
circular-depsQualityDetects import cycles
coupling-matrixStructureInter-module coupling strength
entropyComplexityHigh-complexity zone detection
hotspotRiskChange-prone module identification
type-safetyQualityTypeScript type coverage scoring
import-impactStructureDownstream ripple effects
gapsQualityMissing patterns and error handling
hidden-couplingRiskImplicit dependency detection
breaking-changesRiskBreaking change flagging
ai-recommendationsIntelligenceSmart improvement suggestions
middleware-chainStructureRequest processing path tracking
tooling-configConfigBuild tool validation

lore mcp

Starts LORE as an MCP (Model Context Protocol) server. This is the primary integration point for AI coding assistants like Claude Desktop, Cursor, and Windsurf. When running in MCP mode, LORE exposes its analysis capabilities as tools that the AI assistant can invoke directly to answer questions about your codebase architecture.

# Start MCP server (stdin/stdout transport)
lore mcp

# Start with HTTP transport (for custom integrations)
lore mcp --transport http --port 3001

# Start with verbose logging
lore mcp --verbose

Note: You typically do not run lore mcp manually. Instead, configure your MCP client (Claude Desktop, Cursor, etc.) to launch it automatically. See the MCP Setup Guide for detailed configuration instructions.

In MCP mode, LORE exposes several tools that the AI can call: analyze_project for running full analysis, get_dependency_graph for querying the dependency tree, find_hotspots for locating high-risk modules, check_circular_deps for detecting cycles, and get_recommendations for AI-generated improvement suggestions. Each tool returns structured data that the AI assistant can reason about and present to you in natural language.