Configuration & Environment

All configuration options | saved connections, environment variables, config file locations, and precedence rules.

Last updated October 20, 2018

Weavori is designed to be zero-config: it works with defaults out of the box. When you do need to configure it, every option fits into one simple rule:

Flags override environment variables, which override config files.

This guide is the single source of truth for how Weavori is configured.

Configuration files

User config: ~/.weavori/config.yaml

Weavori stores user-specific state in a single YAML file, created automatically on first use:

PlatformPath
Linux / macOS~/.weavori/config.yaml
Windows%USERPROFILE%\.weavori\config.yaml

The file holds only machine-specific state, never product constants:

  • Saved database connection — written by weavori connect
  • Cached subscription token — written by weavori login or an API key exchange
  • Device identity — a random identifier generated on first run, used for anonymous usage tracking and the anonymous daily budget

You normally never edit this file — the CLI manages it. Deleting it is safe but resets everything: you'll need to run weavori connect again, weavori login again, and the anonymous daily budget restarts.

Project config: weavori.yaml

For per-project generation settings, Weavori reads a weavori.yaml file discovered by searching upward from your current working directory — so it works from any subdirectory and can be committed to your repository:

version: 1
generate:
  datasets:
    customers: ./data/customers.csv
  tables:
    orders:
      columns:
        total:
          formula: 'round(quantity * unit_price, 2)'
        customer_id:
          dataset: customers

Supported settings:

  • generate.datasets — register CSV datasets by name (name: path/to/file.csv)
  • generate.tables.<table>.columns.<column>.formula — computed column expression
  • generate.tables.<table>.columns.<column>.dataset — dataset to sample values from
  • generate.tables.<table>.columns.<column>.column — optional CSV column name (auto-detected when the dataset has a single column)

Project config is best-effort and merge-only: it fills gaps, never overrides explicit flags, and an invalid weavori.yaml logs a warning and is ignored rather than failing the run.

Session credentials: ~/.weavori/auth.yaml

OAuth session tokens from weavori login are stored in your operating system's keyring when available, with ~/.weavori/auth.yaml as the file fallback. weavori logout clears them.

Schema cache: ~/.weavori/cache/

Introspected schemas are cached here. See Schema & Caching Management for details.

Environment variables

VariableWhat it does
WEAVORI_DATABASE_URLDefault PostgreSQL DSN when no DSN argument is passed
WEAVORI_API_KEYAPI key for non-interactive authentication (alternative to --api-key)
WEAVORI_OUTPUTOutput format when --output is not set: pretty, plain, or json

Environment variables are the recommended way to configure CI and headless environments — see CI/CD Integration.

Precedence rules

Database DSN

PrioritySource
1DSN passed as a positional argument
2WEAVORI_DATABASE_URL environment variable
3Saved DSN in ~/.weavori/config.yaml (from weavori connect)

If none is set, Weavori fails with a message showing the available options.

API key

PrioritySource
1--api-key flag
2WEAVORI_API_KEY environment variable

An explicit API key always wins over any ambient session state — it is the reliable way to pin a CI run to a specific identity.

Output format

PrioritySource
1--output flag (when explicitly set)
2WEAVORI_OUTPUT environment variable
3Default: pretty

Authentication identity

PrioritySource
1API key (--api-key / WEAVORI_API_KEY)
2Cached subscription token in config.yaml
3OAuth session from weavori login
4Anonymous (limited functionality)

See the authentication overview for the full flow.

Best practices by environment

EnvironmentRecommended approach
Local developmentRun weavori connect once to save your DSN, then run commands without arguments. Authenticate once with weavori login.
CI/CD pipelinesSet WEAVORI_API_KEY, WEAVORI_DATABASE_URL, and WEAVORI_OUTPUT from your provider's secret store. No config file is needed.
Teams / shared reposCommit weavori.yaml for shared formulas and datasets. Never commit ~/.weavori/config.yaml — it is machine-specific and contains credentials.
TroubleshootingCheck WEAVORI_DATABASE_URL if commands use the wrong database — an env var silently outranks the saved DSN. Use weavori whoami to confirm which identity a run will use.

Where things live

PathPurposeManaged by
~/.weavori/config.yamlSaved DSN, cached subscription, device identityconnect, login, logout
~/.weavori/auth.yamlOAuth session tokens (keyring fallback)login, logout
~/.weavori/cache/Introspected schema cachegenerate, cache clear
./weavori.yaml (or any parent)Project generation settingsgit