mkctx 1.0.2 → 2.0.0
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/LICENSE +21 -0
- package/README.md +242 -176
- package/bin/mkctx.js +462 -0
- package/favicon.svg +5 -0
- package/package.json +57 -49
- package/cleanup.js +0 -28
- package/install.js +0 -185
- package/main.go +0 -210
package/bin/mkctx.js
ADDED
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const readline = require('readline');
|
|
6
|
+
|
|
7
|
+
const CONFIG_FILE = 'mkctx.config.json';
|
|
8
|
+
|
|
9
|
+
const defaultConfig = {
|
|
10
|
+
src: './src',
|
|
11
|
+
ignore: '*.log, temp/, node_modules/, .git/, dist/, build/',
|
|
12
|
+
output: './mkctx',
|
|
13
|
+
first_comment: '/* Project Context */',
|
|
14
|
+
last_comment: '/* End of Context */',
|
|
15
|
+
dynamic: false
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Mapeo de extensiones a lenguajes para mejor resaltado de sintaxis
|
|
19
|
+
const langMap = {
|
|
20
|
+
js: 'javascript',
|
|
21
|
+
ts: 'typescript',
|
|
22
|
+
jsx: 'jsx',
|
|
23
|
+
tsx: 'tsx',
|
|
24
|
+
py: 'python',
|
|
25
|
+
rb: 'ruby',
|
|
26
|
+
go: 'go',
|
|
27
|
+
rs: 'rust',
|
|
28
|
+
java: 'java',
|
|
29
|
+
kt: 'kotlin',
|
|
30
|
+
cs: 'csharp',
|
|
31
|
+
cpp: 'cpp',
|
|
32
|
+
c: 'c',
|
|
33
|
+
h: 'c',
|
|
34
|
+
hpp: 'cpp',
|
|
35
|
+
php: 'php',
|
|
36
|
+
sh: 'bash',
|
|
37
|
+
bash: 'bash',
|
|
38
|
+
zsh: 'bash',
|
|
39
|
+
ps1: 'powershell',
|
|
40
|
+
sql: 'sql',
|
|
41
|
+
html: 'html',
|
|
42
|
+
css: 'css',
|
|
43
|
+
scss: 'scss',
|
|
44
|
+
sass: 'sass',
|
|
45
|
+
less: 'less',
|
|
46
|
+
json: 'json',
|
|
47
|
+
xml: 'xml',
|
|
48
|
+
yaml: 'yaml',
|
|
49
|
+
yml: 'yaml',
|
|
50
|
+
md: 'markdown',
|
|
51
|
+
vue: 'vue',
|
|
52
|
+
svelte: 'svelte',
|
|
53
|
+
dockerfile: 'dockerfile',
|
|
54
|
+
makefile: 'makefile',
|
|
55
|
+
toml: 'toml',
|
|
56
|
+
ini: 'ini',
|
|
57
|
+
cfg: 'ini',
|
|
58
|
+
env: 'bash'
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
async function main() {
|
|
62
|
+
const args = process.argv.slice(2);
|
|
63
|
+
const command = args[0];
|
|
64
|
+
|
|
65
|
+
switch (command) {
|
|
66
|
+
case 'config':
|
|
67
|
+
createConfig();
|
|
68
|
+
break;
|
|
69
|
+
case 'help':
|
|
70
|
+
case '--help':
|
|
71
|
+
case '-h':
|
|
72
|
+
showHelp();
|
|
73
|
+
break;
|
|
74
|
+
case 'version':
|
|
75
|
+
case '--version':
|
|
76
|
+
case '-v':
|
|
77
|
+
showVersion();
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
await generateContext();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function showHelp() {
|
|
85
|
+
console.log(`
|
|
86
|
+
📄 mkctx - Make Context
|
|
87
|
+
|
|
88
|
+
Generate markdown context files from your project code for AI assistants.
|
|
89
|
+
|
|
90
|
+
Usage:
|
|
91
|
+
mkctx Generate context (interactive if dynamic mode enabled)
|
|
92
|
+
mkctx config Create configuration file
|
|
93
|
+
mkctx help Show this help message
|
|
94
|
+
mkctx version Show version
|
|
95
|
+
|
|
96
|
+
Configuration (mkctx.config.json):
|
|
97
|
+
src Source directory to scan (default: "./src")
|
|
98
|
+
ignore Comma-separated patterns to ignore
|
|
99
|
+
output Output directory (default: "./mkctx")
|
|
100
|
+
first_comment Comment at the beginning of context
|
|
101
|
+
last_comment Comment at the end of context
|
|
102
|
+
dynamic If true, prompts for path on each run
|
|
103
|
+
|
|
104
|
+
Examples:
|
|
105
|
+
mkctx # Generate context
|
|
106
|
+
mkctx config # Create config file
|
|
107
|
+
|
|
108
|
+
More info: https://github.com/yourusername/mkctx
|
|
109
|
+
`);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function showVersion() {
|
|
113
|
+
const pkg = require('../package.json');
|
|
114
|
+
console.log(`mkctx v${pkg.version}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function createConfig() {
|
|
118
|
+
// Crear directorio mkctx
|
|
119
|
+
if (!fs.existsSync('mkctx')) {
|
|
120
|
+
fs.mkdirSync('mkctx', { recursive: true });
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Escribir configuración
|
|
124
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify(defaultConfig, null, 2));
|
|
125
|
+
|
|
126
|
+
// Actualizar .gitignore
|
|
127
|
+
updateGitignore();
|
|
128
|
+
|
|
129
|
+
console.log('✅ Configuration created:');
|
|
130
|
+
console.log(' - mkctx.config.json');
|
|
131
|
+
console.log(' - mkctx/ folder');
|
|
132
|
+
console.log(' - Entry in .gitignore');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function updateGitignore() {
|
|
136
|
+
const gitignorePath = '.gitignore';
|
|
137
|
+
let content = '';
|
|
138
|
+
|
|
139
|
+
if (fs.existsSync(gitignorePath)) {
|
|
140
|
+
content = fs.readFileSync(gitignorePath, 'utf-8');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (!content.includes('mkctx/')) {
|
|
144
|
+
const entry = '\n# mkctx - generated context\nmkctx/\n';
|
|
145
|
+
content += entry;
|
|
146
|
+
fs.writeFileSync(gitignorePath, content);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function loadConfig() {
|
|
151
|
+
if (fs.existsSync(CONFIG_FILE)) {
|
|
152
|
+
try {
|
|
153
|
+
const config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
154
|
+
return { ...defaultConfig, ...config };
|
|
155
|
+
} catch (err) {
|
|
156
|
+
console.log('⚠️ Error parsing config file, using defaults');
|
|
157
|
+
return { ...defaultConfig, dynamic: true };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Sin config, activar dynamic por defecto
|
|
161
|
+
return { ...defaultConfig, dynamic: true };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async function askForPath(defaultPath) {
|
|
165
|
+
const rl = readline.createInterface({
|
|
166
|
+
input: process.stdin,
|
|
167
|
+
output: process.stdout
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return new Promise((resolve) => {
|
|
171
|
+
console.log('\n🔍 Dynamic mode enabled');
|
|
172
|
+
console.log(` Current directory: ${process.cwd()}`);
|
|
173
|
+
|
|
174
|
+
rl.question(` Enter path (or press Enter for '${defaultPath}'): `, (answer) => {
|
|
175
|
+
rl.close();
|
|
176
|
+
const input = answer.trim();
|
|
177
|
+
|
|
178
|
+
if (!input) {
|
|
179
|
+
resolve(defaultPath);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (!fs.existsSync(input)) {
|
|
184
|
+
console.log(`⚠️ Path '${input}' does not exist. Using default: ${defaultPath}`);
|
|
185
|
+
resolve(defaultPath);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
resolve(input);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
async function generateContext() {
|
|
195
|
+
const config = loadConfig();
|
|
196
|
+
|
|
197
|
+
let srcPath = config.src || '.';
|
|
198
|
+
|
|
199
|
+
// Determinar si usar modo dinámico
|
|
200
|
+
if (config.dynamic) {
|
|
201
|
+
srcPath = await askForPath(srcPath);
|
|
202
|
+
} else if (config.src === '.' || config.src === '') {
|
|
203
|
+
srcPath = await askForPath('.');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Verificar que la ruta existe
|
|
207
|
+
if (!fs.existsSync(srcPath)) {
|
|
208
|
+
console.log(`❌ Source path does not exist: ${srcPath}`);
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const files = getFiles(srcPath, config);
|
|
213
|
+
|
|
214
|
+
if (files.length === 0) {
|
|
215
|
+
console.log(`⚠️ No files found in: ${srcPath}`);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const content = buildContent(files, config);
|
|
220
|
+
|
|
221
|
+
const outputPath = config.output || '.';
|
|
222
|
+
if (!fs.existsSync(outputPath)) {
|
|
223
|
+
fs.mkdirSync(outputPath, { recursive: true });
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const outputFile = path.join(outputPath, 'context.md');
|
|
227
|
+
fs.writeFileSync(outputFile, content);
|
|
228
|
+
|
|
229
|
+
console.log(`✅ Context generated at: ${outputFile}`);
|
|
230
|
+
console.log(` 📁 Source: ${srcPath}`);
|
|
231
|
+
console.log(` 📄 Files included: ${files.length}`);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function getFiles(srcPath, config) {
|
|
235
|
+
const files = [];
|
|
236
|
+
const ignorePatterns = parseIgnorePatterns(config.ignore);
|
|
237
|
+
|
|
238
|
+
function walk(dir) {
|
|
239
|
+
if (!fs.existsSync(dir)) return;
|
|
240
|
+
|
|
241
|
+
let entries;
|
|
242
|
+
try {
|
|
243
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
244
|
+
} catch (err) {
|
|
245
|
+
// Sin permisos para leer el directorio
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
for (const entry of entries) {
|
|
250
|
+
const fullPath = path.join(dir, entry.name);
|
|
251
|
+
const relativePath = path.relative(srcPath, fullPath);
|
|
252
|
+
|
|
253
|
+
if (shouldIgnore(fullPath, entry.name, relativePath, ignorePatterns)) {
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (entry.isDirectory()) {
|
|
258
|
+
walk(fullPath);
|
|
259
|
+
} else if (entry.isFile()) {
|
|
260
|
+
// Verificar que es un archivo de texto (no binario)
|
|
261
|
+
if (isTextFile(entry.name)) {
|
|
262
|
+
files.push(fullPath);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
walk(srcPath);
|
|
269
|
+
return files.sort(); // Ordenar alfabéticamente
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function parseIgnorePatterns(ignoreString) {
|
|
273
|
+
if (!ignoreString) return [];
|
|
274
|
+
return ignoreString
|
|
275
|
+
.split(',')
|
|
276
|
+
.map(p => p.trim())
|
|
277
|
+
.filter(Boolean);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function shouldIgnore(fullPath, name, relativePath, patterns) {
|
|
281
|
+
// Ignorar archivos y carpetas del sistema
|
|
282
|
+
const systemIgnores = [
|
|
283
|
+
'.git',
|
|
284
|
+
'.DS_Store',
|
|
285
|
+
'Thumbs.db',
|
|
286
|
+
'node_modules',
|
|
287
|
+
'.svn',
|
|
288
|
+
'.hg',
|
|
289
|
+
'__pycache__',
|
|
290
|
+
'.pytest_cache',
|
|
291
|
+
'.mypy_cache',
|
|
292
|
+
'.vscode',
|
|
293
|
+
'.idea',
|
|
294
|
+
'*.pyc',
|
|
295
|
+
'*.pyo',
|
|
296
|
+
'.env.local',
|
|
297
|
+
'.env.*.local'
|
|
298
|
+
];
|
|
299
|
+
|
|
300
|
+
for (const ignore of systemIgnores) {
|
|
301
|
+
if (ignore.includes('*')) {
|
|
302
|
+
if (matchWildcard(ignore, name)) return true;
|
|
303
|
+
} else {
|
|
304
|
+
if (fullPath.includes(ignore) || name === ignore) return true;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Aplicar patrones de configuración
|
|
309
|
+
for (const pattern of patterns) {
|
|
310
|
+
// Wildcard (*.log, *.test.js)
|
|
311
|
+
if (pattern.includes('*')) {
|
|
312
|
+
if (matchWildcard(pattern, name)) return true;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Directorio (temp/, dist/)
|
|
316
|
+
if (pattern.endsWith('/')) {
|
|
317
|
+
const dir = pattern.slice(0, -1);
|
|
318
|
+
if (fullPath.includes(path.sep + dir + path.sep) ||
|
|
319
|
+
fullPath.includes(dir + path.sep) ||
|
|
320
|
+
name === dir) {
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Coincidencia exacta o parcial
|
|
326
|
+
if (relativePath.includes(pattern) || name === pattern) {
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function matchWildcard(pattern, filename) {
|
|
335
|
+
// Convertir patrón glob simple a regex
|
|
336
|
+
const regexPattern = pattern
|
|
337
|
+
.replace(/\./g, '\\.')
|
|
338
|
+
.replace(/\*/g, '.*');
|
|
339
|
+
const regex = new RegExp(`^${regexPattern}$`, 'i');
|
|
340
|
+
return regex.test(filename);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function isTextFile(filename) {
|
|
344
|
+
// Extensiones de archivos de texto conocidos
|
|
345
|
+
const textExtensions = [
|
|
346
|
+
'.js', '.ts', '.jsx', '.tsx', '.mjs', '.cjs',
|
|
347
|
+
'.py', '.pyw',
|
|
348
|
+
'.rb', '.rake',
|
|
349
|
+
'.go',
|
|
350
|
+
'.rs',
|
|
351
|
+
'.java', '.kt', '.kts', '.scala',
|
|
352
|
+
'.cs', '.fs', '.vb',
|
|
353
|
+
'.cpp', '.c', '.h', '.hpp', '.cc', '.cxx',
|
|
354
|
+
'.php', '.phtml',
|
|
355
|
+
'.sh', '.bash', '.zsh', '.fish', '.ps1', '.bat', '.cmd',
|
|
356
|
+
'.sql',
|
|
357
|
+
'.html', '.htm', '.xhtml',
|
|
358
|
+
'.css', '.scss', '.sass', '.less', '.styl',
|
|
359
|
+
'.json', '.json5',
|
|
360
|
+
'.xml', '.xsl', '.xslt',
|
|
361
|
+
'.yaml', '.yml',
|
|
362
|
+
'.md', '.markdown', '.mdx',
|
|
363
|
+
'.txt', '.text',
|
|
364
|
+
'.vue', '.svelte',
|
|
365
|
+
'.dockerfile', '.makefile',
|
|
366
|
+
'.toml', '.ini', '.cfg', '.conf',
|
|
367
|
+
'.env', '.env.example',
|
|
368
|
+
'.gitignore', '.gitattributes', '.editorconfig',
|
|
369
|
+
'.eslintrc', '.prettierrc', '.babelrc',
|
|
370
|
+
'.graphql', '.gql',
|
|
371
|
+
'.proto',
|
|
372
|
+
'.tf', '.tfvars',
|
|
373
|
+
'.lua',
|
|
374
|
+
'.r', '.R',
|
|
375
|
+
'.swift',
|
|
376
|
+
'.m', '.mm',
|
|
377
|
+
'.ex', '.exs',
|
|
378
|
+
'.erl', '.hrl',
|
|
379
|
+
'.clj', '.cljs', '.cljc',
|
|
380
|
+
'.hs', '.lhs',
|
|
381
|
+
'.elm',
|
|
382
|
+
'.pug', '.jade',
|
|
383
|
+
'.ejs', '.hbs', '.handlebars',
|
|
384
|
+
'.twig', '.blade.php',
|
|
385
|
+
'.astro',
|
|
386
|
+
'.prisma',
|
|
387
|
+
'.sol'
|
|
388
|
+
];
|
|
389
|
+
|
|
390
|
+
const ext = path.extname(filename).toLowerCase();
|
|
391
|
+
const basename = path.basename(filename).toLowerCase();
|
|
392
|
+
|
|
393
|
+
// Archivos sin extensión pero conocidos
|
|
394
|
+
const knownFiles = [
|
|
395
|
+
'dockerfile', 'makefile', 'gemfile', 'rakefile',
|
|
396
|
+
'procfile', 'vagrantfile', 'jenkinsfile',
|
|
397
|
+
'.gitignore', '.gitattributes', '.editorconfig',
|
|
398
|
+
'.eslintrc', '.prettierrc', '.babelrc',
|
|
399
|
+
'.env', '.env.example', '.env.local'
|
|
400
|
+
];
|
|
401
|
+
|
|
402
|
+
if (knownFiles.includes(basename)) return true;
|
|
403
|
+
if (ext && textExtensions.includes(ext)) return true;
|
|
404
|
+
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function getLanguage(filename) {
|
|
409
|
+
const ext = path.extname(filename).slice(1).toLowerCase();
|
|
410
|
+
const basename = path.basename(filename).toLowerCase();
|
|
411
|
+
|
|
412
|
+
// Archivos especiales
|
|
413
|
+
if (basename === 'dockerfile') return 'dockerfile';
|
|
414
|
+
if (basename === 'makefile') return 'makefile';
|
|
415
|
+
if (basename.startsWith('.env')) return 'bash';
|
|
416
|
+
|
|
417
|
+
return langMap[ext] || ext || 'text';
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function buildContent(files, config) {
|
|
421
|
+
let content = '';
|
|
422
|
+
|
|
423
|
+
if (config.first_comment) {
|
|
424
|
+
content += config.first_comment + '\n\n';
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
for (const file of files) {
|
|
428
|
+
let fileContent;
|
|
429
|
+
try {
|
|
430
|
+
fileContent = fs.readFileSync(file, 'utf-8');
|
|
431
|
+
} catch (err) {
|
|
432
|
+
console.log(`⚠️ Could not read: ${file}`);
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const lang = getLanguage(file);
|
|
437
|
+
const relativePath = file; // Mantener ruta relativa
|
|
438
|
+
|
|
439
|
+
content += '```' + lang + '\n';
|
|
440
|
+
content += '// ' + relativePath + '\n';
|
|
441
|
+
content += fileContent;
|
|
442
|
+
|
|
443
|
+
// Asegurar que termina con newline
|
|
444
|
+
if (!fileContent.endsWith('\n')) {
|
|
445
|
+
content += '\n';
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
content += '```\n\n';
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (config.last_comment) {
|
|
452
|
+
content += config.last_comment;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
return content;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// Ejecutar
|
|
459
|
+
main().catch((err) => {
|
|
460
|
+
console.error('❌ Error:', err.message);
|
|
461
|
+
process.exit(1);
|
|
462
|
+
});
|
package/favicon.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="164" height="194" viewBox="0 0 164.37044 194.44035" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g transform="translate(-21.493657,-47.985515)">
|
|
3
|
+
<path fill="#000000" d="m 113.34675,241.91651 c -5.33297,-1.39692 -9.51517,-5.87489 -10.77484,-11.53687 -0.59493,-2.67409 -0.41231,-7.40107 0.38267,-9.90489 1.4657,-4.61629 5.54113,-8.49263 10.32287,-9.81857 2.00394,-0.55568 6.10108,-0.64641 8.28183,-0.18341 4.9645,1.05404 9.38772,5.49662 9.91154,9.95492 l 0.16321,1.38906 h -3.97692 c -3.90279,0 -3.97976,-0.0111 -4.12895,-0.59531 -0.24867,-0.97381 -1.67651,-2.49331 -2.89897,-3.08509 -1.30625,-0.63235 -3.36794,-0.72681 -5.04546,-0.23116 -0.68858,0.20344 -1.59302,0.8227 -2.45963,1.68407 -1.88095,1.86956 -2.58261,4.08851 -2.40386,7.60197 0.18511,3.63824 1.5037,6.07002 4.01399,7.40268 1.4516,0.77062 4.86002,0.81833 6.24276,0.0874 1.34783,-0.7125 2.32814,-1.71547 2.66023,-2.72172 l 0.29122,-0.8824 h 3.90413 c 2.14728,0 3.96671,0.0626 4.04318,0.13904 0.30828,0.30828 -0.41056,2.99948 -1.19584,4.47698 -1.64714,3.09909 -5.08465,5.57698 -8.8411,6.37301 -2.50807,0.53148 -6.13568,0.46754 -8.49206,-0.14969 z m -91.670083,-0.42578 c -0.10066,-0.10065 -0.18301,-7.06652 -0.18301,-15.4797 v -15.29669 l 0.59531,-0.14752 c 0.32742,-0.0811 2.14313,-0.11317 4.0349,-0.0712 l 3.43958,0.0763 0.13229,2.38125 0.1323,2.38125 0.61216,-0.98453 c 0.91799,-1.4764 2.83034,-3.02962 4.50829,-3.66166 1.23843,-0.46648 1.92633,-0.546 4.01961,-0.46467 2.14575,0.0834 2.75365,0.21358 4.04299,0.86592 1.42061,0.71876 3.40238,2.52224 4.08635,3.71872 0.29324,0.51296 0.31226,0.50955 0.75435,-0.13523 0.85821,-1.2517 2.81561,-2.90555 4.30076,-3.63379 1.29782,-0.63638 1.86583,-0.74179 4.44451,-0.8248 2.30796,-0.0743 3.26563,0.007 4.36562,0.37074 2.81769,0.93163 4.76023,2.7248 5.83876,5.38977 0.5898,1.45735 0.59743,1.62992 0.59743,13.51474 v 12.03854 l -3.81618,0.0737 c -2.87439,0.0555 -3.8699,-0.01 -4.03385,-0.26458 -0.11971,-0.18605 -0.20754,-4.68406 -0.19518,-9.99557 0.0237,-10.16592 -0.003,-10.42553 -1.22919,-12.03335 -1.67889,-2.20113 -5.73367,-2.25509 -7.71245,-0.10263 -1.47472,1.60416 -1.52356,1.97145 -1.66628,12.53286 l -0.13229,9.78958 h -3.96875 -3.96875 l -0.13229,-10.18646 c -0.0728,-5.60255 -0.24096,-10.42458 -0.37378,-10.71562 -0.89084,-1.95204 -2.54739,-3.03109 -4.6533,-3.03109 -2.10383,0 -4.24443,1.39018 -5.07469,3.29567 -0.25574,0.58694 -0.38077,3.37896 -0.47985,10.71563 l -0.134,9.92187 -3.98419,0.0728 c -2.19129,0.04 -4.06653,-0.01 -4.16718,-0.11025 z m 52.380881,-0.007 c -0.097,-0.097 -0.17639,-9.7388 -0.17639,-21.4262 v -21.24982 l 0.59531,-0.14752 c 0.32742,-0.0811 2.14313,-0.11317 4.0349,-0.0712 l 3.43958,0.0763 0.0688,11.9724 c 0.0578,10.05253 0.12824,11.97239 0.43924,11.97239 0.40546,0 1.92778,-1.67521 7.27882,-8.00989 l 3.525389,-4.17343 4.39802,0.0724 c 4.299053,0.0708 4.398023,0.0852 4.398023,0.64026 0,0.36501 -1.84299,2.6192 -5.159373,6.31054 -7.125599,7.93119 -6.746249,7.44686 -6.313139,8.06025 0.19801,0.28041 2.800789,3.68153 5.783969,7.55803 6.589093,8.56222 6.169563,7.97708 5.961153,8.31428 -0.10972,0.17753 -1.85853,0.2733 -4.852293,0.26572 l -4.68073,-0.0118 -4.365629,-5.82584 c -5.04564,-6.7333 -5.1452,-6.85046 -5.8213,-6.85046 -0.48761,0 -0.50898,0.25639 -0.50795,6.09303 6e-4,3.35116 -0.0704,6.20866 -0.15774,6.35 -0.17733,0.28692 -7.60648,0.36281 -7.8887,0.0806 z m 70.335062,-0.0786 c -2.45805,-0.64201 -4.31494,-2.23319 -5.21185,-4.46607 -0.57666,-1.4356 -0.60469,-1.86099 -0.68723,-10.42635 l -0.086,-8.92969 h -2.62983 -2.62984 v -3.43958 -3.43958 h 2.63876 2.63876 l 0.0732,-3.90261 0.0732,-3.9026 4.0349,-0.073 4.03489,-0.073 v 3.84335 3.84335 l 2.57969,0.0375 c 2.40776,0.035 3.14052,0.0685 3.96875,0.18187 0.2453,0.0336 0.33073,0.9337 0.33073,3.48484 v 3.43958 h -3.45087 -3.45087 l 0.0774,7.82725 0.0774,7.82726 0.86407,0.7717 c 0.82625,0.73793 0.97424,0.77171 3.38134,0.77171 h 2.51727 l -0.074,3.37343 -0.074,3.37344 -4.10104,0.0423 c -2.25557,0.0233 -4.45823,-0.051 -4.89479,-0.165 z m 11.38505,0.003 c -0.22217,-0.35947 -0.12403,-0.51856 5.15141,-8.35152 2.54661,-3.7812 4.66888,-6.96117 4.71615,-7.06659 0.0473,-0.10543 -2.01975,-3.37451 -4.59337,-7.26462 -2.57362,-3.89011 -4.743,-7.23892 -4.82085,-7.44179 -0.0779,-0.20287 0.0246,-0.47408 0.22774,-0.60269 0.44383,-0.28102 8.18686,-0.31658 8.58848,-0.0394 0.15493,0.10691 1.51769,2.19084 3.02836,4.63094 1.51067,2.4401 2.85797,4.39945 2.994,4.35411 0.13604,-0.0454 1.51534,-2.10133 3.06512,-4.56885 l 2.81778,-4.4864 h 4.06414 c 3.41787,0 4.10612,0.0665 4.32807,0.41841 0.20754,0.32901 -0.74135,1.88351 -4.44138,7.27604 -2.58792,3.7717 -4.75998,7.06049 -4.82681,7.30843 -0.0752,0.27908 1.72122,3.19804 4.71609,7.66295 2.66067,3.96669 4.89022,7.48748 4.95454,7.82398 l 0.11696,0.61182 -4.45842,-0.0727 -4.45843,-0.0727 -2.97184,-4.732 c -1.63451,-2.6026 -3.03232,-4.86479 -3.10625,-5.02708 -0.16406,-0.36019 -0.075,-0.48479 -3.7251,5.21226 l -2.91314,4.54682 -4.14476,0.0728 c -2.56197,0.045 -4.20728,-0.0284 -4.30849,-0.19217 z M 44.350267,189.27332 c -5.8481,-0.85707 -10.63511,-5.4096 -11.88359,-11.3015 -0.57953,-2.73497 -0.57165,-116.084502 0.008,-118.54402 1.26338,-5.35839 5.52827,-9.736089 10.73147,-11.015312 1.55089,-0.381293 5.25197,-0.426973 34.594271,-0.426973 18.071659,0 32.857572,0.07092 32.857572,0.157594 0,0.08668 -0.2529,0.512756 -0.562,0.946843 -0.6433,0.903443 -1.80536,4.038598 -1.81367,4.893194 -0.0148,1.523596 2.49313,1.410702 -31.338992,1.410702 -34.823361,0 -32.783091,-0.112185 -34.992141,1.924048 -0.65329,0.602182 -1.44565,1.576477 -1.76081,2.165101 l -0.57301,1.070226 -0.0685,57.669907 c -0.0755,63.51098 -0.19049,58.96472 1.54527,61.0705 0.44614,0.54124 1.36794,1.31137 2.04845,1.71141 l 1.23729,0.72734 h 58.635103 58.6351 l 1.29333,-0.88257 c 1.40132,-0.95625 2.46812,-2.28564 3.00738,-3.74764 0.27034,-0.73291 0.35636,-7.4371 0.41249,-32.14687 l 0.0709,-31.22083 h 3.66346 3.66346 v 31.61771 31.6177 l -0.58422,1.85209 c -1.70136,5.39363 -6.04873,9.26747 -11.59017,10.32772 -1.74558,0.33399 -9.93989,0.38331 -58.95565,0.35489 -31.310565,-0.0181 -57.537035,-0.12222 -58.281055,-0.23126 z m 17.17524,-27.95225 c -1.29015,-0.457 -2.98235,-2.04859 -3.68853,-3.4692 -0.46361,-0.93265 -0.49654,-2.06727 -0.5654,-19.48559 -0.0815,-20.60599 -0.1087,-20.24409 1.68052,-22.33439 0.53102,-0.62037 1.54349,-1.42085 2.24994,-1.77883 l 1.28444,-0.65088 h 28.529361 28.529352 l 1.43302,0.85989 c 1.5213,0.91287 2.6799,2.35852 3.15138,3.93217 0.19422,0.64826 0.28698,6.85511 0.28698,19.20244 0,20.29337 0.054,19.63441 -1.78559,21.78357 -0.52971,0.61885 -1.56504,1.40547 -2.30074,1.74805 l -1.33763,0.62287 -28.178122,-0.0183 c -24.232671,-0.0157 -28.333661,-0.0734 -29.288981,-0.4118 z m 47.075983,-12.5415 c 0.54228,-0.15061 1.52558,-0.68573 2.18511,-1.18915 0.65952,-0.50343 1.25763,-0.91533 1.32913,-0.91533 0.0715,0 0.13001,0.40815 0.13001,0.90701 0,0.89588 0.017,0.90911 1.38906,1.07939 0.76398,0.0948 1.86531,0.13315 2.44739,0.0852 l 1.05834,-0.0872 v -12.17083 -12.17083 l -2.57969,-0.0757 -2.57969,-0.0757 v 4.26353 4.26354 l -1.0694,-0.91538 c -2.68653,-2.29956 -6.9541,-1.89018 -9.33885,0.89586 -1.2627,1.47517 -1.782898,3.06941 -1.954898,5.99101 -0.158355,2.69001 0.21058,5.1672 1.000048,6.71468 0.61616,1.20778 2.59711,2.97575 3.74709,3.34424 1.15315,0.3695 3.01823,0.39404 4.23635,0.0557 z m -2.28058,-4.77532 c -1.15135,-0.90565 -1.74809,-2.37792 -1.74809,-4.31285 0,-1.99804 0.2967,-2.9238 1.261,-3.93459 1.5488,-1.62346 3.9602,-1.43556 5.46025,0.42545 0.74371,0.92268 0.82669,1.21586 0.89863,3.175 0.0927,2.52326 -0.33864,3.64302 -1.77203,4.60058 -1.19601,0.79899 -3.11538,0.82072 -4.09976,0.0464 z m -40.415623,4.41048 c 0.84231,-0.43558 1.36128,-1.41624 1.36128,-2.5723 0,-1.2091 -1.48961,-2.60692 -2.77812,-2.60692 -0.76055,0 -1.17966,0.2007 -1.87854,0.89958 -2.35294,2.35294 0.31672,5.81996 3.29538,4.27964 z m 9.034201,-5.37413 c 0,-6.06168 0.16311,-7.00628 1.35384,-7.8403 0.69333,-0.48563 2.38896,-0.571 3.15873,-0.15903 1.16194,0.62185 1.30826,1.47587 1.30826,7.63572 v 5.81776 l 1.12448,0.16715 c 0.61847,0.0919 1.71979,0.12899 2.4474,0.0824 l 1.32292,-0.0848 0.13229,-6.30726 0.13229,-6.30726 0.74236,-0.63805 c 0.80125,-0.68867 2.43659,-0.86696 3.37001,-0.36741 1.05716,0.56578 1.17478,1.24148 1.31159,7.53457 l 0.13229,6.08541 h 2.381249 2.38125 l -0.0275,-6.62572 c -0.0291,-7.02408 -0.16451,-8.00327 -1.3208,-9.55265 -0.34172,-0.4579 -1.24333,-1.14251 -2.00357,-1.52136 -2.473759,-1.23272 -5.287839,-0.74746 -6.971699,1.20221 l -0.78896,0.9135 -1.09447,-1.11695 c -2.36818,-2.41684 -5.71637,-2.24745 -8.11785,0.4107 l -0.97414,1.07826 v -1.32368 -1.32368 h -2.38125 -2.381251 v 8.84149 c 0,6.82121 0.0756,8.87388 0.33073,8.98323 0.1819,0.078 1.25346,0.12306 2.381251,0.10023 l 2.05052,-0.0415 z m 58.982052,-23.77069 c -0.63842,-0.67907 -0.6418,-0.71305 -0.72037,-7.25254 l -0.0789,-6.57027 -4.0221,-0.0975 c -3.86024,-0.0936 -4.09385,-0.13104 -5.80477,-0.93146 -3.44338,-1.61092 -5.94305,-4.808188 -6.49101,-8.302509 -0.12542,-0.799817 -0.19897,-9.872256 -0.16343,-20.160977 0.0569,-16.48141 0.11664,-18.887862 0.50205,-20.229106 0.78988,-2.748799 2.7626,-5.195638 5.18542,-6.43167 2.62508,-1.339215 1.53658,-1.287738 27.55971,-1.303344 13.42133,-0.008 24.81914,0.08832 25.32846,0.214156 2.54886,0.629722 5.73953,3.010515 7.06443,5.271282 0.36843,0.62868 0.89419,1.863775 1.16835,2.744655 0.46844,1.505102 0.49847,2.728663 0.49847,20.307854 0,20.358838 0.002,20.326239 -1.50752,23.099966 -0.97246,1.786723 -3.19153,3.791993 -5.30324,4.792293 l -1.7882,0.84705 -11.03071,0.13229 -11.03071,0.13229 -4.56404,4.10104 c -12.67712,11.39108 -11.33614,10.31875 -12.90392,10.31875 -1.00826,0 -1.38322,-0.13479 -1.89793,-0.68227 z m 3.48817,-30.075543 1.21122,-3.241146 5.66396,-0.06525 5.66397,-0.06525 1.19062,3.240254 1.19063,3.240253 3.50573,0.07382 c 2.87321,0.06051 3.50573,0.0066 3.50573,-0.298766 0,-0.204925 -0.78254,-2.440803 -1.73896,-4.968617 -0.95643,-2.527814 -3.44756,-9.1204 -5.53583,-14.650191 -2.08828,-5.529791 -3.87955,-10.265709 -3.9806,-10.524262 -0.16588,-0.424397 -0.54488,-0.462978 -3.89866,-0.396875 l -3.71492,0.07322 -1.57321,4.101041 c -0.86527,2.255573 -2.4379,6.363229 -3.49474,9.128125 -1.05684,2.764896 -2.90405,7.586927 -4.10491,10.715624 -1.20086,3.128698 -2.24269,5.956432 -2.31516,6.283854 -0.13174,0.5951 -0.13047,0.595313 3.54106,0.595313 h 3.67285 z m 3.78452,-11.641666 c 0.48389,-1.346068 1.3304,-3.732923 1.88112,-5.304122 0.55072,-1.5712 1.08864,-2.761825 1.19539,-2.645834 0.21614,0.234863 3.69374,9.809065 3.69374,10.169267 0,0.125446 -1.72126,0.228085 -3.82503,0.228085 h -3.82503 z m 29.25984,-0.727604 c 0,-14.682892 -0.0275,-15.61163 -0.46302,-15.630845 -2.65965,-0.117346 -5.11815,-0.130692 -5.82084,-0.0316 l -0.85989,0.121266 v 15.575797 15.575798 h 3.57187 3.57188 z"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,49 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mkctx",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
],
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "mkctx",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Generate markdown context files from your project code for AI assistants",
|
|
5
|
+
"main": "bin/mkctx.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mkctx": "./bin/mkctx.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node bin/mkctx.js",
|
|
11
|
+
"config": "node bin/mkctx.js config",
|
|
12
|
+
"test": "node bin/mkctx.js --help",
|
|
13
|
+
"prepublishOnly": "node bin/mkctx.js --version",
|
|
14
|
+
"release:patch": "npm version patch && npm publish",
|
|
15
|
+
"release:minor": "npm version minor && npm publish",
|
|
16
|
+
"release:major": "npm version major && npm publish",
|
|
17
|
+
"deploy": "npm publish",
|
|
18
|
+
"deploy:dry": "npm publish --dry-run"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"context",
|
|
22
|
+
"markdown",
|
|
23
|
+
"documentation",
|
|
24
|
+
"ai",
|
|
25
|
+
"llm",
|
|
26
|
+
"chatgpt",
|
|
27
|
+
"claude",
|
|
28
|
+
"prompt",
|
|
29
|
+
"code-context",
|
|
30
|
+
"code-documentation",
|
|
31
|
+
"project-context"
|
|
32
|
+
],
|
|
33
|
+
"author": "Your Name <your.email@example.com>",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/yourusername/mkctx.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/yourusername/mkctx/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/yourusername/mkctx#readme",
|
|
43
|
+
"files": [
|
|
44
|
+
"bin/",
|
|
45
|
+
"README.md",
|
|
46
|
+
"LICENSE",
|
|
47
|
+
"favicon.svg"
|
|
48
|
+
],
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=14.0.0"
|
|
51
|
+
},
|
|
52
|
+
"os": [
|
|
53
|
+
"darwin",
|
|
54
|
+
"linux",
|
|
55
|
+
"win32"
|
|
56
|
+
]
|
|
57
|
+
}
|
package/cleanup.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
|
|
4
|
-
function cleanup() {
|
|
5
|
-
const filesToRemove = ["mkctx", "mkctx.exe", "mkctx.cmd"];
|
|
6
|
-
let removedCount = 0;
|
|
7
|
-
|
|
8
|
-
filesToRemove.forEach((file) => {
|
|
9
|
-
const filePath = path.join(__dirname, file);
|
|
10
|
-
try {
|
|
11
|
-
if (fs.existsSync(filePath)) {
|
|
12
|
-
fs.unlinkSync(filePath);
|
|
13
|
-
console.log(`🧹 Cleaning up: ${file}`);
|
|
14
|
-
removedCount++;
|
|
15
|
-
}
|
|
16
|
-
} catch (error) {
|
|
17
|
-
console.log(`⚠️ Could not delete ${file}: ${error.message}`);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (removedCount > 0) {
|
|
22
|
-
console.log(`✅ Cleaned up ${removedCount} temporary files`);
|
|
23
|
-
} else {
|
|
24
|
-
console.log(`ℹ️ No temporary files found to clean up`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
cleanup();
|