Recommended workflow: temporary files
When using agents to edit dashboards, treat the downloaded YAML files as temporary working files rather than source-of-truth files you commit to your repository. The workflow is:- Download the content you want to change using
lightdash download - Edit the YAML files using your AI agent
- Upload the changes back to Lightdash using
lightdash upload - Discard the local files instead of committing them
Why this approach?
This workflow keeps Lightdash as the source of truth for your dashboards and charts. The benefits include:- UI changes remain easy β Team members can continue making changes directly in the Lightdash UI without worrying about keeping a codebase in sync
- No repository maintenance β You donβt need to maintain dashboard YAML files alongside your dbt project
- Flexibility β Different team members can use whichever editing method works best for them (UI or code)
When to commit dashboard code
While the temporary file workflow is recommended for most teams, there are situations where committing dashboard code makes sense:- Version-controlled templates β When you want to maintain reusable dashboard templates across projects
- CI/CD pipelines β When dashboards are deployed as part of an automated workflow
- Strict change management β When all changes must go through code review
Setting up your agent
To use AI agents effectively with dashboards as code:- Install Lightdash skills for your coding agent
- Connect your agent to the Lightdash MCP for semantic layer access
- Ensure the Lightdash CLI is installed and authenticated
Example prompts
Once set up, you can prompt your agent to make changes like:Next steps
- Dashboards as code reference β Full reference for the download and upload commands
- Agent skills β Install skills to help your agent understand Lightdash
- Lightdash MCP β Connect your agent to the semantic layer