@@ -4,14 +4,7 @@ Configuration is built around three core concepts:
4
4
5
5
- ** Document** : The primary output unit produced by the generator - a complete, formatted context file to share with
6
6
LLMs
7
- - ** Source** : Where content is collected from
8
- - Files,
9
- - GitHub,
10
- - URLs,
11
- - Text,
12
- - Tree,
13
- - Composer package
14
- - or Git diffs
7
+ - ** Source** : Where content is collected from Files, GitHub, Gitlab, URLs, Text, Tree, Composer package MCP or Git diffs
15
8
- ** Modifiers** : Transform source content before inclusion - clean up, simplify, or enhance raw content
16
9
- ** Imports** : Include and merge configuration from external files to enable modular configuration management
17
10
@@ -161,11 +154,80 @@ import:
161
154
url: https://example.com/shared-config.json
162
155
` ` `
163
156
157
+ # ## Local File Imports
158
+
159
+ The local import type allows importing configuration from files on the local filesystem.
160
+
161
+ | Parameter | Description | Required | Default |
162
+ |--------------|---------------------------------------------------|----------|---------|
163
+ | `path` | Path to the local configuration file | Yes | - |
164
+ | `pathPrefix` | Prefix to apply to all paths in the configuration | No | - |
165
+ | `docs` | List of document paths to selectively import | No | - |
166
+
167
+ # ### Selective Imports
168
+
169
+ You can selectively import specific documents by specifying their output paths :
170
+
171
+ ` ` ` yaml
172
+ import:
173
+ - path: services/common/context.yaml
174
+ docs:
175
+ - "api/*.md" # Import all API docs
176
+ - "docs/core.md" # Import a specific document
177
+ ` ` `
178
+
179
+ # ### Wildcard Imports
180
+
181
+ You can use wildcards to import multiple configuration files at once :
182
+
183
+ ` ` ` yaml
184
+ import:
185
+ - path: "services/*/context.yaml" # Import from all service directories
186
+ - path: "modules/**/*.yaml" # Import all YAML files in modules and subdirectories
187
+ ` ` `
188
+
189
+ Wildcard patterns support :
190
+
191
+ - ` *` - Match any characters except directory separators
192
+ - ` **` - Match any characters including directory separators
193
+ - ` ?` - Match a single character
194
+ - ` [abc]` - Match any character in the set
195
+ - ` {a,b,c}` - Match any of the comma-separated patterns
196
+
197
+ # ## URL Imports
198
+
199
+ The URL import type allows importing configuration from remote URLs.
200
+
201
+ | Parameter | Description | Required | Default |
202
+ |-----------|----------------------------------------|----------|---------|
203
+ | `url` | URL to fetch the configuration from | Yes | - |
204
+ | `ttl` | Cache time-to-live in seconds | No | 300 |
205
+ | `headers` | HTTP headers to include in the request | No | {} |
206
+
207
+ URL imports support both JSON and YAML formats, automatically detected from the Content-Type header or file extension.
208
+
209
+ # ### URL Import Example
210
+
211
+ ` ` ` yaml
212
+ import:
213
+ - type: url
214
+ url: https://example.com/shared-config.json
215
+ ttl: 600 # Cache time-to-live in seconds (default: 300)
216
+ headers: # Optional HTTP headers for the request
217
+ Authorization: "Bearer {{TOKEN}}"
218
+ Accept: "application/json"
219
+ ` ` `
220
+
164
221
# ## Example in YAML
165
222
223
+ This example imports configurations from both local files and a URL :
224
+
166
225
` ` ` yaml
167
226
import:
168
227
- path: services/api/context.yaml
228
+ pathPrefix: /api
229
+ - type: url
230
+ url: https://example.com/shared-configs.json
169
231
170
232
documents:
171
233
- description: Project Overview
@@ -176,10 +238,16 @@ documents:
176
238
# Project Documentation
177
239
178
240
This is the main project documentation.
241
+ - type: file
242
+ description: Project README
243
+ sourcePaths:
244
+ - README.md
179
245
` ` `
180
246
181
247
# ## Example in JSON
182
248
249
+ The same configuration in JSON format :
250
+
183
251
` ` ` json
184
252
{
185
253
"import": [
@@ -188,6 +256,18 @@ documents:
188
256
}
189
257
],
190
258
"documents": [
259
+ {
260
+ "description": "Common Components",
261
+ "outputPath": "docs/components.md",
262
+ "sources": [
263
+ {
264
+ "type": "file",
265
+ "sourcePaths": [
266
+ "src/Components"
267
+ ]
268
+ }
269
+ ]
270
+ },
191
271
{
192
272
"description": "Project Overview",
193
273
"outputPath": "docs/overview.md",
@@ -202,12 +282,20 @@ documents:
202
282
}
203
283
` ` `
204
284
205
- # ## Import Types
285
+ # ## Circular Import Detection
286
+
287
+ The system automatically detects and prevents circular imports. If a circular import is detected, an error will be
288
+ thrown with information about the import chain that created the circular dependency.
289
+
290
+ # ## Import Resolution Process
291
+
292
+ When a configuration file is processed :
206
293
207
- | Type | Description | Required Fields |
208
- |--------|-------------------------------------------------------------|-----------------|
209
- | `file` | Imports configuration from a local file | `path` |
210
- | `url` | Imports configuration (`prompts` section) from a remote URL | `url` |
294
+ 1. All imports are processed before the main configuration
295
+ 2. Nested imports are resolved recursively
296
+ 3. Path prefixes are applied to document output paths and source paths
297
+ 4. The resolved configuration is merged with the original configuration
298
+ 5. Document sections are combined (not replaced)
211
299
212
300
# # Using variables in configuration
213
301
0 commit comments