Skip to content

Commit df8f3b2

Browse files
committed
Enhance documentation and configuration:
- Update variable placeholders in `variables.md` for consistency. - Add "Custom tools" section to the menu in `config.mts`. - Introduce `maxFiles` parameter in `file-source.md` for file processing limits. - Expand MCP server documentation in `mcp-server.md` with detailed setup instructions. - Add GitLab source documentation in `gitlab-source.md`. - Introduce MCP source documentation in `mcp-source.md`. - Revise tools documentation to reflect CTX updates in `tools.md`. - Improve command reference and version check instructions in `command-reference.md`. - Update prompts documentation with new features and examples in `prompts.md`.
1 parent cb141f7 commit df8f3b2

File tree

11 files changed

+1731
-419
lines changed

11 files changed

+1731
-419
lines changed

docs/.vitepress/config.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export default withMermaid({
4545
{text: 'Integration', link: '/mcp-server'},
4646
{text: 'Filesystem', link: '/mcp/filesystem'},
4747
{text: 'Prompts', link: '/mcp/prompts'},
48-
{text: 'Tools', link: '/mcp/tools'}
48+
{text: 'Tools', link: '/mcp/tools'},
49+
{text: 'Custom tools', link: '/mcp/custom-tools'}
4950
]
5051
},
5152
{
@@ -54,11 +55,13 @@ export default withMermaid({
5455
{text: 'Document Structure', link: '/documents'},
5556
{text: 'File Source', link: '/sources/file-source'},
5657
{text: 'GitHub Source', link: '/sources/github-source'},
58+
{text: 'GitLab Source', link: '/sources/gitlab-source'},
5759
{text: 'Git Diff Source', link: '/sources/git-diff-source'},
5860
{text: 'URL Source', link: '/sources/url-source'},
5961
{text: 'Text Source', link: '/sources/text-source'},
6062
{text: 'Composer Source', link: '/sources/composer-source'},
61-
{text: 'Tree Source', link: '/sources/tree-source'}
63+
{text: 'Tree Source', link: '/sources/tree-source'},
64+
{text: 'MCP Source', link: '/sources/mcp-source'}
6265
]
6366
},
6467
{

docs/configuration.md

Lines changed: 101 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ Configuration is built around three core concepts:
44

55
- **Document**: The primary output unit produced by the generator - a complete, formatted context file to share with
66
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
158
- **Modifiers**: Transform source content before inclusion - clean up, simplify, or enhance raw content
169
- **Imports**: Include and merge configuration from external files to enable modular configuration management
1710

@@ -161,11 +154,80 @@ import:
161154
url: https://example.com/shared-config.json
162155
```
163156

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+
164221
### Example in YAML
165222

223+
This example imports configurations from both local files and a URL:
224+
166225
```yaml
167226
import:
168227
- path: services/api/context.yaml
228+
pathPrefix: /api
229+
- type: url
230+
url: https://example.com/shared-configs.json
169231
170232
documents:
171233
- description: Project Overview
@@ -176,10 +238,16 @@ documents:
176238
# Project Documentation
177239
178240
This is the main project documentation.
241+
- type: file
242+
description: Project README
243+
sourcePaths:
244+
- README.md
179245
```
180246

181247
### Example in JSON
182248

249+
The same configuration in JSON format:
250+
183251
```json
184252
{
185253
"import": [
@@ -188,6 +256,18 @@ documents:
188256
}
189257
],
190258
"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+
},
191271
{
192272
"description": "Project Overview",
193273
"outputPath": "docs/overview.md",
@@ -202,12 +282,20 @@ documents:
202282
}
203283
```
204284

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:
206293

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)
211299

212300
## Using variables in configuration
213301

0 commit comments

Comments
 (0)