init
Initialize a new LeapSQL project with default directory structure and configuration.
This creates:
- models/ directory for SQL models
- seeds/ directory for seed data CSV files
- macros/ directory for Starlark macros
- leapsql.yaml configuration file
Use --example to create a full working demo project with sample data, models (staging + marts), and macros demonstrating best practices.
Usage
bash
leapsql init [directory] [flags]Options
| Option | Short | Default | Description |
|---|---|---|---|
--example | false | Create a full example project with seeds, models, and macros | |
--force | false | Overwrite existing configuration |
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
# Initialize in current directory
leapsql init
# Initialize with a full working example
leapsql init --example
# Initialize in a new directory
leapsql init my-project --example
# Force overwrite existing config
leapsql init --force