Use dbt Copilot enterprise
Use dbt Copilot to generate documentation, tests, semantic models, and code from scratch, giving you the flexibility to modify or fix generated code.
This page explains how to use dbt Copilot to:
- Generate resources — Save time by using dbt Copilot’s generation button to generate documentation, tests, and semantic model files during your development in the dbt Cloud IDE.
- Generate and edit SQL inline — Use natural language prompts to generate SQL code from scratch or to edit existing SQL file by using keyboard shortcuts or highlighting code in the dbt Cloud IDE.
- Build visual modelsbeta — Use dbt Copilot to generate models in the Visual Editor with natural language prompts.
Generate resources
Generate documentation, tests, metrics, and semantic models resources with the click-of-a-button in the dbt Cloud IDE using dbt Copilot, saving you time. To access and use this AI feature:
- Navigate to the dbt Cloud IDE and select a SQL model file under the File Explorer.
- In the Console section (under the File Editor), click dbt Copilot to view the available AI options.
- Select the available options to generate the YAML config: Generate Documentation, Generate Tests, Generate Semantic Model, or Generate Metrics. To generate multiple YAML configs for the same model, click each option separately. dbt Copilot intelligently saves the YAML config in the same file.
- To generate metrics, you need to first have semantic models defined.
- Once defined, click dbt Copilot and select Generate Metrics.
- Write a prompt describing the metrics you want to generate and press enter.
- Accept or Reject the generated code.
- Verify the AI-generated code. You can update or fix the code as needed.
- Click Save As. You should see the file changes under the Version control section.
Generate and edit SQL inline
dbt Copilot also allows you to generate SQL code directly within the SQL file in the dbt Cloud IDE, using natural language prompts. This means you can rewrite or add specific portions of the SQL file without needing to edit the entire file.
This intelligent AI tool streamlines SQL development by reducing errors, scaling effortlessly with complexity, and saving valuable time. dbt Copilot's prompt window, accessible by keyboard shortcut, handles repetitive or complex SQL generation effortlessly so you can focus on high-level tasks.
Use Copilot's prompt window for use cases like:
- Writing advanced transformations
- Performing bulk edits efficiently
- Crafting complex patterns like regex
Use the prompt window
Access dbt Copilot's AI prompt window using the keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows) to:
1. Generate SQL from scratch
- Use the keyboard shortcuts Cmd+B (Mac) or Ctrl+B (Windows) to generate SQL from scratch.
- Enter your instructions to generate SQL code tailored to your needs using natural language.
- Ask dbt Copilot to fix the code or add a specific portion of the SQL file.
2. Edit existing SQL code
- Highlight a section of SQL code and press Cmd+B (Mac) or Ctrl+B (Windows) to open the prompt window for editing.
- Use this to refine or modify specific code snippets based on your needs.
- Ask dbt Copilot to fix the code or add a specific portion of the SQL file.
3. Review changes with the diff view to quickly assess the impact of the changes before making changes
- When a suggestion is generated, Copilot displays a visual "diff" view to help you compare the proposed changes with your existing code:
- Green: Means new code that will be added if you accept the suggestion.
- Red: Highlights existing code that will be removed or replaced by the suggested changes.
4. Accept or reject suggestions
- Accept: If the generated SQL meets your requirements, click the Accept button to apply the changes directly to your
.sql
file directly in the IDE. - Reject: If the suggestion don’t align with your request/prompt, click Reject to discard the generated SQL without making changes and start again.
5. Regenerate code
- To regenerate, press the Escape button on your keyboard (or click the Reject button in the popup). This will remove the generated code and puts your cursor back into the prompt text area.
- Update your prompt and press Enter to try another generation. Press Escape again to close the popover entirely.
Once you've accepted a suggestion, you can continue to use the prompt window to generate additional SQL code and commit your changes to the branch.

Build visual models beta
Building visual models in the Visual Editor is currently in private beta for dbt Cloud Enterprise accounts. To join the private beta, register your interest or reach out to your account team to begin this process.
dbt Copilot seamlessly integrates with the Visual Editor, a drag-and-drop experience that helps you build your visual models using natural language prompts. Before you begin, make sure you can access the Visual Editor.
To begin building models with natural language prompts in the Visual Editor:
- Click on the dbt Copilot icon in Visual Editor menu.
- In the dbt Copilot prompt box, enter your prompt in natural language for dbt Copilot to build the model(s) you want. You can also reference existing models using the
@
symbol. For example, to build a model that calculates the total price of orders, you can enter@orders
in the prompt and it'll pull in and reference theorders
model. - Click Generate and dbt Copilot generates a summary of the model(s) you want to build.
- To start over, click on the + icon. To close the prompt box, click X.
- Click Apply to generate the model(s) in the Visual Editor.
- dbt Copilot displays a visual "diff" view to help you compare the proposed changes with your existing code. Review the diff view in the canvas to see the generated operators built by dbt Copilot:
- White: Located in the top of the canvas and means existing set up or blank canvas that will be removed or replaced by the suggested changes.
- Green: Located in the bottom of the canvas and means new code that will be added if you accept the suggestion.
- Reject or accept the suggestions
- In the generated operator box, click the play icon to preview the data
- Confirm the results or continue building your model.
- To edit the generated model, open dbt Copilot prompt box and type your edits.
- Click Submit and dbt Copilot will generate the revised model. Repeat steps 5-8 until you're happy with the model.