Skip to main content
basecut init introspects your database and generates a runnable basecut.yml. It guides you through:
  • root table selection
  • lookup/junction table handling
  • optional PII rule generation
  • preflight validation against the live schema

Usage

basecut init [flags]

Flags

FlagDefaultDescription
--source <url>, -s$BASECUT_DATABASE_URLPostgreSQL connection string to introspect.
--output <path>, -obasecut.ymlOutput config path.
--force, -ffalseOverwrite existing file without prompt.

Examples

Basic Usage

basecut init --source "postgresql://readonly@prod-db:5432/myapp"
Generated config shape:
version: '1'
name: 'my-snapshot'

from:
  - table: users
    where: 'id = :id'
    params:
      id: 42

include_all:
  - countries

traverse:
  stop_at:
    - user_roles

limits:
  rows:
    per_table: 1000
    total: 100000

sampling:
  mode: random
  seed: 0

anonymize:
  mode: auto
  rules:
    users:
      email: fake_email

output: ./snapshots

Next Step

basecut snapshot create --config basecut.yml --name dev-seed --source "$BASECUT_DATABASE_URL"