You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/developer/dashboards-as-code.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,11 @@ There are two main approaches to working with dashboards as code. You can mix an
16
16
|**Setup complexity**| Minimal — just the CLI | Requires CI/CD and space permissions |
17
17
|**Best for**| Quick edits, AI-assisted changes, ad-hoc updates | Regulated environments, multi-instance deployments, teams that want strict change control |
18
18
19
-
## Disposable editing (recommended)
19
+
###Disposable editing (recommended)
20
20
21
21
When using dashboards as code with AI agents or CLI tools, we recommend treating the downloaded files as **temporary working files** rather than a permanent source of truth. This is the best starting point for most teams.
22
22
23
-
### The disposable workflow
23
+
####The disposable workflow
24
24
25
25
1.**Download** the content you want to edit using `lightdash download`
26
26
2.**Make your changes** locally (manually or with AI assistance)
@@ -29,27 +29,27 @@ When using dashboards as code with AI agents or CLI tools, we recommend treating
29
29
30
30
This approach keeps the Lightdash application as your source of truth while still enabling powerful code-based editing workflows.
31
31
32
-
### Why disposable?
32
+
####Why disposable?
33
33
34
34
Treating dashboards as code as disposable config files provides flexibility:
35
35
36
36
-**UI changes remain easy** — team members can continue making updates directly in the Lightdash UI without needing to sync a codebase
37
37
-**No repository maintenance** — you avoid the overhead of keeping code files synchronized with UI changes
38
38
-**Best of both worlds** — you get the power of code-based editing and AI assistance without the rigidity of a code-first workflow
39
39
40
-
## Git-managed dashboards
40
+
###Git-managed dashboards
41
41
42
42
An alternative approach where your **Git repository is the single source of truth** for charts and dashboards. All changes flow through version control, and the UI is read-only for managed content.
43
43
44
-
### When to use this workflow
44
+
####When to use this workflow
45
45
46
46
- You want a full audit trail of every dashboard change via Git history
47
47
- You want to enforce review processes (pull requests, approvals) before changes reach production
48
48
- You're comfortable with all edits happening in code rather than the UI
49
49
- You want to validate dashboard changes in [preview environments](/guides/developer/preview-projects) before merging
50
50
- You're deploying the same content across multiple Lightdash instances
51
51
52
-
### Lock down the UI
52
+
####Lock down the UI
53
53
54
54
For this workflow to succeed, you need to prevent ad-hoc UI edits from drifting out of sync with your repository. Use **space permissions** to enforce this:
55
55
@@ -58,7 +58,7 @@ For this workflow to succeed, you need to prevent ad-hoc UI edits from drifting
58
58
59
59
You don't have to manage everything this way. Organize code-managed content into specific spaces with restricted permissions, and leave other spaces open for UI editing.
60
60
61
-
### Making changes
61
+
####Making changes
62
62
63
63
The typical workflow for editing Git-managed dashboards:
64
64
@@ -69,7 +69,7 @@ The typical workflow for editing Git-managed dashboards:
69
69
5.**Open a pull request** — once the changes look good in the preview, commit and open a PR for review
70
70
6.**Merge and deploy** — on merge to your main branch, a CI job runs `lightdash deploy` and `lightdash upload --force` to push changes to production
71
71
72
-
### CI/CD setup
72
+
####CI/CD setup
73
73
74
74
To fully automate this workflow, set up two CI jobs:
0 commit comments