Title: Add deep merge support for array fields in .cecli.conf.yml · Issue #604 · cecli-dev/cecli · GitHub
Open Graph Title: Add deep merge support for array fields in .cecli.conf.yml · Issue #604 · cecli-dev/cecli
X Title: Add deep merge support for array fields in .cecli.conf.yml · Issue #604 · cecli-dev/cecli
Description: Feature Request Add support for array fields in configuration files with different merge behaviors: .cecli.conf.yml: Deep merge on array fields (merge entries into existing arrays) .cecli/conf.yml: Shallow merge (existing behavior - repl...
Open Graph Description: Feature Request Add support for array fields in configuration files with different merge behaviors: .cecli.conf.yml: Deep merge on array fields (merge entries into existing arrays) .cecli/conf.yml:...
X Description: Feature Request Add support for array fields in configuration files with different merge behaviors: .cecli.conf.yml: Deep merge on array fields (merge entries into existing arrays) .cecli/conf.yml:...
Opengraph URL: https://github.com/cecli-dev/cecli/issues/604
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add deep merge support for array fields in .cecli.conf.yml","articleBody":"## Feature Request\n\nAdd support for array fields in configuration files with different merge behaviors:\n- **`.cecli.conf.yml`**: Deep merge on array fields (merge entries into existing arrays)\n- **`.cecli/conf.yml`**: Shallow merge (existing behavior - replaces entire arrays)\n\n### Current Behavior\nBoth `.cecli.conf.yml` and `.cecli/conf.yml` perform shallow merges on array fields, meaning that when an array is specified in a config file, it completely replaces the existing array values rather than merging with them.\n\n### Problem\nUsers cannot additively extend configuration arrays (like `read`, `rules`, `skills_paths`, `mcp-servers-files`, `subagents_paths`, `tools_paths`, etc.) without completely overriding the defaults. This makes it difficult to incrementally add configuration entries.\n\n### Example Use Case\nIf the default configuration includes:\n```yaml\nread:\n - \"src/**/*.py\"\n - \"tests/**/*.py\"\n```\n\nA user who wants to add `docs/**/*.md` must currently specify ALL files:\n```yaml\nread:\n - \"src/**/*.py\"\n - \"tests/**/*.py\"\n - \"docs/**/*.md\" # Must remember to include defaults\n```\n\nWith deep merge, they could simply add:\n```yaml\nread:\n - \"docs/**/*.md\" # Automatically merged with defaults\n```\n\n### Proposed Solution\n\n1. **Configuration Hierarchy**: Maintain existing hierarchy where `.cecli.conf.yml` (in project root) has higher precedence than `.cecli/conf.yml` (in `.cecli` directory).\n\n2. **Merge Behavior**:\n - `.cecli.conf.yml`: Perform **deep merge** on array fields. New entries are appended/merged with existing values rather than replacing them.\n - `.cecli/conf.yml`: Maintain **shallow merge** (current behavior) for backward compatibility.\n\n3. **Array Field Detection**: Identify which configuration fields are arrays that should support deep merging:\n - `read`\n - `rules`\n - `skills_paths`\n - `mcp-servers-files`\n - `subagents_paths`\n - `tools_paths`\n - Other array fields as needed\n\n4. **Implementation Strategy**:\n - Modify the configuration loading/merging logic to detect the config file type.\n - For `.cecli.conf.yml`, use a deep merge algorithm for arrays (append unique entries, preserve order).\n - For `.cecli/conf.yml`, continue using shallow merge (replace).\n - Ensure backward compatibility: existing configs continue to work unchanged.\n\n5. **Deduplication**: When deep merging arrays, deduplicate entries based on value to avoid duplicates.\n\n### Technical Considerations\n\n- **Order Preservation**: Deep merge should append new entries to the end of existing arrays, maintaining the order of both existing and new items.\n- **Deduplication**: Use value-based deduplication (not object identity) to prevent duplicate entries.\n- **Nested Arrays**: Determine if nested arrays should also be deep-merged (likely yes, but need to define scope).\n- **Performance**: Deep merge should be efficient even with large configuration arrays.\n- **Error Handling**: Handle malformed YAML gracefully with clear error messages.\n\n### Acceptance Criteria\n\n- [ ] Identify all array configuration fields that need deep merge support.\n- [ ] Implement deep merge algorithm for arrays in `.cecli.conf.yml`.\n- [ ] Maintain shallow merge behavior for `.cecli/conf.yml`.\n- [ ] Ensure backward compatibility - existing configs work without changes.\n- [ ] Add comprehensive tests for:\n - Deep merge of arrays\n - Shallow merge preservation\n - Deduplication\n - Nested array handling\n - Error cases (malformed YAML, invalid arrays)\n- [ ] Update documentation to explain the new merge behavior and configuration options.\n- [ ] Add examples showing how to use the new feature.\n\n### Jira Task\n\nThis issue is aligned with Jira task [CLI-57](https://team-16702636586024.atlassian.net/browse/CLI-57).\n\n### Configuration File Precedence\n\nReminder of existing precedence (highest to lowest):\n1. Command-line arguments\n2. `.cecli.conf.yml` (project root) - **Will support deep merge on arrays**\n3. `.cecli/conf.yml` (in `.cecli` directory) - **Shallow merge (existing)**\n4. Default values","author":{"url":"https://github.com/szmania","@type":"Person","name":"szmania"},"datePublished":"2026-07-14T17:59:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/604/cecli/issues/604"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf7a13c9-1fb0-7cde-78db-7e751e4c0f8d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D678:145FC1:329FD03:48FB91C:6A60F19F |
| html-safe-nonce | 9f0c6fcccb8f6fd3f82dcd212af940ced7b9b5bca3f4778c83402491889e19dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjc4OjE0NUZDMTozMjlGRDAzOjQ4RkI5MUM6NkE2MEYxOUYiLCJ2aXNpdG9yX2lkIjoiMTEyMTAyODM0MTk3MTg3NDIwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 98482657ed6bcca872102e6f05aa210fe238eb158875f49a084bc64a844765c8 |
| hovercard-subject-tag | issue:4885727331 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cecli-dev/cecli/604/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d98515f1be51027d57c0ae8b3a2eee7410d95856f29080bb8f68ed492f471308/cecli-dev/cecli/issues/604 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d98515f1be51027d57c0ae8b3a2eee7410d95856f29080bb8f68ed492f471308/cecli-dev/cecli/issues/604 |
| og:image:alt | Feature Request Add support for array fields in configuration files with different merge behaviors: .cecli.conf.yml: Deep merge on array fields (merge entries into existing arrays) .cecli/conf.yml:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | szmania |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01a0f3379195d313175de239776b09dd4a079d5b2ea29dd9c37e85cd4cd5e990 |
| turbo-cache-control | no-preview |
| go-import | github.com/cecli-dev/cecli git https://github.com/cecli-dev/cecli.git |
| octolytics-dimension-user_id | 250452847 |
| octolytics-dimension-user_login | cecli-dev |
| octolytics-dimension-repository_id | 1030985330 |
| octolytics-dimension-repository_nwo | cecli-dev/cecli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 638629097 |
| octolytics-dimension-repository_parent_nwo | Aider-AI/aider |
| octolytics-dimension-repository_network_root_id | 638629097 |
| octolytics-dimension-repository_network_root_nwo | Aider-AI/aider |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 00ca1a9089c8f2453e5d118d0554c8a26883d159 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width