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
| Option | Short | Default | Description |
|---|---|---|---|
--force | -f | false | Force full refresh, ignore content hashes |
Global Options
| Option | Short | Default | Description |
|---|---|---|---|
--config | config file (default: ./leapsql.yaml) | ||
--database | Path to DuckDB database (empty for in-memory) | ||
--env | Environment name | ||
--macros-dir | Path to macros directory | ||
--models-dir | Path to models directory | ||
--output | -o | Output format (auto|text|markdown|json) | |
--project-dir | -C | Project root directory (auto-detected from models-dir or config file location) | |
--seeds-dir | Path to seeds directory | ||
--state | Path to state database | ||
--target | -t | Target environment to use (e.g., dev, staging, prod) | |
--verbose | -v | false | Verbose 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