You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+59Lines changed: 59 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ A blazingly fast tool for peeking at codebases. Perfect for loading your codebas
16
16
- 🔗 Web content processing with Markdown conversion
17
17
- 📦 Git repository support
18
18
- 🌐 URL traversal with configurable depth
19
+
- 🏷️ XML output format for better LLM compatibility
19
20
20
21
## Installation
21
22
@@ -115,6 +116,9 @@ glimpse --config_path
115
116
116
117
# Initialize a .glimpse config file in the current directory
117
118
glimpse --config
119
+
120
+
# Output in XML format for better LLM compatibility
121
+
glimpse -x /path/to/project
118
122
```
119
123
120
124
## CLI Options
@@ -146,6 +150,7 @@ Options:
146
150
--traverse-links Traverse links when processing URLs
147
151
--link-depth <DEPTH> Maximum depth to traverse links (default: 1)
148
152
--pdf <PATH> Save output as PDF
153
+
-x, --xml Output in XML format for better LLM compatibility
149
154
-h, --help Print help
150
155
-V, --version Print version
151
156
```
@@ -179,6 +184,60 @@ default_excludes = [
179
184
]
180
185
```
181
186
187
+
## XML Output Format
188
+
189
+
Glimpse supports XML output format designed for better compatibility with Large Language Models (LLMs) like Claude, GPT, and others. When using the `-x` or `--xml` flag, the output is structured with clear XML tags that help LLMs better understand the context and structure of your codebase.
190
+
191
+
### XML Structure
192
+
193
+
The XML output wraps all content in a `<context>` tag with the project name:
194
+
195
+
```xml
196
+
<contextname="my_project">
197
+
<tree>
198
+
└── src/
199
+
└── main.rs
200
+
</tree>
201
+
202
+
<files>
203
+
<filepath="src/main.rs">
204
+
================================================
205
+
fn main() {
206
+
println!("Hello, World!");
207
+
}
208
+
</file>
209
+
</files>
210
+
211
+
<summary>
212
+
Total files: 1
213
+
Total size: 45 bytes
214
+
</summary>
215
+
</context>
216
+
```
217
+
218
+
### Benefits for LLM Usage
219
+
220
+
-**Clear Context Boundaries**: The `<context>` wrapper helps LLMs understand where your codebase begins and ends
221
+
-**Structured Information**: Separate sections for directory tree, file contents, and summary
222
+
-**Proper Escaping**: XML-safe content that won't confuse parsers
223
+
-**Project Identification**: Automatic project name detection for better context
0 commit comments