# summary

Generate a dependency-aware metadata catalog from a Salesforce source directory.

# description

Scans the specified source directory (default: force-app), parses all recognized Salesforce metadata types (Apex classes, triggers, LWC, objects, fields, flows, permission sets, labels), builds a dependency graph, and outputs the index to .setup-agents/sf-metadata-index.json (or .md with --format md).

Supports incremental indexing via git-diff mode (default) which only re-indexes changed files, or --full for a complete rescan.

# examples

- Generate a full metadata index:

  <%= config.bin %> <%= command.id %> --full

- Generate index in markdown format:

  <%= config.bin %> <%= command.id %> --format md

- Index only Apex classes and triggers:

  <%= config.bin %> <%= command.id %> --include ApexClass,ApexTrigger

- Index from a custom source directory:

  <%= config.bin %> <%= command.id %> --source-dir src/main

# flags.full.summary

Force a full scan instead of incremental git-diff mode.

# flags.full.description

By default, the index command uses git-diff mode to only re-index files changed since the last commit. Use --full to scan all files regardless of changes.

# flags.format.summary

Output format: json (default) or md.

# flags.include.summary

Comma-separated list of metadata types to include (others are excluded).

# flags.include.description

Only index the specified types. Valid types: ApexClass, ApexTrigger, LightningComponentBundle, CustomObject, CustomField, Flow, PermissionSet, CustomLabel.

# flags.exclude.summary

Comma-separated list of metadata types to exclude.

# flags.exclude.description

Exclude the specified types from indexing. Valid types: ApexClass, ApexTrigger, LightningComponentBundle, CustomObject, CustomField, Flow, PermissionSet, CustomLabel.

# flags.source-dir.summary

Source directory to scan (default: force-app).

# info.starting

Starting metadata index (%s mode) from %s...

# info.complete

Index complete: %s entries, %s dependencies, %s orphans.

# info.output

Output written to: %s

# warn.invalidTypes

Unknown metadata types ignored: %s. Valid types: %s
