|
| 1 | +# Configurations |
| 2 | + |
| 3 | +Customize DAIV for your repository using a `.daiv.yml` file. |
| 4 | + |
| 5 | +This file lets you control features, code formatting, and more. |
| 6 | + |
| 7 | +## Example Configuration |
| 8 | + |
| 9 | +Below is a complete example of a `.daiv.yml` file. |
| 10 | + |
| 11 | +You can copy and modify this template for your repository. |
| 12 | + |
| 13 | +```yaml |
| 14 | +# Repository settings |
| 15 | +default_branch: main |
| 16 | +repository_description: "Python web application using Django and React. Follows PEP 8 standards and the Airbnb style guide for JavaScript." |
| 17 | +branch_name_convention: "Use 'feat/' for features, 'fix/' for bugfixes, 'docs/' for documentation" |
| 18 | + |
| 19 | +# Feature toggles |
| 20 | +features: |
| 21 | + auto_address_review_enabled: true |
| 22 | + auto_address_issues_enabled: true |
| 23 | + autofix_pipeline_enabled: true |
| 24 | + |
| 25 | +# Code management |
| 26 | +extend_exclude_patterns: |
| 27 | + - "**/tests/**" |
| 28 | + - "**/*.test.ts" |
| 29 | + - "coverage/**" |
| 30 | + - "*.min.js" |
| 31 | + |
| 32 | +# Sandbox commands |
| 33 | +commands: |
| 34 | + base_image: "python:3.12-alpine" |
| 35 | + install_dependencies: "pip install -r requirements.txt" |
| 36 | + format_code: "ruff check --fix && ruff format" |
| 37 | +``` |
| 38 | +
|
| 39 | +## Configure Repository Settings |
| 40 | +
|
| 41 | +Repository settings control the default branch, repository description, and branch naming convention. |
| 42 | +
|
| 43 | +| Option | Type | Default | Description | |
| 44 | +|--------------------------|--------|------------------------|-----------------------------------------------------------------------------| |
| 45 | +| `default_branch` | `str | null` | Repository default branch | The branch DAIV uses by default to load the `.daiv.yml` file. | |
| 46 | +| `repository_description` | `str` | `""` | A brief description to help agents understand your repository. Max 400 chars. | |
| 47 | +| `branch_name_convention` | `str` | `"always start with 'daiv/' followed by a short description."` | Naming convention for generating pull request branches. | |
| 48 | + |
| 49 | +!!! tip |
| 50 | + - Use clear and simple branch-naming conventions. |
| 51 | + - Keep descriptions concise and informative. |
| 52 | + |
| 53 | + |
| 54 | +## Enable or Disable Features |
| 55 | + |
| 56 | +Control which DAIV features are active in your repository. |
| 57 | + |
| 58 | +Under your `.daiv.yml` file's `features:` section, configure the following keys: |
| 59 | + |
| 60 | +| Feature | Type | Default | Description | |
| 61 | +|-----------------------------------|---------|---------|------------------------------------------------------------------| |
| 62 | +| `auto_address_review_enabled` | `bool` | `true` | Enable the [code review addressor agent](ai-agents/code-review-addressor.md). | |
| 63 | +| `auto_address_issues_enabled` | `bool` | `true` | Enable the [issue addressor agent](ai-agents/issue-addressor.md). | |
| 64 | +| `autofix_pipeline_enabled` | `bool` | `true` | Enable the [pipeline fixing agent](ai-agents/pipeline-fixing.md). | |
| 65 | + |
| 66 | +!!! tip |
| 67 | + Disable features you do not need to reduce noise and speed up processing. |
| 68 | + |
| 69 | +## Customize Code Indexing |
| 70 | + |
| 71 | +Control which files DAIV indexes for context. |
| 72 | + |
| 73 | +!!! warning |
| 74 | + Files excluded from indexing will not be available to DAIV's AI agents. |
| 75 | + |
| 76 | +| Option | Type | Default | Description | |
| 77 | +|--------------------------|---------|------------------------|-----------------------------------------------------------------------------| |
| 78 | +| `extend_exclude_patterns` | `list[str]` | `[]` | Add patterns to exclude more files from indexing. | |
| 79 | +| `exclude_patterns` | `list[str]` | `["*package-lock.json", "*.lock", "*.svg", "*.pyc", "*.log", "*.zip", "*.coverage", "*.sql", "**/.git/**", "**/.mypy_cache/**", "**/.tox/**", "**/vendor/**", "**/venv/**", "**/.venv/**", "**/.env/**", "**/node_modules/**", "**/dist/**", "**/__pycache__/**", "**/data/**", "**/.idea/**", "**/.pytest_cache/**", "**/.ruff_cache/**"]` | Override the default exclude patterns. | |
| 80 | + |
| 81 | +!!! tip |
| 82 | + Exclude sensitive files and build artifacts. |
| 83 | + Prefer using `extend_exclude_patterns` to add more patterns. |
| 84 | + |
| 85 | +## Set Up Sandbox Commands |
| 86 | + |
| 87 | +To use sandbox commands, you must have a `daiv-sandbox` instance running (see the [daiv-sandbox](https://github.com/srtab/daiv-sandbox) repository for more information), and **all three options below (`base_image`, `install_dependencies`, and `format_code`) must be set**. |
| 88 | + |
| 89 | +Under your `.daiv.yml` file's `commands:` section, configure the following keys: |
| 90 | + |
| 91 | +| Option | Type | Default | Description | |
| 92 | +|-----------------------|--------|---------|-----------------------------------------------------------| |
| 93 | +| `base_image` | `str` | `null` | Docker image for the sandbox. Use distro images only. | |
| 94 | +| `install_dependencies`| `str` | `null` | Command to install project dependencies. | |
| 95 | +| `format_code` | `str` | `null` | Command to format code before committing. | |
| 96 | + |
| 97 | +**Here's how it works:** |
| 98 | + |
| 99 | +Before **committing code generated by DAIV**, DAIV will call `daiv-sandbox` to: |
| 100 | + |
| 101 | + - Create a container from the `base_image`. |
| 102 | + - Execute the `install_dependencies` command in the container. |
| 103 | + - Execute the `format_code` command in the container after the `install_dependencies` command executed successfully. |
| 104 | + |
| 105 | +!!! warning |
| 106 | + If any of the commands fail, DAIV will commit the code as is to be manually fixed, if needed. |
| 107 | + |
| 108 | +!!! tip |
| 109 | + Use specific image versions for reproducibility. |
0 commit comments