Skip to content

discover

Index macros and models into the SQLite state database.

This enables IDE features like autocomplete, hover documentation, and go-to-definition through the LSP server.

Discovery is incremental - only changed files are re-parsed. Use --force to re-parse all files regardless of content hash.

Output adapts to environment:

  • Terminal: Styled summary with success indicator
  • Piped/Scripted: Markdown format (agent-friendly)

Usage

bash
leapsql discover [flags]

Options

OptionShortDefaultDescription
--force-ffalseForce full refresh, ignore content hashes

Global Options

OptionShortDefaultDescription
--configconfig file (default: ./leapsql.yaml)
--databasePath to DuckDB database (empty for in-memory)
--envEnvironment name
--macros-dirPath to macros directory
--models-dirPath to models directory
--output-oOutput format (auto|text|markdown|json)
--project-dir-CProject root directory (auto-detected from models-dir or config file location)
--seeds-dirPath to seeds directory
--statePath to state database
--target-tTarget environment to use (e.g., dev, staging, prod)
--verbose-vfalseVerbose output

Examples

bash
# Discover all macros and models
leapsql discover

# Force full refresh (ignore content hashes)
leapsql discover --force

# Output as JSON
leapsql discover --output json

Released under the MIT License.