@lightdash/cli 1.14.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,10 +34,10 @@ Each file contains:
34
34
 
35
35
  **How to use these:**
36
36
  1. Read the JSON file(s) to understand what data the user wants in their app
37
- 2. Cross-reference the field IDs against the dbt YAML catalog at
38
- `/tmp/dbt-repo/models/schema.yml` for field descriptions, types, and relationships
39
- between fields — this helps you understand how the referenced charts connect to the
40
- user's overall prompt
37
+ 2. Cross-reference the field IDs against the dbt YAML catalog — read
38
+ `/tmp/dbt-repo/models/<exploreName>.yml` for the referenced explores — for field
39
+ descriptions, types, and relationships between fields; this helps you understand how
40
+ the referenced charts connect to the user's overall prompt
41
41
  3. Map fields to SDK calls:
42
42
  - `chartName` → `query(exploreName).label(chartName)` — **always set the label**
43
43
  - `metricQuery.dimensions` → `.dimensions([...])`
@@ -49,7 +49,17 @@ Available at `@/components/ui/<name>`:
49
49
 
50
50
  ## Semantic Layer (dbt models)
51
51
 
52
- The available data models are defined in dbt YAML files at **`/tmp/dbt-repo/models/`**. Read these to discover every model, dimension, metric, join, and parameter available to you. **Never guess field names** — use only what's in the YAML. When a dimension or metric has `ai_hints`, follow that guidance when deciding which field best matches the user's intent; hints supplement names, labels, and descriptions. (Parameters live in a `parameters:` block under `meta:` / `config.meta:`, or in `lightdash.config.yml` — see [Parameters](#parameters).)
52
+ The available data models are defined in dbt YAML files at **`/tmp/dbt-repo/models/`** — one file per model, plus an index. **Never guess field names** — use only what's in the YAML. When a dimension or metric has `ai_hints`, follow that guidance when deciding which field best matches the user's intent; hints supplement names, labels, and descriptions. (Parameters live in a `parameters:` block under `meta:` / `config.meta:`, or in `lightdash.config.yml` — see [Parameters](#parameters).)
53
+
54
+ ### Finding the right models
55
+
56
+ Projects range from a handful of models to well over a thousand, so the directory is indexed rather than inlined:
57
+
58
+ 1. **Read `/tmp/dbt-repo/models/_index.md` first.** It lists every model, most-queried first, with its file name, dimension/metric counts, joined tables, and description.
59
+ 2. **Read only the model files the app actually needs**, e.g. `Read /tmp/dbt-repo/models/orders.yml`. Each file holds that model's complete dimensions, metrics, joins, and parameters.
60
+ 3. **Grep when the index isn't enough.** If you know a field name but not its model, `Grep` the directory for it. A wide model may be split across `<name>.yml`, `<name>.part2.yml`, … — the last line of each part points at the next.
61
+
62
+ **Never read every model file, and never page through a file with `offset`/`limit`** — pick the model from the index and read that one file whole.
53
63
 
54
64
  ### Reading dbt YAML
55
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "unique-names-generator": "4.7.1",
42
42
  "uuid": "11.1.1",
43
43
  "yaml": "2.8.3",
44
- "@lightdash/common": "1.14.0",
45
- "@lightdash/warehouses": "1.14.0"
44
+ "@lightdash/common": "1.16.0",
45
+ "@lightdash/warehouses": "1.16.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",