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:
| Platform | Path |
|---|---|
| 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 loginor 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: customersSupported settings:
generate.datasets— register CSV datasets by name (name: path/to/file.csv)generate.tables.<table>.columns.<column>.formula— computed column expressiongenerate.tables.<table>.columns.<column>.dataset— dataset to sample values fromgenerate.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
| Variable | What it does |
|---|---|
WEAVORI_DATABASE_URL | Default PostgreSQL DSN when no DSN argument is passed |
WEAVORI_API_KEY | API key for non-interactive authentication (alternative to --api-key) |
WEAVORI_OUTPUT | Output 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
| Priority | Source |
|---|---|
| 1 | DSN passed as a positional argument |
| 2 | WEAVORI_DATABASE_URL environment variable |
| 3 | Saved DSN in ~/.weavori/config.yaml (from weavori connect) |
If none is set, Weavori fails with a message showing the available options.
API key
| Priority | Source |
|---|---|
| 1 | --api-key flag |
| 2 | WEAVORI_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
| Priority | Source |
|---|---|
| 1 | --output flag (when explicitly set) |
| 2 | WEAVORI_OUTPUT environment variable |
| 3 | Default: pretty |
Authentication identity
| Priority | Source |
|---|---|
| 1 | API key (--api-key / WEAVORI_API_KEY) |
| 2 | Cached subscription token in config.yaml |
| 3 | OAuth session from weavori login |
| 4 | Anonymous (limited functionality) |
See the authentication overview for the full flow.
Best practices by environment
| Environment | Recommended approach |
|---|---|
| Local development | Run weavori connect once to save your DSN, then run commands without arguments. Authenticate once with weavori login. |
| CI/CD pipelines | Set WEAVORI_API_KEY, WEAVORI_DATABASE_URL, and WEAVORI_OUTPUT from your provider's secret store. No config file is needed. |
| Teams / shared repos | Commit weavori.yaml for shared formulas and datasets. Never commit ~/.weavori/config.yaml — it is machine-specific and contains credentials. |
| Troubleshooting | Check 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
| Path | Purpose | Managed by |
|---|---|---|
~/.weavori/config.yaml | Saved DSN, cached subscription, device identity | connect, login, logout |
~/.weavori/auth.yaml | OAuth session tokens (keyring fallback) | login, logout |
~/.weavori/cache/ | Introspected schema cache | generate, cache clear |
./weavori.yaml (or any parent) | Project generation settings | git |