@bonnard/cli 0.1.12 → 0.2.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.
- package/dist/bin/bon.mjs +258 -5
- package/dist/bin/{validate-DiN3DaTl.mjs → validate-C31hmPk8.mjs} +15 -3
- package/dist/docs/_index.md +1 -1
- package/dist/docs/topics/cubes.data-source.md +2 -2
- package/dist/docs/topics/cubes.dimensions.format.md +2 -2
- package/dist/docs/topics/cubes.dimensions.md +2 -2
- package/dist/docs/topics/cubes.dimensions.primary-key.md +2 -2
- package/dist/docs/topics/cubes.dimensions.sub-query.md +2 -2
- package/dist/docs/topics/cubes.dimensions.time.md +2 -2
- package/dist/docs/topics/cubes.dimensions.types.md +2 -2
- package/dist/docs/topics/cubes.extends.md +2 -2
- package/dist/docs/topics/cubes.hierarchies.md +2 -2
- package/dist/docs/topics/cubes.joins.md +2 -2
- package/dist/docs/topics/cubes.md +2 -2
- package/dist/docs/topics/cubes.measures.calculated.md +2 -2
- package/dist/docs/topics/cubes.measures.drill-members.md +2 -2
- package/dist/docs/topics/cubes.measures.filters.md +2 -2
- package/dist/docs/topics/cubes.measures.format.md +2 -2
- package/dist/docs/topics/cubes.measures.md +2 -2
- package/dist/docs/topics/cubes.measures.rolling.md +2 -2
- package/dist/docs/topics/cubes.measures.types.md +2 -2
- package/dist/docs/topics/cubes.public.md +2 -2
- package/dist/docs/topics/cubes.refresh-key.md +2 -2
- package/dist/docs/topics/cubes.segments.md +2 -2
- package/dist/docs/topics/cubes.sql.md +2 -2
- package/dist/docs/topics/features.catalog.md +31 -0
- package/dist/docs/topics/features.cli.md +60 -0
- package/dist/docs/topics/features.context-graph.md +18 -0
- package/dist/docs/topics/features.governance.md +84 -0
- package/dist/docs/topics/features.mcp.md +48 -0
- package/dist/docs/topics/features.md +15 -0
- package/dist/docs/topics/features.sdk.md +53 -0
- package/dist/docs/topics/features.semantic-layer.md +50 -0
- package/dist/docs/topics/features.slack-teams.md +18 -0
- package/dist/docs/topics/getting-started.md +16 -0
- package/dist/docs/topics/pre-aggregations.md +2 -2
- package/dist/docs/topics/pre-aggregations.rollup.md +2 -2
- package/dist/docs/topics/syntax.context-variables.md +2 -2
- package/dist/docs/topics/syntax.md +2 -2
- package/dist/docs/topics/syntax.references.md +2 -2
- package/dist/docs/topics/views.cubes.md +2 -2
- package/dist/docs/topics/views.folders.md +2 -2
- package/dist/docs/topics/views.includes.md +2 -2
- package/dist/docs/topics/views.md +2 -2
- package/dist/docs/topics/workflow.deploy.md +79 -14
- package/dist/docs/topics/workflow.mcp.md +19 -13
- package/dist/docs/topics/workflow.md +25 -5
- package/dist/docs/topics/workflow.query.md +2 -2
- package/dist/docs/topics/workflow.validate.md +2 -2
- package/dist/templates/claude/skills/bonnard-get-started/SKILL.md +12 -3
- package/dist/templates/cursor/rules/bonnard-get-started.mdc +12 -3
- package/dist/templates/shared/bonnard.md +31 -4
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MCP
|
|
2
2
|
|
|
3
|
-
> Connect AI agents to your semantic layer
|
|
3
|
+
> Connect AI agents like Claude, ChatGPT, and Cursor to your semantic layer using the Model Context Protocol. MCP gives agents governed access to your metrics and dimensions.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -18,37 +18,39 @@ https://mcp.bonnard.dev/mcp
|
|
|
18
18
|
|
|
19
19
|
### Claude Desktop
|
|
20
20
|
|
|
21
|
-
1.
|
|
21
|
+
1. Click the **+** button in the chat input, then select **Connectors > Manage connectors**
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
22
25
|
2. Click **Add custom connector**
|
|
23
26
|
3. Enter a name (e.g. "Bonnard MCP") and the MCP URL: `https://mcp.bonnard.dev/mcp`
|
|
24
27
|
4. Click **Add**
|
|
25
28
|
|
|
26
|
-

|
|
27
|
-
|
|
28
29
|

|
|
29
30
|
|
|
30
|
-
Once added, enable the Bonnard connector in any chat via the **Connectors** menu
|
|
31
|
-
|
|
32
|
-

|
|
31
|
+
Once added, enable the Bonnard connector in any chat via the **Connectors** menu.
|
|
33
32
|
|
|
34
33
|
Remote MCP servers in Claude Desktop must be added through the Connectors UI, not the JSON config file.
|
|
35
34
|
|
|
36
35
|
### ChatGPT
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
Custom MCP servers must be added in the browser at [chatgpt.com](https://chatgpt.com) — the desktop app does not support this.
|
|
38
|
+
|
|
39
|
+
1. Go to [chatgpt.com](https://chatgpt.com) in your browser
|
|
40
|
+
2. Open **Settings > Apps**
|
|
40
41
|
|
|
41
42
|

|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
3. Click **Advanced settings**, enable **Developer mode**, then click **Create app**
|
|
45
|
+
|
|
46
|
+

|
|
44
47
|
|
|
45
|
-
3. Click **Create app**
|
|
46
48
|
4. Enter a name (e.g. "Bonnard MCP"), the MCP URL `https://mcp.bonnard.dev/mcp`, and select **OAuth** for authentication
|
|
47
49
|
5. Check the acknowledgement box and click **Create**
|
|
48
50
|
|
|
49
51
|

|
|
50
52
|
|
|
51
|
-
Once created, the Bonnard connector appears
|
|
53
|
+
Once created, the Bonnard connector appears under **Enabled apps**:
|
|
52
54
|
|
|
53
55
|

|
|
54
56
|
|
|
@@ -68,6 +70,8 @@ Open **Settings > MCP** and add the server URL, or add to `.cursor/mcp.json` in
|
|
|
68
70
|
}
|
|
69
71
|
```
|
|
70
72
|
|
|
73
|
+
On first use, your browser will open to sign in and authorize the connection.
|
|
74
|
+
|
|
71
75
|
### VS Code / GitHub Copilot
|
|
72
76
|
|
|
73
77
|
Open the Command Palette and run **MCP: Add Server**, or add to `.vscode/mcp.json` in your project:
|
|
@@ -83,6 +87,8 @@ Open the Command Palette and run **MCP: Add Server**, or add to `.vscode/mcp.jso
|
|
|
83
87
|
}
|
|
84
88
|
```
|
|
85
89
|
|
|
90
|
+
On first use, your browser will open to sign in and authorize the connection.
|
|
91
|
+
|
|
86
92
|
### Claude Code
|
|
87
93
|
|
|
88
94
|
Run in your terminal:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Workflow
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> The end-to-end workflow for building a semantic layer with Bonnard: validate your YAML definitions locally, deploy to the platform, and query your metrics via API or MCP.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ bon datasource add
|
|
|
21
21
|
bon validate
|
|
22
22
|
|
|
23
23
|
# 5. Deploy to Bonnard
|
|
24
|
-
bon deploy
|
|
24
|
+
bon deploy -m "Initial semantic layer"
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Project Structure
|
|
@@ -91,7 +91,17 @@ bon validate --test-connection
|
|
|
91
91
|
Push cubes and views to Bonnard:
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
bon deploy
|
|
94
|
+
bon deploy -m "Add orders cube and overview view"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 5. Review
|
|
98
|
+
|
|
99
|
+
Check what changed in your deployment:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
bon deployments # List recent deployments
|
|
103
|
+
bon diff <deployment-id> # View all changes
|
|
104
|
+
bon diff <deployment-id> --breaking # Breaking changes only
|
|
95
105
|
```
|
|
96
106
|
|
|
97
107
|
## File Organization
|
|
@@ -134,10 +144,20 @@ bonnard/cubes/
|
|
|
134
144
|
|---------|-------------|
|
|
135
145
|
| `bon init` | Create project structure |
|
|
136
146
|
| `bon datasource add` | Add a data source |
|
|
147
|
+
| `bon datasource add --demo` | Add demo dataset (no warehouse needed) |
|
|
148
|
+
| `bon datasource add --from-dbt` | Import from dbt profiles |
|
|
137
149
|
| `bon datasource list` | List configured sources |
|
|
138
150
|
| `bon datasource test <name>` | Test connection |
|
|
151
|
+
| `bon preview <ds> "SQL"` | Run raw SQL against a warehouse |
|
|
139
152
|
| `bon validate` | Check cube and view syntax |
|
|
140
|
-
| `bon
|
|
153
|
+
| `bon validate --test-connection` | Validate + test warehouse connections |
|
|
154
|
+
| `bon deploy -m "message"` | Deploy to Bonnard (message required) |
|
|
155
|
+
| `bon deploy --ci` | Non-interactive deploy |
|
|
156
|
+
| `bon deployments` | List deployment history |
|
|
157
|
+
| `bon diff <id>` | View changes in a deployment |
|
|
158
|
+
| `bon annotate <id>` | Add context to deployment changes |
|
|
159
|
+
| `bon query '{...}'` | Query the semantic layer |
|
|
160
|
+
| `bon mcp` | MCP setup instructions for AI agents |
|
|
141
161
|
| `bon docs` | Browse documentation |
|
|
142
162
|
|
|
143
163
|
## See Also
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Query
|
|
2
2
|
|
|
3
|
-
> Query
|
|
3
|
+
> Query your deployed semantic layer using the Bonnard REST API. Send JSON query objects or SQL strings to retrieve measures and dimensions with filtering, grouping, and time ranges.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Validate
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Run validation checks on your cubes and views before deploying to catch YAML syntax errors, missing references, circular joins, and other issues. Use `bon validate` from the CLI.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -157,6 +157,10 @@ Fix any errors before proceeding. Common issues:
|
|
|
157
157
|
- Unknown measure/dimension types (e.g., `text` should be `string`)
|
|
158
158
|
- Bad YAML indentation
|
|
159
159
|
|
|
160
|
+
Validate also warns about:
|
|
161
|
+
- **Missing descriptions** — descriptions help AI agents and analysts discover metrics
|
|
162
|
+
- **Missing `data_source`** — cubes without an explicit `data_source` use the default warehouse, which can cause issues when multiple warehouses are configured
|
|
163
|
+
|
|
160
164
|
Optionally test the datasource connection too:
|
|
161
165
|
|
|
162
166
|
```bash
|
|
@@ -169,11 +173,16 @@ Log in (if not already) and deploy:
|
|
|
169
173
|
|
|
170
174
|
```bash
|
|
171
175
|
bon login
|
|
172
|
-
bon deploy
|
|
176
|
+
bon deploy -m "Initial semantic layer with sales cube and overview view"
|
|
173
177
|
```
|
|
174
178
|
|
|
175
|
-
Deploy
|
|
176
|
-
credentials (encrypted)
|
|
179
|
+
Deploy requires a `-m` message describing the changes. It validates, tests
|
|
180
|
+
connections, uploads cubes/views, and syncs datasource credentials (encrypted)
|
|
181
|
+
to Bonnard.
|
|
182
|
+
|
|
183
|
+
After deploying, the output shows what changed (added/modified/removed) and
|
|
184
|
+
flags any breaking changes. Use `bon deployments` to see history and
|
|
185
|
+
`bon diff <id>` to review changes from any deployment.
|
|
177
186
|
|
|
178
187
|
## Phase 7: Test with a Query
|
|
179
188
|
|
|
@@ -156,6 +156,10 @@ Fix any errors before proceeding. Common issues:
|
|
|
156
156
|
- Unknown measure/dimension types (e.g., `text` should be `string`)
|
|
157
157
|
- Bad YAML indentation
|
|
158
158
|
|
|
159
|
+
Validate also warns about:
|
|
160
|
+
- **Missing descriptions** — descriptions help AI agents and analysts discover metrics
|
|
161
|
+
- **Missing `data_source`** — cubes without an explicit `data_source` use the default warehouse, which can cause issues when multiple warehouses are configured
|
|
162
|
+
|
|
159
163
|
Optionally test the datasource connection too:
|
|
160
164
|
|
|
161
165
|
```bash
|
|
@@ -168,11 +172,16 @@ Log in (if not already) and deploy:
|
|
|
168
172
|
|
|
169
173
|
```bash
|
|
170
174
|
bon login
|
|
171
|
-
bon deploy
|
|
175
|
+
bon deploy -m "Initial semantic layer with sales cube and overview view"
|
|
172
176
|
```
|
|
173
177
|
|
|
174
|
-
Deploy
|
|
175
|
-
credentials (encrypted)
|
|
178
|
+
Deploy requires a `-m` message describing the changes. It validates, tests
|
|
179
|
+
connections, uploads cubes/views, and syncs datasource credentials (encrypted)
|
|
180
|
+
to Bonnard.
|
|
181
|
+
|
|
182
|
+
After deploying, the output shows what changed (added/modified/removed) and
|
|
183
|
+
flags any breaking changes. Use `bon deployments` to see history and
|
|
184
|
+
`bon diff <id>` to review changes from any deployment.
|
|
176
185
|
|
|
177
186
|
## Phase 7: Test with a Query
|
|
178
187
|
|
|
@@ -64,9 +64,16 @@ All tables are in the `contoso` schema. The datasource is named `contoso_demo`.
|
|
|
64
64
|
| `bon datasource add --demo` | Add demo dataset (no warehouse needed) |
|
|
65
65
|
| `bon datasource add --from-dbt` | Import from dbt profiles |
|
|
66
66
|
| `bon datasource test <name>` | Test connection |
|
|
67
|
-
| `bon validate` | Validate YAML syntax |
|
|
68
|
-
| `bon validate --test-connection` | Validate + test connections |
|
|
69
|
-
| `bon deploy` | Deploy to Bonnard (requires login) |
|
|
67
|
+
| `bon validate` | Validate YAML syntax, warn on missing descriptions and `data_source` |
|
|
68
|
+
| `bon validate --test-connection` | Validate + test warehouse connections |
|
|
69
|
+
| `bon deploy -m "message"` | Deploy to Bonnard (requires login, message required) |
|
|
70
|
+
| `bon deploy --ci` | Non-interactive deploy (fails on missing datasources) |
|
|
71
|
+
| `bon deployments` | List recent deployments (add `--all` for full history) |
|
|
72
|
+
| `bon diff <deployment-id>` | Show changes in a deployment (`--breaking` for breaking only) |
|
|
73
|
+
| `bon annotate <deployment-id>` | Add reasoning/context to deployment changes |
|
|
74
|
+
| `bon query '{...}'` | Execute a semantic layer query (JSON or `--sql` format) |
|
|
75
|
+
| `bon preview <ds> "SQL"` | Run raw SQL against a warehouse |
|
|
76
|
+
| `bon mcp` | Show MCP setup instructions for AI agents |
|
|
70
77
|
| `bon docs` | Browse documentation |
|
|
71
78
|
|
|
72
79
|
## Learning YAML Syntax
|
|
@@ -93,6 +100,26 @@ Topics follow dot notation (e.g., `cubes.dimensions.time`). Use `--recursive` to
|
|
|
93
100
|
2. **Create cubes** — Define measures/dimensions in `bonnard/cubes/*.yaml`
|
|
94
101
|
3. **Create views** — Compose cubes in `bonnard/views/*.yaml`
|
|
95
102
|
4. **Validate** — `bon validate --test-connection`
|
|
96
|
-
5. **Deploy** — `bon login` then `bon deploy`
|
|
103
|
+
5. **Deploy** — `bon login` then `bon deploy -m "description of changes"`
|
|
104
|
+
6. **Review** — `bon deployments` to list, `bon diff <id>` to inspect changes
|
|
97
105
|
|
|
98
106
|
For a guided walkthrough: `/bonnard-get-started`
|
|
107
|
+
|
|
108
|
+
## Deployment & Change Tracking
|
|
109
|
+
|
|
110
|
+
Every deploy creates a versioned deployment with change detection:
|
|
111
|
+
|
|
112
|
+
- **Deploy** requires a message: `bon deploy -m "Add revenue metrics"`
|
|
113
|
+
- **Changes** are detected automatically: added, modified, removed fields
|
|
114
|
+
- **Breaking changes** (removed measures/dimensions, type changes) are flagged
|
|
115
|
+
- **Deployment history**: `bon deployments` lists recent deploys with IDs
|
|
116
|
+
- **Diff**: `bon diff <id>` shows all changes; `bon diff <id> --breaking` filters to breaking only
|
|
117
|
+
- **Annotate**: `bon annotate <id> --data '{"object": "note"}'` adds context to changes
|
|
118
|
+
|
|
119
|
+
For CI/CD pipelines, use `bon deploy --ci -m "message"` (non-interactive, fails on issues) or `bon deploy --push-datasources -m "message"` to auto-push missing datasources.
|
|
120
|
+
|
|
121
|
+
## Best Practices
|
|
122
|
+
|
|
123
|
+
- **Always set `data_source`** on cubes — without it, cubes silently use the default warehouse, which breaks when multiple warehouses are added later. `bon validate` warns about this.
|
|
124
|
+
- **Add descriptions** to all cubes, views, measures, and dimensions — these power AI agent discovery and the schema catalog.
|
|
125
|
+
- **Use `sql_table` with full schema path** (e.g., `schema.table_name`) for clarity.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonnard/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bon": "./dist/bin/bon.mjs"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsdown src/bin/bon.ts --format esm --out-dir dist/bin && cp -r src/templates dist/ && mkdir -p dist/docs/topics dist/docs/schemas && cp ../content/index.md dist/docs/_index.md && cp ../content/modeling/*.md dist/docs/topics/",
|
|
12
|
+
"build": "tsdown src/bin/bon.ts --format esm --out-dir dist/bin && cp -r src/templates dist/ && mkdir -p dist/docs/topics dist/docs/schemas && cp ../content/index.md dist/docs/_index.md && cp ../content/getting-started.md dist/docs/topics/ && cp ../content/modeling/*.md dist/docs/topics/",
|
|
13
13
|
"dev": "tsdown src/bin/bon.ts --format esm --out-dir dist/bin --watch",
|
|
14
14
|
"test": "vitest run"
|
|
15
15
|
},
|