Skip to content

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

OptionShortDefaultDescription
--examplefalseCreate a full example project with seeds, models, and macros
--forcefalseOverwrite existing configuration

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
# 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

Released under the MIT License.