Skip to content

Commit 2e01d3b

Browse files
authored
Merge pull request #1690 from bruin-data/cursor/core-concepts-docs-structure-4c27
Core concepts docs structure
2 parents 94ebe21 + 040cfaf commit 2e01d3b

File tree

32 files changed

+1482
-48
lines changed

32 files changed

+1482
-48
lines changed

docs/.vitepress/config.mjs

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,36 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
8383
],
8484
},
8585
{
86-
text: "Features",
87-
link: "/getting-started/features",
86+
text: "Core Concepts",
87+
link: "/core-concepts/overview",
8888
items: [
89-
{text: "Pipeline", link: "/getting-started/pipeline"},
90-
{text: "Glossary", link: "/getting-started/glossary"},
91-
{text: "Policies", link: "/getting-started/policies"},
92-
{text: "Environments", link: "/getting-started/devenv"},
93-
{text: "Variables", link: "/getting-started/pipeline-variables"},
94-
{text: "Concurrency", link: "/getting-started/concurrency"},
95-
{text: "Bruin MCP", link: "/getting-started/bruin-mcp"},
96-
{text: "Lakehouse Support", link: "/getting-started/lakehouse"},
97-
]
89+
{
90+
text: "Environments",
91+
link: "/core-concepts/environments",
92+
items: [
93+
{text: "Connections", link: "/core-concepts/connections"},
94+
{text: "Secrets", link: "/core-concepts/secrets"},
95+
],
96+
},
97+
{text: "Pipeline", link: "/pipelines/definition"},
98+
{text: "Asset", link: "/assets/definition-schema"},
99+
{
100+
text: "Variables",
101+
link: "/core-concepts/variables",
102+
items: [
103+
{text: "Built-in Variables", link: "/core-concepts/variables#built-in-variables"},
104+
{text: "Custom Variables", link: "/core-concepts/variables#custom-variables"},
105+
],
106+
},
107+
{text: "Commands", link: "/commands/overview"},
108+
],
98109
},
99-
{text: "Concepts", link: "/getting-started/concepts"},
100110
{text: "Design Principles", link: "/getting-started/design-principles"},
111+
{text: "Glossary", link: "/getting-started/glossary"},
112+
{text: "Policies", link: "/getting-started/policies"},
113+
{text: "Concurrency", link: "/getting-started/concurrency"},
114+
{text: "Bruin MCP", link: "/getting-started/bruin-mcp"},
115+
{text: "Lakehouse Support", link: "/getting-started/lakehouse"},
101116

102117
{
103118
text: "Templates",
@@ -180,6 +195,16 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
180195
{text: "GCP Dataproc Serverless", link: "/platforms/dataproc_serverless"},
181196
],
182197
},
198+
{
199+
text: "Pipelines",
200+
collapsed: false,
201+
items: [
202+
{text: "Definition", link: "/pipelines/definition"},
203+
{text: "Scheduling", link: "/pipelines/definition#schedule"},
204+
{text: "Default Connections", link: "/pipelines/definition#default-connections"},
205+
{text: "Pipeline Defaults", link: "/pipelines/definition#default-pipeline-level-defaults"},
206+
],
207+
},
183208
{
184209
text: "Assets",
185210
collapsed: false,
@@ -199,7 +224,6 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
199224
]
200225
},
201226
{text: "Columns", link: "/assets/columns"},
202-
{text: "Credentials", link: "/getting-started/credentials"},
203227
{text: "Interval Modifiers", link: "/assets/interval-modifiers"},
204228
{text: "Materialization", link: "/assets/materialization"},
205229
{
@@ -363,9 +387,12 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
363387
},
364388
{
365389
text: "Commands",
390+
link: "/commands/overview",
366391
collapsed: false,
367392
items: [
368-
{text: "AI Enhance", link: "/commands/ai-enhance"},
393+
{text: "Overview", link: "/commands/overview"},
394+
{text: "Run", link: "/commands/run"},
395+
{text: "Validate", link: "/commands/validate"},
369396
{text: "Init", link: "/commands/init"},
370397
{text: "Clean", link: "/commands/clean"},
371398
{text: "Connections", link: "/commands/connections"},
@@ -376,9 +403,8 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
376403
{text: "Lineage", link: "/commands/lineage"},
377404
{text: "Patch", link: "/commands/patch"},
378405
{text: "Render", link: "/commands/render"},
379-
{text: "Run", link: "/commands/run"},
380406
{text: "Query", link: "/commands/query"},
381-
{text: "Validate", link: "/commands/validate"},
407+
{text: "AI Enhance", link: "/commands/ai-enhance"},
382408
],
383409

384410
},

docs/assets/definition-schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ hooks:
179179

180180
Hooks are currently supported for SQL assets. Each hook entry supports a single `query` field and is executed in order. Queries may have a trailing `;` or not.
181181

182-
Hooks can also be set as pipeline defaults (see [pipeline defaults](/getting-started/pipeline#default-pipeline-level-defaults)). Assets inherit default `pre` and `post` hooks independently - defining only `pre` hooks on an asset will still inherit default `post` hooks.
182+
Hooks can also be set as pipeline defaults (see [pipeline defaults](/pipelines/definition#default-pipeline-level-defaults)). Assets inherit default `pre` and `post` hooks independently - defining only `pre` hooks on an asset will still inherit default `post` hooks.
183183

184184
- **Type:** `Object`
185185

docs/assets/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ The following environment variables are available in every Python asset executio
156156

157157
### Pipeline
158158

159-
Bruin supports user-defined variables at a pipeline level. These become available as a JSON document in your python asset as `BRUIN_VARS`. When no variables exist, `BRUIN_VARS` is set to `{}`. See [pipeline variables](/getting-started/pipeline-variables) for more information on how to define and override them, including the [full list of JSON Schema `type` options and complementary keywords](/getting-started/pipeline-variables#supported-json-schema-keywords).
159+
Bruin supports user-defined variables at a pipeline level. These become available as a JSON document in your python asset as `BRUIN_VARS`. When no variables exist, `BRUIN_VARS` is set to `{}`. See [Variables](/core-concepts/variables) for more information on how to define and override them, including the [full list of JSON Schema `type` options and complementary keywords](/core-concepts/variables#custom-variables).
160160

161161
Here's a short example:
162162
::: code-group

docs/assets/r.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ The following environment variables are available in every R asset execution:
173173

174174
### Pipeline
175175

176-
Bruin supports user-defined variables at a pipeline level. These become available as a JSON document in your R asset as `BRUIN_VARS`. When no variables exist, `BRUIN_VARS` is set to `{}`. See [pipeline variables](/getting-started/pipeline-variables) for more information on how to define and override them.
176+
Bruin supports user-defined variables at a pipeline level. These become available as a JSON document in your R asset as `BRUIN_VARS`. When no variables exist, `BRUIN_VARS` is set to `{}`. See [Variables](/core-concepts/variables) for more information on how to define and override them.
177177

178178
Here's an example:
179179

docs/assets/templating/macros.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ AND region = '{{ region }}'
465465
:::
466466

467467
> [!TIP]
468-
> The pipeline snippet above showcases array enums and numeric bounds. For additional JSON Schema keywords you can mix into macros-driven workflows—including nested objects and nullable values—refer to the [pipeline variables keyword reference](/getting-started/pipeline-variables#supported-json-schema-keywords).
468+
> The pipeline snippet above showcases array enums and numeric bounds. For additional JSON Schema keywords you can mix into macros-driven workflows—including nested objects and nullable values—refer to the [Variables keyword reference](/core-concepts/variables#custom-variables).
469469

470470
### Dynamic Column Generation
471471

@@ -715,5 +715,5 @@ SELECT 1
715715

716716
- [Templating](./templating.md) - Learn about Jinja templating basics
717717
- [Filters](./filters.md) - Use filters to transform variables
718-
- [Pipeline Variables](/getting-started/pipeline-variables) - Define custom variables
718+
- [Variables](/core-concepts/variables) - Define custom variables
719719
- [SQL Assets](../sql.md) - Learn about SQL assets in Bruin

docs/assets/templating/templating.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ GROUP BY 1,2
4040
:::
4141

4242
> [!TIP]
43-
> Need enumerations, numeric bounds, or nested structures for your variables? Consult the [JSON Schema keyword reference](/getting-started/pipeline-variables#supported-json-schema-keywords) for the full list of `type` values and examples of arrays-of-objects and object-of-arrays patterns you can reuse in templated SQL.
43+
> Need enumerations, numeric bounds, or nested structures for your variables? Consult the [Variables documentation](/core-concepts/variables#custom-variables) for the full list of `type` values and examples of arrays-of-objects and object-of-arrays patterns you can reuse in templated SQL.
4444

4545
This will render into the following SQL query:
4646

@@ -76,7 +76,7 @@ Bruin injects various variables by default:
7676
| `execution_datetime` | The execution date and time in YYYY-MM-DDThh:mm:ss format | "2023-12-01T15:30:00" |
7777
| `execution_timestamp` | The execution timestamp in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) format | "2023-12-01T15:30:00.000000Z07:00" |
7878
| `pipeline` | The name of the currently executing pipeline | `my_pipeline` |
79-
| `run_id` | The unique identifier for the current [pipeline run](../../getting-started/concepts.md#pipeline-run) | `run_1234567890` |
79+
| `run_id` | The unique identifier for the current pipeline run | `run_1234567890` |
8080
| `full_refresh` | Boolean indicating whether the `--full-refresh` flag was used | `True` or `False` |
8181

8282
You can use these variables in your SQL queries by referencing them with the `{{ }}` syntax:
@@ -182,4 +182,4 @@ You can read more about [Jinja conditionals](https://jinja.palletsprojects.com/e
182182

183183
## Custom variables
184184

185-
You can define your own variables and use them across your Assets. See [variables](/getting-started/pipeline-variables) for more information.
185+
You can define your own variables and use them across your Assets. See [Variables](/core-concepts/variables) for more information.

docs/commands/connections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bruin connections add --env someother --type generic --name MY_SECRET --credenti
4747

4848
This will add the connection to the `.bruin.yml` file and the connection will be available in the given environment.
4949

50-
The parameter after `--credentials` is the value of the connection in JSON format, as you would write it in the `.bruin.yml` file. For further reference, you can check the [Connections section](../getting-started/concepts.md#connection) of the documentation.
50+
The parameter after `--credentials` is the value of the connection in JSON format, as you would write it in the `.bruin.yml` file. For further reference, you can check the [Connections](/core-concepts/connections) documentation.
5151

5252
### Flags
5353

docs/commands/overview.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Commands Overview
2+
3+
Bruin provides a comprehensive CLI for managing your data pipelines. Commands can be executed in multiple ways:
4+
5+
- **Terminal**: Direct CLI usage via `bruin <command>`
6+
- **VS Code Extension**: Visual interface with integrated command execution
7+
- **AI Agents**: Programmatic access via [Bruin MCP](/getting-started/bruin-mcp)
8+
9+
## Getting Help
10+
11+
```bash
12+
# List all available commands
13+
bruin --help
14+
15+
# Get help for a specific command
16+
bruin run --help
17+
bruin validate --help
18+
```
19+
20+
## Command Reference
21+
22+
### Pipeline Execution
23+
24+
| Command | Description |
25+
|---------|-------------|
26+
| [`run`](/commands/run) | Execute pipelines or individual assets |
27+
| [`validate`](/commands/validate) | Check pipeline configuration and syntax without executing |
28+
29+
### Project Management
30+
31+
| Command | Description |
32+
|---------|-------------|
33+
| [`init`](/commands/init) | Create a new Bruin project from a template |
34+
| [`clean`](/commands/clean) | Remove temporary files and build artifacts |
35+
| [`format`](/commands/format) | Format asset files for consistency |
36+
37+
### Connections & Environments
38+
39+
| Command | Description |
40+
|---------|-------------|
41+
| [`connections`](/commands/connections) | List, add, delete, and test connections |
42+
| [`environments`](/commands/environments) | Manage deployment environments |
43+
44+
### Development & Debugging
45+
46+
| Command | Description |
47+
|---------|-------------|
48+
| [`render`](/commands/render) | Preview rendered Jinja templates |
49+
| [`lineage`](/commands/lineage) | Visualize asset dependencies |
50+
| [`query`](/commands/query) | Execute ad-hoc queries against connections |
51+
| [`data-diff`](/commands/data-diff) | Compare data between connections |
52+
53+
### Asset Operations
54+
55+
| Command | Description |
56+
|---------|-------------|
57+
| [`import`](/commands/import) | Import existing database tables as Bruin assets |
58+
| [`patch`](/commands/patch) | Apply patches to asset definitions |
59+
| [`ai-enhance`](/commands/ai-enhance) | Enhance asset metadata using AI |
60+
61+
## Common Workflows
62+
63+
### Running a Pipeline
64+
65+
```bash
66+
# Run the pipeline in the current directory
67+
bruin run
68+
69+
# Run a specific pipeline
70+
bruin run ./pipelines/analytics/
71+
72+
# Run a specific asset
73+
bruin run ./pipelines/analytics/assets/daily_summary.sql
74+
75+
# Run with a specific environment
76+
bruin run --environment production
77+
78+
# Run for a specific date range
79+
bruin run --start-date 2024-01-01 --end-date 2024-01-31
80+
```
81+
82+
### Validating Before Running
83+
84+
```bash
85+
# Validate pipeline syntax and configuration
86+
bruin validate
87+
88+
# Validate a specific pipeline
89+
bruin validate ./pipelines/analytics/
90+
```
91+
92+
### Creating a New Project
93+
94+
```bash
95+
# Initialize with the default template
96+
bruin init default my-project
97+
98+
# Initialize with a specific template
99+
bruin init chess my-chess-project
100+
```
101+
102+
### Testing Connections
103+
104+
```bash
105+
# List all configured connections
106+
bruin connections list
107+
108+
# Test a specific connection
109+
bruin connections ping my-postgres-connection
110+
```
111+
112+
### Debugging Templates
113+
114+
```bash
115+
# Render a SQL asset to see the final query
116+
bruin render ./assets/my_query.sql
117+
118+
# Render with specific date parameters
119+
bruin render ./assets/my_query.sql --start-date 2024-01-01 --end-date 2024-01-02
120+
```
121+
122+
## Global Flags
123+
124+
These flags work with most commands:
125+
126+
| Flag | Description |
127+
|------|-------------|
128+
| `--debug` | Enable debug logging |
129+
| `--environment` | Specify the environment to use |
130+
| `--config-file` | Path to a custom `.bruin.yml` file |
131+
| `--help` | Show help for the command |
132+
133+
## VS Code Extension
134+
135+
The [Bruin VS Code Extension](/vscode-extension/overview) provides a visual interface for many CLI commands:
136+
137+
- Run pipelines and assets with a single click
138+
- View real-time execution logs
139+
- Explore asset lineage graphically
140+
- Preview rendered queries
141+
142+
## Bruin MCP (AI Agent Integration)
143+
144+
[Bruin MCP](/getting-started/bruin-mcp) enables AI agents and tools to interact with Bruin programmatically. This allows:
145+
146+
- Natural language pipeline execution
147+
- Automated pipeline management
148+
- Integration with AI-powered development workflows
149+
150+
## Related Topics
151+
152+
- [Run Command](/commands/run) - Detailed execution options
153+
- [Validate Command](/commands/validate) - Pipeline validation
154+
- [VS Code Extension](/vscode-extension/overview) - Visual interface
155+
- [Bruin MCP](/getting-started/bruin-mcp) - AI agent integration

docs/commands/run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ table td:first-child {
5555
| `--no-timestamp` | bool | `false` | Skip logging timestamps for this run. |
5656
| `--no-color` | bool | `false` | Plain log output for this run. |
5757
| `--minimal-logs` | bool | `false` | Skip initial pipeline analysis logs for this run. |
58-
| `--var` | []str | - | Override pipeline [variables](/getting-started/pipeline-variables.md) with custom values. |
58+
| `--var` | []str | - | Override pipeline [variables](/core-concepts/variables) with custom values. |
5959
| `--query-annotations` | str | - | Add annotations to SQL queries as comments. Use `default` to add asset name, pipeline name, and execution step, or provide custom JSON for additional fields. **BigQuery only.** |
6060

6161
### Continue from the last failed asset

0 commit comments

Comments
 (0)