code-context-extractor 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -10
- package/dist/config.js +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,9 +16,9 @@ CodeContextExtractor is a local-only CLI that captures a deterministic snapshot
|
|
|
16
16
|
npx code-context-extractor extract . --verbose
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
The output is written to
|
|
19
|
+
The output is written to `code-context/` with a timestamped filename like:
|
|
20
20
|
```
|
|
21
|
-
|
|
21
|
+
code-context/<root>_context_YYYY-MM-DD_HHMMSS.txt
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Install from npm
|
|
@@ -28,11 +28,11 @@ npx code-context-extractor extract C:\projects\MyNewProject --verbose
|
|
|
28
28
|
|
|
29
29
|
## Important: .gitignore your outputs
|
|
30
30
|
> **Warning ⚠️**
|
|
31
|
-
> CodeContextExtractor writes files into a
|
|
31
|
+
> CodeContextExtractor writes files into a `code-context/` folder inside your project root. If that folder is not ignored, you may accidentally commit and push your context exports.
|
|
32
32
|
|
|
33
33
|
Add this line to your project's `.gitignore`:
|
|
34
34
|
```
|
|
35
|
-
|
|
35
|
+
code-context/
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
## npm and npx (for beginners)
|
|
@@ -64,7 +64,7 @@ code-context-extractor extract . --verbose
|
|
|
64
64
|
|
|
65
65
|
The output will be saved to:
|
|
66
66
|
```
|
|
67
|
-
|
|
67
|
+
.\code-context\MyNewProject_context_YYYY-MM-DD_HHMMSS.txt
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### macOS/Linux variant
|
|
@@ -75,7 +75,7 @@ code-context-extractor extract . --verbose
|
|
|
75
75
|
```
|
|
76
76
|
The output will be saved to:
|
|
77
77
|
```
|
|
78
|
-
|
|
78
|
+
./code-context/MyNewProject_context_YYYY-MM-DD_HHMMSS.txt
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
## Install from GitHub (beginner-friendly)
|
|
@@ -118,7 +118,7 @@ node dist/cli.js extract . --verbose
|
|
|
118
118
|
- Streaming output (does not load large files into memory)
|
|
119
119
|
- Conservative redaction enabled by default
|
|
120
120
|
- Optional Markdown output
|
|
121
|
-
- Automatic output folder
|
|
121
|
+
- Automatic output folder `code-context/`
|
|
122
122
|
|
|
123
123
|
## Commands
|
|
124
124
|
### Extract
|
|
@@ -132,7 +132,7 @@ code-context-extractor extract ./project --format md --depth 3 --verbose
|
|
|
132
132
|
|
|
133
133
|
## Options
|
|
134
134
|
```bash
|
|
135
|
-
--out <file> Output file (default:
|
|
135
|
+
--out <file> Output file (default: code-context/<root>_context_YYYY-MM-DD_HHMMSS.txt)
|
|
136
136
|
--format <text|md> Output format (default: text)
|
|
137
137
|
--depth <n> Tree depth (default: 4)
|
|
138
138
|
--include <glob> Include glob (repeatable)
|
|
@@ -173,13 +173,20 @@ node_modules
|
|
|
173
173
|
dist
|
|
174
174
|
build
|
|
175
175
|
out
|
|
176
|
-
|
|
176
|
+
code-context
|
|
177
177
|
.next
|
|
178
178
|
.turbo
|
|
179
179
|
.git
|
|
180
180
|
.idea
|
|
181
181
|
.vscode
|
|
182
182
|
coverage
|
|
183
|
+
package-lock.json
|
|
184
|
+
yarn.lock
|
|
185
|
+
pnpm-lock.yaml
|
|
186
|
+
bun.lockb
|
|
187
|
+
.npmrc
|
|
188
|
+
.yarnrc
|
|
189
|
+
.yarnrc.yml
|
|
183
190
|
*.lock
|
|
184
191
|
*.log
|
|
185
192
|
*.pem
|
|
@@ -192,11 +199,13 @@ id_rsa
|
|
|
192
199
|
id_ed25519
|
|
193
200
|
```
|
|
194
201
|
|
|
202
|
+
Lock files are excluded by default because they are machine-generated, often large, and typically add little architectural context.
|
|
203
|
+
|
|
195
204
|
## Configuration file
|
|
196
205
|
Use an optional JSON file (example: `example-config.json`) to set defaults.
|
|
197
206
|
```json
|
|
198
207
|
{
|
|
199
|
-
"outFile": "
|
|
208
|
+
"outFile": "code-context/project_context_2026-01-19_145227.txt",
|
|
200
209
|
"format": "text",
|
|
201
210
|
"depth": 4,
|
|
202
211
|
"include": [],
|
package/dist/config.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.DEFAULT_EXCLUDES = [
|
|
|
13
13
|
'dist/**',
|
|
14
14
|
'build/**',
|
|
15
15
|
'out/**',
|
|
16
|
-
'
|
|
16
|
+
'code-context/**',
|
|
17
17
|
'.next/**',
|
|
18
18
|
'.turbo/**',
|
|
19
19
|
'.git/**',
|
|
@@ -21,6 +21,13 @@ exports.DEFAULT_EXCLUDES = [
|
|
|
21
21
|
'.vscode/**',
|
|
22
22
|
'coverage/**',
|
|
23
23
|
'*.lock',
|
|
24
|
+
'package-lock.json',
|
|
25
|
+
'yarn.lock',
|
|
26
|
+
'pnpm-lock.yaml',
|
|
27
|
+
'bun.lockb',
|
|
28
|
+
'.npmrc',
|
|
29
|
+
'.yarnrc',
|
|
30
|
+
'.yarnrc.yml',
|
|
24
31
|
'*.log',
|
|
25
32
|
'*.pem',
|
|
26
33
|
'*.key',
|
|
@@ -87,7 +94,7 @@ function buildAutoOutFile(rootPath, format) {
|
|
|
87
94
|
pad(now.getDate())
|
|
88
95
|
].join('-');
|
|
89
96
|
const time = [pad(now.getHours()), pad(now.getMinutes()), pad(now.getSeconds())].join('');
|
|
90
|
-
return path_1.default.join('
|
|
97
|
+
return path_1.default.join('code-context', `${rootName}_context_${stamp}_${time}.${ext}`);
|
|
91
98
|
}
|
|
92
99
|
function normalizeFormat(value) {
|
|
93
100
|
return value === 'md' ? 'md' : 'text';
|
package/package.json
CHANGED