context enrich
The enrich command upgrades your context files from Bronze (schema-only) to Silver or Gold by adding descriptions, semantic tags, business logic, and usage guidance.
context enrich --target <tier>Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
--target <tier> | Target tier: silver or gold | silver |
--apply | Write changes directly to files | Off (preview mode) |
--source <name> | Data source name from config for sample values | First configured source |
--db <url> | Database URL for context-aware enrichment | $DATABASE_URL |
--context-dir <path> | Path to context files | ./context |
Examples
Section titled “Examples”Preview Silver enrichments
Section titled “Preview Silver enrichments”context enrich --target silverThis prints suggested changes without modifying any files.
Apply Silver enrichments
Section titled “Apply Silver enrichments”context enrich --target silver --applyEnrich to Gold tier
Section titled “Enrich to Gold tier”context enrich --target gold --apply --db postgres://localhost/myappGold-tier enrichment connects to the database to sample data and generate richer metadata.
Enrich a specific source
Section titled “Enrich a specific source”context enrich --target silver --apply --source analyticsWhat each tier adds
Section titled “What each tier adds”Silver
Section titled “Silver”- Human-readable descriptions for tables and columns
- Semantic type annotations (e.g.,
email,currency,timestamp) - Common query patterns
- Column-level tags
- Business logic documentation
- Data quality expectations
- Sensitive data classification (PII, PHI, financial)
- Suggested access policies
- Usage examples and caveats
- Relationship descriptions with cardinality notes
Example diff
Section titled “Example diff”model: name: users description: "Registered user accounts. One row per unique user." columns: - name: email type: varchar(255) description: "Primary email address, used for login and notifications." semantic_type: email pii: true - name: created_at type: timestamp description: "Timestamp when the account was created (UTC)."Next steps
Section titled “Next steps”- Check your enrichments with
context lint - Build the final manifest with
context build