Command Reference

Command Reference

Complete reference for all daana-cli commands.

Check

Validate configurations (model, mapping, workflow, connections)

Usage:

daana-cli check

Validate your YAML configurations without deploying to database.

When to check:

  • Before deploying to catch errors early
  • After editing any configuration file
  • When debugging deployment issues
  • In CI/CD pipelines for automated validation

What it validates:

  • model: Structure, entity definitions, naming conventions
  • mapping: References to model, required attributes, table configs
  • workflow: Complete workflow including all mappings
  • connections: Database connection profiles

Output formats: text (default) or json (for CI/CD)

Subcommands:

  • daana-cli check connections
  • daana-cli check mapping
  • daana-cli check model
  • daana-cli check workflow

Examples:

# Check model (uses model.yaml by default)
daana-cli check model
# Check all mappings in mappings/ directory
daana-cli check mapping
# Check a specific mapping
daana-cli check mapping customer-mapping.yaml
# Check workflow
daana-cli check workflow
# Check connection profiles
daana-cli check connections
# JSON output for CI/CD
daana-cli check model --format json

Connections

Validate connection profiles

Usage:

daana-cli check connections [file] [flags]

Validate connection profiles without deploying.

Arguments: [file] Path to connections YAML file (default: connections.yaml)

When to use:

  • Before deploying to verify database connectivity settings
  • After adding or modifying connection profiles
  • When debugging database connection issues
  • When setting up a new environment

What it validates:

  • Profile structure and syntax
  • Required fields for each SQL dialect (PostgreSQL, BigQuery, Snowflake, etc.)
  • Authentication configuration
  • SSL/encryption settings
  • Credential file paths

Flags:

FlagTypeDefaultDescription
--connection, -pstring-Connection profile name to validate (optional, validates all if not specified)
--strictboolfalseTreat warnings as errors

Examples:

# Check all profiles (uses connections.yaml by default)
daana-cli check connections
# Check a specific profile
daana-cli check connections --connection dev
# Strict mode (treat warnings as errors)
daana-cli check connections --connection prod --strict
# JSON output for CI/CD
daana-cli check connections --format json

Mapping

Validate mapping YAML file(s) against model and database schema

Usage:

daana-cli check mapping [path] [flags]

Validate a mapping YAML file or directory of mappings against their model and database schema.

Arguments: [path] Path to mapping file or directory (default: mappings/) If a directory, validates all .yaml/.yml files in it

When to use:

  • Before deploying your mappings
  • After modifying table or attribute mappings
  • When validating source table configurations
  • When debugging data transformation issues

What it validates: Structure (always performed):

  • YAML syntax and structure
  • Required fields (entity_id, mapping_groups, tables, etc.)
  • Entity exists in model
  • All attributes exist in model
  • All required attributes are mapped
  • Effective timestamp consistency
  • Relationship IDs match model definitions

Schema (enabled by default, use --skip-schema-validation to disable):

  • Tables exist in database
  • Primary key columns exist
  • Transformation expressions are valid SQL

Flags:

FlagTypeDefaultDescription
--connectionstring-Connection profile name to use
--connectionsstringconnections.yamlPath to connections YAML file
--modelstringmodel.yamlPath to model YAML file
--skip-schema-validationboolfalseSkip database schema validation
--strictboolfalseTreat warnings as errors in schema validation
--verboseboolfalseShow detailed validation output

Examples:

# Check all mappings in mappings/ directory
daana-cli check mapping
# Check a single mapping
daana-cli check mapping customer-mapping.yaml
# Check all mappings in a specific directory
daana-cli check mapping mappings/
# Skip schema validation (structure only)
daana-cli check mapping --skip-schema-validation
# Use specific connection profile
daana-cli check mapping --connection dev
# Verbose output with details
daana-cli check mapping --verbose
# Strict mode (warnings become errors)
daana-cli check mapping --strict

Model

Validate model YAML file

Usage:

daana-cli check model [file] [flags]

Validate a model YAML file without deploying.

Arguments: [file] Path to model YAML file (default: model.yaml)

When to use:

  • Before deploying your model
  • After modifying entity or attribute definitions
  • When validating naming conventions

What it validates:

  • YAML syntax and structure
  • Entity and attribute definitions
  • Relationship references
  • Naming conventions (UPPER_SNAKE_CASE)
  • Required fields

Flags:

FlagTypeDefaultDescription
--verboseboolfalseShow detailed validation output

Examples:

# Check model (uses model.yaml by default)
daana-cli check model
# Check a specific model file
daana-cli check model my-model.yaml
# Verbose output with details
daana-cli check model --verbose
# JSON output for CI/CD
daana-cli check model --format json

Workflow

Validate complete workflow (model + mappings + references)

Usage:

daana-cli check workflow [file] [flags]

Validate entire workflow including model, mappings, and connection profiles.

Arguments: [file] Path to workflow YAML file (default: workflow.yaml)

This is the comprehensive check - it validates your complete project setup.

When to use:

  • Before deploying (validates everything)
  • After modifying any configuration
  • When validating complete project setup
  • To verify all components work together

What it validates:

  • Workflow ID format (UPPER_SNAKE_CASE)
  • Model file exists and is valid (full model validation)
  • All mapping files exist and are valid (structure + model references)
  • Connection profile referenced exists and is valid
  • Entity coverage (warns if model entities aren't mapped)

Flags:

FlagTypeDefaultDescription
--verboseboolfalseShow detailed validation output

Examples:

# Check workflow (uses workflow.yaml by default)
daana-cli check workflow
# Check a specific workflow file
daana-cli check workflow my-workflow.yaml
# Verbose output with details
daana-cli check workflow --verbose
# JSON output for CI/CD
daana-cli check workflow --format json

Completion

Generate the autocompletion script for the specified shell

Usage:

daana-cli completion

To load completions:

Bash: source <(daana-cli completion bash) Zsh: source <(daana-cli completion zsh) Fish: daana-cli completion fish | source PowerShell: daana-cli completion powershell | Out-String | Invoke-Expression

Deploy

Deploy workflow to database

Usage:

daana-cli deploy [workflow.yaml] [flags]

Deploy workflow to make your data model and mappings ready for execution.

Arguments: [file] Path to workflow YAML file (default: workflow.yaml)

When to deploy:

  • After creating or modifying your model YAML
  • After creating or modifying your mapping YAML
  • After creating or modifying your workflow YAML
  • When setting up a new environment

What it does:

  • Sets up the transformation engine in your database
  • Loads your data model structure
  • Prepares your transformation mappings
  • Makes everything ready for data execution

Prerequisites:

  • Run 'daana-cli install' first to set up the framework

Flags:

FlagTypeDefaultDescription
--connectionstring-Connection profile name
--connectionsstringconnections.yamlPath to connections YAML file
--db-hoststring-Database host (defaults to config)
--db-namestring-Database name (defaults to config)
--db-passwordstring-Database password (defaults to config)
--db-portint0Database port (defaults to config)
--db-userstring-Database user (defaults to config)
--preview-sqlboolfalseGenerate SQL and output as JSON without executing on remote database
--skip-validationboolfalseSkip all pre-deploy validation including schema validation (not recommended)
--strictboolfalseTreat schema validation warnings as errors

Examples:

# Deploy a workflow (auto-detects workflow.yaml in current directory)
daana-cli deploy
# Deploy a specific workflow file
daana-cli deploy workflow.yaml
# After deploy, execute the workflow
daana-cli execute workflow.yaml --batch-start="2025-01-01" --batch-end="2025-01-31"

Doctor

Diagnose environment health and configuration issues

Usage:

daana-cli doctor

Diagnose your Daana CLI environment and configuration.

This command checks your setup and identifies potential issues before they cause problems during compilation, deployment, or execution.

What it checks:

  • Config file validity (syntax and required fields)
  • Database connectivity (can connect to configured databases)
  • focal-cli binary availability and version compatibility
  • Required paths exist (model, mappings directory, workflow)
  • Project structure validity

When to use:

  • After initial setup to verify everything is configured correctly
  • When commands fail with unclear errors
  • Before deploying to a new environment
  • When troubleshooting connection issues

Flags:

FlagTypeDefaultDescription
--verboseboolfalseShow detailed diagnostic output

Examples:

# Run all diagnostic checks
daana-cli doctor
# Check with verbose output
daana-cli doctor --verbose

Execute

Execute a workflow with data transformations

Usage:

daana-cli execute [workflow.yaml] [flags]

Execute your data transformation workflow to load data into your warehouse.

Arguments: [file] Path to workflow YAML file (default: workflow.yaml)

When to execute:

  • After deploying your workflow for the first time
  • On a schedule for incremental data loads
  • After updating mappings (redeploy first, then execute)
  • When backfilling historical data

What it does:

  • Reads data from your configured source tables
  • Transforms it according to your mapping definitions
  • Loads the transformed data into your data warehouse
  • Tracks batch progress for incremental workflows

Prerequisites:

  • Run 'daana-cli deploy' once before first execution
  • Redeploy only when model or mappings change

Flags:

FlagTypeDefaultDescription
--batch-endstring-Batch end datetime (e.g., 2025-01-31)
--batch-startstring-Batch start datetime (e.g., 2025-01-01)
--connectionstring-Connection profile name
--connectionsstringconnections.yamlPath to connections YAML file
--db-hoststring-Database host (defaults to config)
--db-namestring-Database name (defaults to config)
--db-passwordstring-Database password (defaults to config)
--db-portint0Database port (defaults to config)
--db-userstring-Database user (defaults to config)
--dry-runboolfalseShow without executing
--parallel-workersint4Number of parallel workers
--skip-cleanupboolfalseSkip staging cleanup after execution

Examples:

# Execute a workflow (auto-detects workflow.yaml in current directory)
daana-cli execute
# Execute with date range (for incremental loads)
daana-cli execute --batch-start="2025-01-01" --batch-end="2025-01-31"
# Execute a specific workflow file
daana-cli execute my-workflow.yaml
# Execute with specific connection profile
daana-cli execute workflow.yaml --connection dev

Generate

Generate template files for different components

Usage:

daana-cli generate

Generate template files to accelerate your development workflow.

When to use:

  • Starting to map a new entity to your model
  • Setting up connection profiles for a new environment
  • Creating workflow configuration from scratch

What it generates:

  • mapping: Entity mapping templates from your model
  • workflow: Workflow configuration templates
  • connections: Database connection profile templates

Templates include helpful comments and placeholders to guide you.

Subcommands:

  • daana-cli generate connections
  • daana-cli generate mapping
  • daana-cli generate model
  • daana-cli generate workflow

Examples:

# Generate a mapping template for an entity
daana-cli generate mapping --model model.yaml --entity CUSTOMER -o customer-mapping.yaml
# Generate workflow template from model
daana-cli generate workflow --model model.yaml -o workflow.yaml
# Generate connection profiles template
daana-cli generate connections -o connections.yaml

Connections

Generate a connections template YAML file

Usage:

daana-cli generate connections [flags]

Generate a connections template YAML file with examples for all supported SQL dialects.

When to use:

  • Setting up database connections for the first time
  • Adding connections for a new environment (dev, staging, prod)
  • Learning the connection profile format

What it generates:

  • PostgreSQL connection examples
  • BigQuery connection examples
  • SQL Server connection examples
  • Oracle connection examples
  • Snowflake connection examples
  • Best practices for environment variables and secrets management

Flags:

FlagTypeDefaultDescription
--out, -ostringstdoutOutput file path for the connections template

Examples:

# Generate connections template to file
daana-cli generate connections -o connections.yaml
# Generate to stdout
daana-cli generate connections

Mapping

Generate a mapping template YAML file for entities

Usage:

daana-cli generate mapping [flags]

Generate mapping template YAML files from your model.

When to use:

  • After defining your model entities
  • When adding new entities to map
  • To scaffold mappings for all entities at once

What it generates:

  • Attribute mappings based on model definitions
  • Relationship mappings
  • Table and column placeholders
  • Transformation expression templates

Defaults:

  • model: model.yaml
  • output directory: mappings/

Flags:

FlagTypeDefaultDescription
--entity, -estring-Entity ID to generate mapping for (omit for all entities)
--model, -mstringmodel.yamlPath to model file (YAML or JSON)
--out, -ostringstdoutOutput file for single entity
--out-dir, -dstringmappings/Output directory for all entities
--verbose, -vboolfalseGenerate detailed templates with comments

Examples:

# Generate mapping for all entities
daana-cli generate mapping
# Generate mapping for a specific entity
daana-cli generate mapping --entity CUSTOMER -o customer-mapping.yaml
# Generate all mappings to custom directory
daana-cli generate mapping --out-dir my-mappings/
# Verbose templates with comments
daana-cli generate mapping --verbose

Model

Generate a model template YAML file

Usage:

daana-cli generate model [flags]

Generate a model template YAML file for defining business entities, attributes, and relationships.

When to use:

  • Starting a new data transformation project
  • Learning the model structure and syntax
  • Creating a reference for your team

What it generates:

  • Model metadata structure
  • Example entities (CUSTOMER, ORDER)
  • Attribute definitions with types
  • Group attribute examples
  • Relationship definitions
  • Comprehensive inline documentation

Flags:

FlagTypeDefaultDescription
--out, -ostringstdoutOutput file path for the model template

Examples:

# Generate model template to file
daana-cli generate model -o model.yaml
# Generate to stdout (for piping)
daana-cli generate model

Workflow

Generate a workflow template YAML file

Usage:

daana-cli generate workflow [flags]

Generate a workflow template YAML file for orchestrating data transformations.

When to use:

  • After creating model and mappings
  • When setting up a new environment
  • To create workflow from existing files (smart mode)

What it generates:

  • Workflow metadata structure
  • Connection profile references
  • Model file references
  • Mapping file references
  • Advanced settings with examples
  • Commented instructions and explanations

Smart mode (auto-populates from existing files): Use --model and --mappings-dir to generate a workflow pre-populated with your actual model and mapping file references.

Flags:

FlagTypeDefaultDescription
--connectionstring-Connection profile name to use (e.g., 'dev', 'prod')
--connections, -cstringconnections.yamlPath to connections YAML file
--mappings-dir, -dstringmappings/Path to mappings directory (auto-discovers mapping files)
--model, -mstringmodel.yamlPath to model YAML file (populates workflow from model metadata)
--out, -ostringstdoutOutput file path for the workflow template

Examples:

# Generate workflow template
daana-cli generate workflow -o workflow.yaml
# Smart mode: generate from existing model and mappings
daana-cli generate workflow --model model.yaml --mappings-dir mappings/ -o workflow.yaml
# Specify connection profile
daana-cli generate workflow --model model.yaml --connection dev -o workflow.yaml

Init

Initialize a new Daana project with template files

Usage:

daana-cli init <directory> [flags]

Initialize a new Daana project with template files and directory structure.

When to use:

  • Starting a new data transformation project
  • Setting up a new environment with fresh templates
  • Learning Daana with the tutorial example

What it creates:

  • model.yaml - Data model template with example entities
  • workflow.yaml - Workflow orchestration template
  • connections.yaml - Database connection profiles template
  • mappings/ - Directory for entity mapping files
  • docker-compose.yml - Local database setup
  • README.md - Project documentation

All files follow Daana best practices and are ready for git.

Flags:

FlagTypeDefaultDescription
--examplestring-Initialize from example project (e.g., 'olist' for the tutorial)
--name, -nstringderived from directory nameProject name for templates

Examples:

# Create project in a new directory
daana-cli init my-data-project
# Create project in current directory
daana-cli init .
# Create project with custom name
daana-cli init my-project --name "My Data Project"
# Create tutorial project with Olist example data
daana-cli init olist-quickstart --example olist

Install

Install the Daana framework into a database

Usage:

daana-cli install [local|remote] [flags]

Install the Daana framework infrastructure into your databases.

Arguments: [target] Which database to install (default: both)

  • local: Install only internal database (internaldb)
  • remote: Install only customer database (data warehouse)
  • (none): Install both databases

When to install:

  • First time setting up a new environment
  • After upgrading daana-cli to a new major version
  • When setting up a new database server

What it does:

  • Creates database schemas and tables for metadata
  • Installs stored procedures and functions
  • Configures the transformation engine
  • Sets up internal and/or customer databases

Architecture: The framework uses TWO databases:

  • Internal DB (internaldb): Stores framework metadata (always PostgreSQL)
  • Customer DB: Your data warehouse (PostgreSQL, BigQuery, Snowflake, etc.)

Prerequisites:

  • Databases must be running and accessible
  • User must have CREATE privileges

Flags:

FlagTypeDefaultDescription
--connectionstring-Connection profile name
--connectionsstringconnections.yamlPath to connections YAML file
--db-hoststring-Database host (defaults to config)
--db-namestring-Database name (defaults to config)
--db-passwordstring-Database password (defaults to config)
--db-portint0Database port (defaults to config)
--db-userstring-Database user (defaults to config)
--dry-runboolfalseShow without installing
--focal-base-dirstring-Custom focal scripts directory

Examples:

# Simple install (auto-detects connections.yaml and config)
daana-cli install
# Install with explicit connection profile
daana-cli install --connection dev
# Install only internal database (internaldb)
daana-cli install local
# Install only customer database (data warehouse)
daana-cli install remote --connection dev
# Full manual configuration
daana-cli install \
--db-host localhost --db-port 5434 --db-name internaldb \
--db-user dev --db-password devpass \
--connections connections.yaml --connection dev

Lint

Lint a data model YAML file

Usage:

daana-cli lint [model.yaml] [flags]

Validate a data model YAML file against best practices and naming conventions.

When to use:

  • Before committing changes to your model
  • To enforce team coding standards
  • When reviewing model quality
  • As part of CI/CD validation

What it checks:

  • YAML syntax and structure
  • Entity naming conventions (UPPER_SNAKE_CASE)
  • Attribute naming conventions
  • Relationship definitions
  • Whitespace and formatting issues
  • Required fields presence

Defaults:

  • model: model.yaml (or specify via --in flag)

Flags:

FlagTypeDefaultDescription
--in, -istring-Input YAML file to lint
--strict, -sboolfalseEnforce stricter lint rules
--verbose, -vboolfalseShow detailed lint findings

Examples:

# Lint a model file
daana-cli lint model.yaml
# Lint with verbose output
daana-cli lint model.yaml --verbose
# Lint with strict mode (more rules enforced)
daana-cli lint model.yaml --strict
# Lint using input flag
daana-cli lint --in my-model.yaml

Merge

Synchronize mappings with updated model definitions

Usage:

daana-cli merge

Keep your mapping files in sync when your data model evolves.

When to use:

  • After adding new attributes to your model
  • After changing attribute properties (e.g., effective_timestamp)
  • After adding or removing relationships
  • When you want mappings to reflect the latest model structure

What it does:

  • Preserves your custom transformation expressions
  • Preserves table configurations and where clauses
  • Adds new attributes from model (with placeholders)
  • Removes attributes no longer in the model
  • Creates backups before overwriting

Available subcommands: mapping Merge mapping files with an updated model

Subcommands:

  • daana-cli merge mapping

Examples:

# Merge a single mapping with updated model
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml
# Merge all mappings in a workflow
daana-cli merge mapping --workflow workflow.yaml
# Preview changes without writing
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml --diff

Mapping

Synchronize mapping files with an updated model

Usage:

daana-cli merge mapping [flags]

Merge existing mapping files with an updated model while preserving customizations.

When to use:

  • After adding new attributes to your model entities
  • After changing attribute properties (e.g., effective_timestamp)
  • After adding or removing relationships
  • To ensure mappings reflect the latest model structure

What it preserves:

  • Custom transformation expressions
  • Table and connection configurations
  • Where clauses and filters
  • Ingestion strategies

What it updates:

  • Adds new attributes from model (with placeholder transformations)
  • Removes attributes no longer in model
  • Updates attribute properties (like effective_timestamp changes)
  • Adds new relationships (with placeholder configuration)

Safety features:

  • Creates timestamped .bak backup before overwriting
  • Validates output before writing
  • Atomic file writes (write to temp, then rename)
  • Shows diff preview with --diff flag
  • Dry-run mode with --dry-run flag

Modes: Single Mapping: --model and --mapping flags Workflow Mode: --workflow flag (merges all mappings in workflow)

Note: Model files can be YAML or JSON (YAML auto-compiles internally).

Flags:

FlagTypeDefaultDescription
--diff, -dboolfalseShow preview of changes without writing files
--dry-runboolfalseShow complete merged YAML output without writing files
--mapping, -pstring-Path to existing mapping YAML file to be merged (required for single-mapping mode)
--model, -mstring-Path to model file (.yaml or .json) with updated definitions (required for single-mapping mode)
--out, -ostringupdates original file with .bak backupOutput path for merged YAML file
--overwrite, -wboolfalseOverwrite the original mapping file instead of creating a new file
--verbose, -vboolfalseShow detailed information about changes during merge
--workflowstring-Path to workflow YAML file (merges all mappings in workflow)

Examples:

# Basic usage - merge and update in place (creates backup)
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml
# Preview changes without writing files
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml --diff
# See detailed verbose output during merge
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml --verbose
# Dry run - see complete output without writing
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml --dry-run
# Merge to a different output file
daana-cli merge mapping --model model.yaml --mapping customer-mapping.yaml --out merged.yaml
# Merge all mappings in a workflow
daana-cli merge mapping --workflow workflow.yaml

Reset

Reset commands for Daana databases

Usage:

daana-cli reset <subcommand>

Reset commands for Daana databases with state preservation.

This command requires a subcommand. Run 'daana-cli reset --help' to see available subcommands.

Available Subcommands: local Reset Daana's internal database (metadata and orchestration)

Use "daana-cli reset <subcommand> --help" for more information about a subcommand.

Subcommands:

  • daana-cli reset local

Examples:

# Reset internal database (preserves deployment history)
daana-cli reset local --db-host localhost --db-port 5434 \
--db-user dev --db-password devpass --db-name internaldb
# Preview what would be reset (dry-run)
daana-cli reset local --dry-run --db-host localhost --db-port 5434 \
--db-user dev --db-password devpass

Local

Reset Daana's internal database (NOT your customer data!)

Usage:

daana-cli reset local [flags]

Reset Daana's internal database while preserving deployment history.

IMPORTANT: This resets Daana's INTERNAL database for Daana's own use. Your customer/business database (data warehouse) is NEVER touched!

When to use:

  • When you need a clean slate for the internal database
  • When troubleshooting framework issues
  • Instead of Docker reset (preserves deployment history)

What it does:

  1. Dumps current state (preserves deployment history)
  2. Drops all schemas from internal database
  3. Reinstalls Focal framework
  4. Restores deployment history

What's in internal database (Daana's use):

  • Framework metadata and orchestration logic
  • Model definitions and mappings
  • Workflow configurations
  • Deployment history (CREATE_TABLE_LOG)

What's in customer database (NEVER touched):

  • Your actual business data
  • Transformed analytics tables
  • BI-ready data warehouse

Why use this instead of Docker reset:

  • Docker compose down/up destroys deployment history
  • This command preserves deployment history automatically

Flags:

FlagTypeDefaultDescription
--connectionstring-Connection profile to use
--connectionsstring-Path to connection profiles YAML
--db-hoststringlocalhostDatabase host
--db-namestringinternaldbDatabase name
--db-passwordstring-Database password
--db-portint5434Database port
--db-userstring-Database user
--dry-runboolfalsePreview actions without executing

Examples:

# Reset internal database (safe - customer data untouched)
daana-cli reset local --db-host localhost --db-port 5434 \
--db-user dev --db-password devpass --db-name internaldb
# Preview what would be reset (dry-run)
daana-cli reset local --dry-run --db-host localhost --db-port 5434 \
--db-user dev --db-password devpass
# Using config file (recommended)
daana-cli reset local