improve: support to customize the avanterules directories for project/global (#2392)

This commit is contained in:
guanghechen
2025-07-02 12:17:13 +08:00
committed by GitHub
parent d4f3224bf6
commit 30604304ba
4 changed files with 63 additions and 12 deletions

View File

@@ -1137,6 +1137,23 @@ The rules for root hierarchy:
- root pattern of filename of the current buffer
- root pattern of cwd
You can also configure custom directories for your `avanterules` files using the `rules` option:
```lua
require('avante').setup({
rules = {
project_dir = '.avante/rules', -- relative to project root, can also be an absolute path
global_dir = '~/.config/avante/rules', -- absolute path
},
})
```
The loading priority is as follows:
1. `rules.project_dir`
2. `rules.global_dir`
3. Project root
<details>
<summary>Example folder structure for custom prompt</summary>