@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.
Files changed (53) hide show
  1. package/dist/bin/bon.mjs +258 -5
  2. package/dist/bin/{validate-DiN3DaTl.mjs → validate-C31hmPk8.mjs} +15 -3
  3. package/dist/docs/_index.md +1 -1
  4. package/dist/docs/topics/cubes.data-source.md +2 -2
  5. package/dist/docs/topics/cubes.dimensions.format.md +2 -2
  6. package/dist/docs/topics/cubes.dimensions.md +2 -2
  7. package/dist/docs/topics/cubes.dimensions.primary-key.md +2 -2
  8. package/dist/docs/topics/cubes.dimensions.sub-query.md +2 -2
  9. package/dist/docs/topics/cubes.dimensions.time.md +2 -2
  10. package/dist/docs/topics/cubes.dimensions.types.md +2 -2
  11. package/dist/docs/topics/cubes.extends.md +2 -2
  12. package/dist/docs/topics/cubes.hierarchies.md +2 -2
  13. package/dist/docs/topics/cubes.joins.md +2 -2
  14. package/dist/docs/topics/cubes.md +2 -2
  15. package/dist/docs/topics/cubes.measures.calculated.md +2 -2
  16. package/dist/docs/topics/cubes.measures.drill-members.md +2 -2
  17. package/dist/docs/topics/cubes.measures.filters.md +2 -2
  18. package/dist/docs/topics/cubes.measures.format.md +2 -2
  19. package/dist/docs/topics/cubes.measures.md +2 -2
  20. package/dist/docs/topics/cubes.measures.rolling.md +2 -2
  21. package/dist/docs/topics/cubes.measures.types.md +2 -2
  22. package/dist/docs/topics/cubes.public.md +2 -2
  23. package/dist/docs/topics/cubes.refresh-key.md +2 -2
  24. package/dist/docs/topics/cubes.segments.md +2 -2
  25. package/dist/docs/topics/cubes.sql.md +2 -2
  26. package/dist/docs/topics/features.catalog.md +31 -0
  27. package/dist/docs/topics/features.cli.md +60 -0
  28. package/dist/docs/topics/features.context-graph.md +18 -0
  29. package/dist/docs/topics/features.governance.md +84 -0
  30. package/dist/docs/topics/features.mcp.md +48 -0
  31. package/dist/docs/topics/features.md +15 -0
  32. package/dist/docs/topics/features.sdk.md +53 -0
  33. package/dist/docs/topics/features.semantic-layer.md +50 -0
  34. package/dist/docs/topics/features.slack-teams.md +18 -0
  35. package/dist/docs/topics/getting-started.md +16 -0
  36. package/dist/docs/topics/pre-aggregations.md +2 -2
  37. package/dist/docs/topics/pre-aggregations.rollup.md +2 -2
  38. package/dist/docs/topics/syntax.context-variables.md +2 -2
  39. package/dist/docs/topics/syntax.md +2 -2
  40. package/dist/docs/topics/syntax.references.md +2 -2
  41. package/dist/docs/topics/views.cubes.md +2 -2
  42. package/dist/docs/topics/views.folders.md +2 -2
  43. package/dist/docs/topics/views.includes.md +2 -2
  44. package/dist/docs/topics/views.md +2 -2
  45. package/dist/docs/topics/workflow.deploy.md +79 -14
  46. package/dist/docs/topics/workflow.mcp.md +19 -13
  47. package/dist/docs/topics/workflow.md +25 -5
  48. package/dist/docs/topics/workflow.query.md +2 -2
  49. package/dist/docs/topics/workflow.validate.md +2 -2
  50. package/dist/templates/claude/skills/bonnard-get-started/SKILL.md +12 -3
  51. package/dist/templates/cursor/rules/bonnard-get-started.mdc +12 -3
  52. package/dist/templates/shared/bonnard.md +31 -4
  53. package/package.json +2 -2
@@ -0,0 +1,60 @@
1
+ # CLI
2
+
3
+ > Built for agent-first development by data engineers.
4
+
5
+ The Bonnard CLI (`bon`) takes you from zero to a deployed semantic layer in minutes. Initialize a project, connect your warehouse, define metrics in YAML, validate locally, and deploy — all from your terminal or your AI coding agent.
6
+
7
+ ## Agent-ready from the start
8
+
9
+ `bon init` generates context files for your AI coding tools automatically:
10
+
11
+ - **Claude Code** — `.claude/rules/` + get-started skill
12
+ - **Cursor** — `.cursor/rules/` with auto-apply frontmatter
13
+ - **Codex** — `AGENTS.md` + skills folder
14
+
15
+ Your agent understands Bonnard's modeling language from the first prompt.
16
+
17
+ ## Key commands
18
+
19
+ ```bash
20
+ bon init # Scaffold project + agent context
21
+ bon datasource add --demo # Add a demo warehouse instantly
22
+ bon datasource add --from-dbt # Import connections from dbt
23
+ bon validate --test-connection # Check YAML syntax + warehouse connectivity
24
+ bon deploy -m "description" # Ship to production (message required)
25
+ bon query '{"measures":["orders.count"]}' # Test your semantic layer
26
+ bon preview <ds> "SELECT ..." # Run raw SQL against a warehouse
27
+ bon deployments # List deployment history
28
+ bon diff <id> # View changes in a deployment
29
+ bon annotate <id> --data '{...}' # Add context to deployment changes
30
+ bon mcp # Get MCP setup instructions
31
+ bon docs cubes.measures # Read modeling docs in terminal
32
+ ```
33
+
34
+ ## CI/CD ready
35
+
36
+ Deploy from GitHub Actions, GitLab CI, or any pipeline:
37
+
38
+ ```bash
39
+ bon deploy --ci --push-datasources -m "CI deploy"
40
+ ```
41
+
42
+ Non-interactive mode with automatic datasource sync. Fails fast if anything is misconfigured.
43
+
44
+ ## Deployment versioning
45
+
46
+ Every deploy creates a versioned deployment with automatic change detection — added, modified, removed, and breaking changes are flagged. Review history with `bon deployments`, inspect changes with `bon diff`, and add context with `bon annotate`.
47
+
48
+ ## Built-in documentation
49
+
50
+ ```bash
51
+ bon docs cubes.measures # Read modeling docs in your terminal
52
+ bon docs --search "joins" # Search across all topics
53
+ ```
54
+
55
+ No context-switching. Learn and build in the same workflow.
56
+
57
+ ## See Also
58
+
59
+ - [workflow.deploy](workflow.deploy) — Deployment details
60
+ - [workflow.validate](workflow.validate) — Validation reference
@@ -0,0 +1,18 @@
1
+ # Context Graph (Coming Soon)
2
+
3
+ > Visualize how your metrics connect. Coming soon.
4
+
5
+ The Business Context Graph will provide an interactive visual map of your entire semantic layer — cubes, views, joins, and field dependencies — so you can understand impact before making changes.
6
+
7
+ ## Planned capabilities
8
+
9
+ - **Relationship visualization** — See how cubes connect through joins and shared dimensions
10
+ - **Impact analysis** — Understand which views and measures are affected when you change a cube
11
+ - **Field lineage** — Trace any metric back through its dependencies to the source table
12
+ - **Search and filter** — Navigate large models by searching for specific fields or cubes
13
+
14
+ ## Why it matters
15
+
16
+ As your semantic layer grows, understanding the relationships between dozens of cubes and hundreds of fields becomes critical. The Context Graph gives your team a shared mental model of how metrics are defined and connected — reducing errors and speeding up development.
17
+
18
+ Interested in early access? Reach out at [hello@bonnard.dev](mailto:hello@bonnard.dev).
@@ -0,0 +1,84 @@
1
+ # Governance
2
+
3
+ > User and group-level permissions for your semantic layer.
4
+
5
+ Bonnard supports declarative data access policies — define who can see which rows, columns, and views directly in your YAML models. No application code, no database-level workarounds.
6
+
7
+ ## Row-level security
8
+
9
+ Filter data based on user attributes. A sales manager only sees their region's data:
10
+
11
+ ```yaml
12
+ cubes:
13
+ - name: orders
14
+ access_policy:
15
+ - role: sales_manager
16
+ row_level:
17
+ filters:
18
+ - member: region
19
+ operator: equals
20
+ values: ["{ securityContext.region }"]
21
+ ```
22
+
23
+ Every query from that user automatically includes the filter — no way to bypass it.
24
+
25
+ ## Member-level security
26
+
27
+ Control which measures and dimensions each role can access. Hide sensitive fields from non-privileged users:
28
+
29
+ ```yaml
30
+ cubes:
31
+ - name: orders
32
+ access_policy:
33
+ - role: analyst
34
+ member_level:
35
+ includes:
36
+ - count
37
+ - total_revenue
38
+ - status
39
+ - created_at
40
+
41
+ - role: admin
42
+ member_level:
43
+ includes: "*"
44
+ ```
45
+
46
+ Roles without a matching policy see nothing.
47
+
48
+ ## View-based governance
49
+
50
+ Keep cubes private. Expose only curated views to consumers:
51
+
52
+ ```yaml
53
+ cubes:
54
+ - name: raw_orders
55
+ public: false
56
+
57
+ views:
58
+ - name: sales_overview
59
+ public: true
60
+ cubes:
61
+ - join_path: raw_orders
62
+ includes:
63
+ - revenue
64
+ - order_count
65
+ - status
66
+ ```
67
+
68
+ Business users, AI agents, and SDK consumers only see the views you choose to expose — with clean names and descriptions.
69
+
70
+ ## Dynamic visibility
71
+
72
+ Use context variables to show or hide entire cubes based on the user's role:
73
+
74
+ ```yaml
75
+ cubes:
76
+ - name: executive_metrics
77
+ public: "{{ 'true' if COMPILE_CONTEXT.role == 'executive' else 'false' }}"
78
+ ```
79
+
80
+ ## See Also
81
+
82
+ - [cubes.public](cubes.public) — Visibility controls reference
83
+ - [views](views) — Creating curated data views
84
+ - [syntax.context-variables](syntax.context-variables) — Context variable reference
@@ -0,0 +1,48 @@
1
+ # MCP
2
+
3
+ > Connect your preferred AI agent to your semantic layer.
4
+
5
+ Bonnard exposes your semantic layer as a remote MCP server. Add one URL to your agent platform and it can explore your data model, run queries, and render charts — all through the Model Context Protocol.
6
+
7
+ ![MCP chat with visualisations](/images/mcp-chat-demo.gif)
8
+
9
+ ## Connect your agent
10
+
11
+ Bonnard works with any MCP-compatible client:
12
+
13
+ - **Claude Desktop** — Add as a custom connector
14
+ - **ChatGPT** — Add via Settings > Apps (Pro/Plus)
15
+ - **Cursor** — Add via Settings > MCP or `.cursor/mcp.json`
16
+ - **Microsoft Copilot Studio** — Add as an MCP tool with OAuth 2.0 authentication
17
+ - **VS Code / GitHub Copilot** — Add via Command Palette or `.vscode/mcp.json`
18
+ - **Claude Code** — Add via `claude mcp add` or `.mcp.json`
19
+ - **Windsurf** — Add via MCP config
20
+ - **Gemini CLI** — Add via `.gemini/settings.json`
21
+
22
+ One URL for all of them:
23
+
24
+ ```
25
+ https://mcp.bonnard.dev/mcp
26
+ ```
27
+
28
+ On first use, your browser opens to sign in — the agent receives a 30-day token automatically. No API keys, no config files, no secrets to rotate.
29
+
30
+ ## Tools your agent gets
31
+
32
+ | Tool | What it does |
33
+ |------|-------------|
34
+ | `explore_schema` | Browse cubes, views, and fields — or search by keyword |
35
+ | `query` | Run structured queries with measures, dimensions, filters, and time grouping |
36
+ | `sql_query` | Execute raw SQL for complex analysis (CTEs, UNIONs, custom calculations) |
37
+ | `describe_field` | Inspect any field's SQL definition, type, format, and dependencies |
38
+ | `visualize` | Render line, bar, pie, and KPI charts directly inside the conversation |
39
+
40
+ ## Charts in chat
41
+
42
+ The `visualize` tool renders interactive charts inline — auto-detected from your query shape. Charts support dark mode, currency and percentage formatting, and multi-series data.
43
+
44
+ Ask "show me revenue by region this quarter" and get a formatted chart in your conversation, not a data dump.
45
+
46
+ ## See Also
47
+
48
+ - [workflow.mcp](workflow.mcp) — Step-by-step setup for each platform
@@ -0,0 +1,15 @@
1
+ # Features
2
+
3
+ > Everything you need to define, deploy, and query your semantic layer.
4
+
5
+ Bonnard is a semantic layer platform built for AI-first analytics. Define your metrics once in YAML, deploy in seconds, and query from anywhere — your IDE, your AI agent, or your own apps.
6
+
7
+ - **[MCP](features.mcp)** — Connect your preferred AI agent to your semantic layer
8
+ - **[CLI](features.cli)** — Agent-first development workflow for data engineers
9
+ - **[Semantic Layer](features.semantic-layer)** — Hosted, queryable metrics layer across all your warehouses
10
+ - **[Catalog](features.catalog)** — Browse and understand your data model from the browser
11
+ - **[SDK](features.sdk)** — Build custom data apps on top of Bonnard
12
+ - **[Governance](features.governance)** — User and group-level permissions for your data
13
+ - **[Context Graph](features.context-graph)** — Visual map of how your metrics connect (coming soon)
14
+ - **[Slack & Teams](features.slack-teams)** — AI agents in your team chat (coming soon)
15
+ - **[Deployment Versioning](workflow.deploy)** — Change detection, diff, and annotations for every deploy
@@ -0,0 +1,53 @@
1
+ # SDK
2
+
3
+ > Build custom data apps on top of your semantic layer.
4
+
5
+ The Bonnard SDK (`@bonnard/sdk`) is a lightweight TypeScript client for querying your deployed semantic layer programmatically. Build dashboards, embedded analytics, internal tools, or data pipelines — all backed by your governed metrics.
6
+
7
+ ## Quick start
8
+
9
+ ```bash
10
+ npm install @bonnard/sdk
11
+ ```
12
+
13
+ ```typescript
14
+ import { createClient } from '@bonnard/sdk';
15
+
16
+ const bonnard = createClient({
17
+ apiKey: 'your-api-key',
18
+ });
19
+
20
+ const result = await bonnard.query({
21
+ cube: 'orders',
22
+ measures: ['revenue', 'count'],
23
+ dimensions: ['status'],
24
+ timeDimension: {
25
+ dimension: 'created_at',
26
+ granularity: 'month',
27
+ dateRange: ['2025-01-01', '2025-12-31'],
28
+ },
29
+ });
30
+ ```
31
+
32
+ ## Type-safe queries
33
+
34
+ Full TypeScript support with inference. Measures, dimensions, filters, time dimensions, and sort orders are all typed. Query results include field annotations with titles and types.
35
+
36
+ ```typescript
37
+ const result = await bonnard.sql<OrderRow>(
38
+ `SELECT status, MEASURE(revenue) FROM orders GROUP BY 1`
39
+ );
40
+ // result.data is OrderRow[]
41
+ ```
42
+
43
+ ## What you can build
44
+
45
+ - **Custom dashboards** — Query your semantic layer from Next.js, React, or any frontend
46
+ - **Embedded analytics** — Add governed metrics to your product
47
+ - **Data pipelines** — Consume semantic layer data in ETL workflows
48
+ - **Internal tools** — Build admin panels backed by consistent metrics
49
+
50
+ ## See Also
51
+
52
+ - [features.semantic-layer](features.semantic-layer) — Platform overview
53
+ - [workflow.query](workflow.query) — Query format reference
@@ -0,0 +1,50 @@
1
+ # Semantic Layer
2
+
3
+ > Define metrics once. Query from anywhere.
4
+
5
+ Bonnard hosts your semantic layer so you don't have to. Define cubes and views in YAML, deploy with `bon deploy`, and query via JSON API, SQL, or MCP — no infrastructure to manage.
6
+
7
+ ## Multi-warehouse
8
+
9
+ Connect any combination of warehouses through a single semantic layer:
10
+
11
+ - **PostgreSQL** — Direct TCP connection
12
+ - **Snowflake** — Account-based authentication
13
+ - **BigQuery** — GCP service account
14
+ - **Databricks** — Token-based workspace connection
15
+
16
+ Metrics from different warehouses are queried through the same API. Your consumers never need to know where the data lives.
17
+
18
+ ## Two query formats
19
+
20
+ **JSON API** — Structured queries with type-safe parameters:
21
+
22
+ ```bash
23
+ bon query '{
24
+ "measures": ["orders.revenue"],
25
+ "dimensions": ["orders.status"],
26
+ "timeDimensions": [{
27
+ "dimension": "orders.created_at",
28
+ "granularity": "month",
29
+ "dateRange": ["2025-01-01", "2025-12-31"]
30
+ }]
31
+ }'
32
+ ```
33
+
34
+ **SQL** — Full Cube SQL syntax for complex analysis:
35
+
36
+ ```bash
37
+ bon query --sql "SELECT status, MEASURE(revenue) FROM orders GROUP BY 1"
38
+ ```
39
+
40
+ ## Fully managed
41
+
42
+ Your models are stored securely and served from Bonnard's infrastructure. Each organization gets isolated query execution scoped by JWT — no shared data, no noisy neighbors.
43
+
44
+ Deploy in seconds. Query in milliseconds.
45
+
46
+ ## See Also
47
+
48
+ - [workflow.query](workflow.query) — Query format reference
49
+ - [cubes](cubes) — Cube modeling guide
50
+ - [views](views) — View modeling guide
@@ -0,0 +1,18 @@
1
+ # Slack & Teams (Coming Soon)
2
+
3
+ > AI agents in your team chat. Coming soon.
4
+
5
+ Bonnard will bring semantic layer queries directly into Slack and Microsoft Teams — so anyone on your team can ask questions about data without leaving the conversation.
6
+
7
+ ## Planned capabilities
8
+
9
+ - **Natural language queries** — Ask "what was revenue last month?" in a channel and get an answer with a chart
10
+ - **Governed responses** — Every answer goes through your semantic layer, so metrics are always consistent
11
+ - **Shared context** — Results posted in channels are visible to the whole team, not siloed in individual AI chats
12
+ - **Proactive alerts** — Get notified when key metrics change beyond thresholds you define
13
+
14
+ ## Why it matters
15
+
16
+ Your team already lives in Slack and Teams. Instead of asking analysts or switching to a BI tool, anyone can get instant, governed answers right where they work. The same semantic layer that powers your AI agents and dashboards powers your team chat.
17
+
18
+ Interested in early access? Reach out at [hello@bonnard.dev](mailto:hello@bonnard.dev).
@@ -0,0 +1,16 @@
1
+ # Getting Started
2
+
3
+ > Install the Bonnard CLI, connect your data warehouse, and define your first semantic layer with cubes and views in under five minutes.
4
+
5
+ ## What is Bonnard?
6
+
7
+ Bonnard is a semantic layer platform that sits between your data warehouse and your consumers (BI tools, AI agents, applications). You define your metrics and dimensions once in YAML, then query them through a consistent API.
8
+
9
+ <GettingStartedSteps />
10
+
11
+ ## Next steps
12
+
13
+ - Learn about [cubes](/docs/modeling/cubes) — measures, dimensions, joins
14
+ - Learn about [views](/docs/modeling/views) — curated interfaces for consumers
15
+ - Set up [MCP](/docs/workflow/mcp) — connect AI agents to your semantic layer
16
+ - Read the full [workflow guide](/docs/workflow) — validate, deploy, query
@@ -1,6 +1,6 @@
1
- # pre-aggregations
1
+ # Pre-Aggregations
2
2
 
3
- > Materialize query results for faster analytics performance.
3
+ > Pre-aggregations materialize query results into summary tables for faster analytics performance. Define rollups to speed up dashboards, AI agent queries, and API responses.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # pre-aggregations.rollup
1
+ # Rollups
2
2
 
3
- > Create summarized data tables for high-performance queries.
3
+ > Rollups are pre-aggregation tables that store summarized data for high-performance queries. Define which measures and dimensions to materialize, and Bonnard generates and refreshes them automatically.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # syntax.context-variables
1
+ # Context Variables
2
2
 
3
- > Access runtime context in SQL expressions.
3
+ > Context variables give you access to runtime information inside SQL expressions. Use them to implement row-level security, multi-tenancy, dynamic date ranges, and environment-specific logic.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # syntax
1
+ # Syntax
2
2
 
3
- > YAML syntax and conventions for cubes and views.
3
+ > YAML syntax reference for defining cubes and views in Bonnard. Covers naming conventions, property formats, SQL expressions, Jinja templating, and member references.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # syntax.references
1
+ # References
2
2
 
3
- > Reference columns, members, and other cubes in SQL expressions.
3
+ > References let you point to columns, measures, dimensions, and other cubes inside SQL expressions. Use curly-brace syntax to create type-safe, refactor-friendly cross-cube references.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # views.cubes
1
+ # View Cubes
2
2
 
3
- > Select which cubes and members to expose in a view.
3
+ > The cubes property in a view selects which cubes and members to expose. Pick specific measures and dimensions from multiple cubes to create focused, consumer-ready interfaces.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # views.folders
1
+ # View Folders
2
2
 
3
- > Organize view members into logical groups.
3
+ > Folders organize a view's measures and dimensions into logical groups. Use folders to structure large views so consumers can navigate fields by category instead of a flat list.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # views.includes
1
+ # View Includes
2
2
 
3
- > Control which cube members appear in a view.
3
+ > The includes and excludes properties control which cube members appear in a view. Include everything from a cube and selectively exclude fields, or cherry-pick specific members.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,6 +1,6 @@
1
- # views
1
+ # Views
2
2
 
3
- > Compose cubes into focused interfaces for specific use cases.
3
+ > Views compose measures and dimensions from multiple cubes into focused, consumer-friendly interfaces. Use views to expose curated data to BI tools, AI agents, and applications.
4
4
 
5
5
  ## Overview
6
6
 
@@ -1,15 +1,33 @@
1
- # workflow.deploy
1
+ # Deploy
2
2
 
3
- > Push cubes and views to Bonnard for querying.
3
+ > Deploy your cubes and views to the Bonnard platform using the CLI. Once deployed, your semantic layer is queryable via the REST API, MCP for AI agents, and connected BI tools.
4
4
 
5
5
  ## Overview
6
6
 
7
- The `bon deploy` command uploads your cubes and views to Bonnard, making them available for querying via the API. It validates and tests connections before deploying.
7
+ The `bon deploy` command uploads your cubes and views to Bonnard, making them available for querying via the API. It validates and tests connections before deploying, and creates a versioned deployment with change detection.
8
8
 
9
9
  ## Usage
10
10
 
11
11
  ```bash
12
- bon deploy
12
+ bon deploy -m "description of changes"
13
+ ```
14
+
15
+ A `-m` message is **required** — it describes what changed in this deployment.
16
+
17
+ ### Flags
18
+
19
+ | Flag | Description |
20
+ |------|-------------|
21
+ | `-m "message"` | **Required.** Deployment description |
22
+ | `--ci` | Non-interactive mode (fails on missing datasources) |
23
+ | `--push-datasources` | Auto-push missing datasources to Bonnard |
24
+
25
+ ### CI/CD
26
+
27
+ For automated pipelines, combine `--ci` with `--push-datasources`:
28
+
29
+ ```bash
30
+ bon deploy --ci --push-datasources -m "CI deploy"
13
31
  ```
14
32
 
15
33
  ## Prerequisites
@@ -23,12 +41,13 @@ bon deploy
23
41
  1. **Validates** — checks cubes and views for errors
24
42
  2. **Tests connections** — verifies data source access
25
43
  3. **Uploads** — sends cubes and views to Bonnard
26
- 4. **Activates** — makes cubes and views available for queries
44
+ 4. **Detects changes** — compares against the previous deployment
45
+ 5. **Activates** — makes cubes and views available for queries
27
46
 
28
47
  ## Example Output
29
48
 
30
49
  ```
31
- bon deploy
50
+ bon deploy -m "Add revenue metrics"
32
51
 
33
52
  ✓ Validating...
34
53
  ✓ bonnard/cubes/orders.yaml
@@ -43,14 +62,55 @@ bon deploy
43
62
 
44
63
  ✓ Deploy complete!
45
64
 
46
- Your semantic layer is now available at:
47
- https://api.bonnard.dev/v1/your-org
65
+ Changes:
66
+ + orders.total_revenue (measure)
67
+ + orders.avg_order_value (measure)
68
+ ~ orders.count (measure) — type changed
69
+
70
+ ⚠ 1 breaking change detected
48
71
  ```
49
72
 
73
+ ## Change Detection
74
+
75
+ Every deployment is versioned. Bonnard automatically detects:
76
+
77
+ - **Added** — new cubes, views, measures, dimensions
78
+ - **Modified** — changes to type, SQL, format, description
79
+ - **Removed** — deleted fields (flagged as breaking)
80
+ - **Breaking changes** — removed measures/dimensions, type changes
81
+
82
+ ## Reviewing Deployments
83
+
84
+ After deploying, use these commands to review history and changes:
85
+
86
+ ### List deployments
87
+
88
+ ```bash
89
+ bon deployments # Recent deployments
90
+ bon deployments --all # Full history
91
+ ```
92
+
93
+ ### View changes in a deployment
94
+
95
+ ```bash
96
+ bon diff <deployment-id> # All changes
97
+ bon diff <deployment-id> --breaking # Breaking changes only
98
+ ```
99
+
100
+ ### Annotate changes
101
+
102
+ Add reasoning or context to deployment changes:
103
+
104
+ ```bash
105
+ bon annotate <deployment-id> --data '{"object": "note about why this changed"}'
106
+ ```
107
+
108
+ Annotations are visible in the schema catalog and help teammates understand why changes were made.
109
+
50
110
  ## Deploy Flow
51
111
 
52
112
  ```
53
- bon deploy
113
+ bon deploy -m "message"
54
114
 
55
115
  ├── 1. bon validate (must pass)
56
116
 
@@ -61,7 +121,9 @@ bon deploy
61
121
  │ - views from bonnard/views/
62
122
  │ - datasource configs
63
123
 
64
- └── 4. Activate deployment
124
+ ├── 4. Detect changes vs. previous deployment
125
+
126
+ └── 5. Activate deployment
65
127
  ```
66
128
 
67
129
  ## Error Handling
@@ -111,13 +173,16 @@ Run: bon login
111
173
  - **Replaces** previous deployment (not additive)
112
174
  - **All or nothing** — partial deploys don't happen
113
175
  - **Instant** — changes take effect immediately
176
+ - **Versioned** — every deployment is tracked with changes
114
177
 
115
178
  ## Best Practices
116
179
 
117
- 1. **Validate first** — run `bon validate` before deploy
118
- 2. **Test locally** — verify queries work before deploying
119
- 3. **Use version control** — commit cubes and views before deploying
120
- 4. **Monitor after deploy** — check for query errors
180
+ 1. **Always include a meaningful message** — helps teammates understand what changed
181
+ 2. **Validate first** — run `bon validate` before deploy
182
+ 3. **Test locally** — verify queries work before deploying
183
+ 4. **Use version control** — commit cubes and views before deploying
184
+ 5. **Review after deploy** — use `bon diff` to check for unintended breaking changes
185
+ 6. **Annotate breaking changes** — add context so consumers know what to update
121
186
 
122
187
  ## See Also
123
188