mkctx 2.0.0 โ 3.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/README.md +152 -127
- package/bin/mkctx.js +572 -374
- package/package.json +15 -6
- package/favicon.svg +0 -5
package/README.md
CHANGED
|
@@ -1,85 +1,100 @@
|
|
|
1
|
+
<h1 align="center">mkctx - Make Context</h1>
|
|
2
|
+
|
|
1
3
|
<p align="center">
|
|
2
|
-
<
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="./black-favicon.svg">
|
|
6
|
+
<source media="(prefers-color-scheme: light)" srcset="./white-favicon.svg">
|
|
7
|
+
<img src="./black-favicon.svg" alt="mkctx logo" width="150">
|
|
8
|
+
</picture>
|
|
3
9
|
</p>
|
|
4
10
|
|
|
5
|
-
<h1 align="center">mkctx - Make Context</h1>
|
|
6
|
-
|
|
7
11
|
<p align="center">
|
|
8
|
-
A powerful command-line tool that generates comprehensive markdown context files from your project code, perfect for
|
|
12
|
+
A powerful command-line tool that generates comprehensive markdown context files from your project code, perfect for AI prompts and code analysis.
|
|
9
13
|
</p>
|
|
10
14
|
|
|
11
15
|
<p align="center">
|
|
12
16
|
<a href="https://www.npmjs.com/package/mkctx"><img src="https://img.shields.io/npm/v/mkctx.svg" alt="npm version"></a>
|
|
13
17
|
<a href="https://www.npmjs.com/package/mkctx"><img src="https://img.shields.io/npm/dm/mkctx.svg" alt="npm downloads"></a>
|
|
14
|
-
<a href="https://github.com/
|
|
18
|
+
<a href="https://github.com/pnkkzero/mkctx/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/mkctx.svg" alt="license"></a>
|
|
15
19
|
</p>
|
|
16
20
|
|
|
17
|
-
## Features
|
|
21
|
+
## โจ Features
|
|
18
22
|
|
|
19
23
|
- ๐ **Multi-platform** - Works on Windows, macOS, and Linux
|
|
20
24
|
- ๐ **Smart Ignoring** - Respects custom ignore patterns and common system files
|
|
21
25
|
- โ๏ธ **Configurable** - Customize source directories, output locations, and comments
|
|
22
26
|
- ๐ฏ **AI-Friendly** - Outputs code in markdown format ideal for AI prompts
|
|
23
|
-
- ๐ง **Zero Dependencies** - Pure Node.js, no external dependencies
|
|
24
27
|
- ๐จ **Syntax Highlighting** - Proper language detection for code blocks
|
|
25
28
|
- ๐ **Dynamic Mode** - Interactive path selection when needed
|
|
29
|
+
- ๐ **Context Statistics** - Token estimation and file analysis
|
|
26
30
|
|
|
27
|
-
## Installation
|
|
31
|
+
## ๐ฆ Installation
|
|
28
32
|
|
|
29
33
|
```bash
|
|
30
34
|
npm install -g mkctx
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
### Requirements
|
|
38
|
+
|
|
39
|
+
- **Node.js** 18.0+
|
|
40
|
+
|
|
41
|
+
## ๐ Quick Start
|
|
42
|
+
|
|
43
|
+
### Interactive Mode (Recommended)
|
|
34
44
|
|
|
35
|
-
### Generate context for your project
|
|
36
45
|
```bash
|
|
37
46
|
mkctx
|
|
38
47
|
```
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
This opens an interactive menu where you can:
|
|
50
|
+
1. Generate context from config file or dynamically
|
|
51
|
+
2. View context statistics
|
|
52
|
+
3. Save the context to a file
|
|
53
|
+
|
|
54
|
+
### Create Configuration File
|
|
44
55
|
|
|
45
|
-
### Show help
|
|
46
56
|
```bash
|
|
47
|
-
mkctx
|
|
57
|
+
mkctx config
|
|
48
58
|
```
|
|
49
59
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### Basic Usage
|
|
53
|
-
Run `mkctx` in your project root to generate a `context.md` file containing all your project code:
|
|
60
|
+
### Show Help
|
|
54
61
|
|
|
55
62
|
```bash
|
|
56
|
-
|
|
57
|
-
mkctx
|
|
63
|
+
mkctx help
|
|
58
64
|
```
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
If no configuration file exists, or if `dynamic: true` is set, mkctx will prompt you for the source path:
|
|
66
|
+
## ๐ Usage
|
|
62
67
|
|
|
63
68
|
```
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
70
|
+
โ ๐ mkctx - Make Context โ
|
|
71
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
72
|
+
|
|
73
|
+
? What would you like to do?
|
|
74
|
+
โฏ ๐ Generate from config file
|
|
75
|
+
๐ Generate dynamically (choose path)
|
|
76
|
+
โ๏ธ View configuration
|
|
77
|
+
โ Exit
|
|
67
78
|
```
|
|
68
79
|
|
|
69
|
-
|
|
70
|
-
Create a configuration file to customize behavior:
|
|
80
|
+
After generating context:
|
|
71
81
|
|
|
72
|
-
```
|
|
73
|
-
|
|
82
|
+
```
|
|
83
|
+
๐ Context Summary:
|
|
84
|
+
Files: 42
|
|
85
|
+
Lines: 3,847
|
|
86
|
+
Size: 156.23 KB
|
|
87
|
+
Est. tokens: ~39,058
|
|
88
|
+
|
|
89
|
+
? What would you like to do with this context?
|
|
90
|
+
โฏ ๐พ Save context to file
|
|
91
|
+
๐ Back to main menu
|
|
92
|
+
โ Exit
|
|
74
93
|
```
|
|
75
94
|
|
|
76
|
-
|
|
77
|
-
- `mkctx.config.json` - Configuration file
|
|
78
|
-
- `mkctx/` directory - Output folder (added to .gitignore)
|
|
79
|
-
|
|
80
|
-
## Configuration Options
|
|
95
|
+
## โ๏ธ Configuration
|
|
81
96
|
|
|
82
|
-
|
|
97
|
+
### Project Configuration (`mkctx.config.json`)
|
|
83
98
|
|
|
84
99
|
```json
|
|
85
100
|
{
|
|
@@ -87,156 +102,166 @@ The `mkctx.config.json` file supports the following options:
|
|
|
87
102
|
"ignore": "*.log, temp/, node_modules/, .git/, dist/, build/",
|
|
88
103
|
"output": "./mkctx",
|
|
89
104
|
"first_comment": "/* Project Context */",
|
|
90
|
-
"last_comment": "/* End of Context */"
|
|
91
|
-
"dynamic": false
|
|
105
|
+
"last_comment": "/* End of Context */"
|
|
92
106
|
}
|
|
93
107
|
```
|
|
94
108
|
|
|
95
109
|
| Option | Description | Default |
|
|
96
110
|
|--------|-------------|---------|
|
|
97
|
-
| `src` | Source directory to scan | `"
|
|
98
|
-
| `ignore` | Comma-separated patterns to ignore |
|
|
111
|
+
| `src` | Source directory to scan | `"."` |
|
|
112
|
+
| `ignore` | Comma-separated patterns to ignore | See defaults |
|
|
99
113
|
| `output` | Output directory for context file | `"./mkctx"` |
|
|
100
|
-
| `first_comment` | Comment
|
|
101
|
-
| `last_comment` | Comment
|
|
102
|
-
| `dynamic` | Prompt for path on each run | `false` |
|
|
114
|
+
| `first_comment` | Comment at the beginning | `"/* Project Context */"` |
|
|
115
|
+
| `last_comment` | Comment at the end | `"/* End of Context */"` |
|
|
103
116
|
|
|
104
|
-
##
|
|
117
|
+
## ๐ง CLI Options
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mkctx # Interactive mode (recommended)
|
|
121
|
+
mkctx config # Create configuration file
|
|
122
|
+
mkctx help # Show help message
|
|
123
|
+
mkctx version # Show version
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## ๐ Ignore Patterns
|
|
105
127
|
|
|
106
128
|
mkctx supports several pattern types:
|
|
107
129
|
|
|
108
130
|
- **Wildcards**: `*.log`, `*.test.js`, `*.spec.ts`
|
|
109
131
|
- **Directories**: `temp/`, `dist/`, `build/`
|
|
132
|
+
- **Glob patterns**: `**/.cache/`, `**/node_modules/`
|
|
110
133
|
- **Exact match**: `config.local.json`
|
|
111
134
|
|
|
112
135
|
### Default System Ignores
|
|
113
136
|
|
|
114
137
|
These are always ignored automatically:
|
|
138
|
+
|
|
115
139
|
- `.git`, `.svn`, `.hg`
|
|
116
|
-
- `node_modules`
|
|
140
|
+
- `node_modules`, `__pycache__`
|
|
117
141
|
- `.DS_Store`, `Thumbs.db`
|
|
118
|
-
- `__pycache__`, `.pytest_cache`
|
|
119
142
|
- `.vscode`, `.idea`
|
|
143
|
+
- Binary files, images, archives
|
|
120
144
|
|
|
121
|
-
## Output Format
|
|
145
|
+
## ๐ Output Format
|
|
122
146
|
|
|
123
|
-
The generated `context.md` file contains your project code
|
|
147
|
+
The generated `context.md` file contains your project code:
|
|
124
148
|
|
|
125
149
|
````markdown
|
|
126
150
|
/* Project Context */
|
|
127
151
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
console.log("Hello World!");
|
|
152
|
+
## Project Structure
|
|
153
|
+
|
|
131
154
|
```
|
|
155
|
+
๐ src/
|
|
156
|
+
๐ src/components/
|
|
157
|
+
๐ src/utils/
|
|
132
158
|
|
|
133
|
-
|
|
134
|
-
// src/utils/helpers.ts
|
|
135
|
-
export function helper() {
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
159
|
+
42 files total
|
|
138
160
|
```
|
|
139
161
|
|
|
140
|
-
|
|
141
|
-
````
|
|
162
|
+
## Source Files
|
|
142
163
|
|
|
143
|
-
|
|
164
|
+
### src/index.ts
|
|
144
165
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
{
|
|
148
|
-
"src": "./src",
|
|
149
|
-
"ignore": "*.test.js, __tests__/, *.spec.ts",
|
|
150
|
-
"output": "./docs",
|
|
151
|
-
"first_comment": "/* My App Codebase */"
|
|
152
|
-
}
|
|
153
|
-
```
|
|
166
|
+
```typescript
|
|
167
|
+
import { App } from './app';
|
|
154
168
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
{
|
|
158
|
-
"src": ".",
|
|
159
|
-
"ignore": "node_modules/, .git/, *.md, package-lock.json, yarn.lock",
|
|
160
|
-
"first_comment": "## Project Overview\n\nThis is the complete codebase.",
|
|
161
|
-
"last_comment": "## End of Codebase"
|
|
162
|
-
}
|
|
169
|
+
const app = new App();
|
|
170
|
+
app.start();
|
|
163
171
|
```
|
|
164
172
|
|
|
165
|
-
###
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
### src/utils/helpers.ts
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
export function helper() {
|
|
177
|
+
return true;
|
|
170
178
|
}
|
|
171
179
|
```
|
|
172
180
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
mkctx automatically detects and applies proper syntax highlighting for:
|
|
176
|
-
|
|
177
|
-
- **JavaScript/TypeScript**: `.js`, `.ts`, `.jsx`, `.tsx`, `.mjs`, `.cjs`
|
|
178
|
-
- **Python**: `.py`
|
|
179
|
-
- **Go**: `.go`
|
|
180
|
-
- **Rust**: `.rs`
|
|
181
|
-
- **Java/Kotlin**: `.java`, `.kt`
|
|
182
|
-
- **C/C++**: `.c`, `.cpp`, `.h`, `.hpp`
|
|
183
|
-
- **PHP**: `.php`
|
|
184
|
-
- **Ruby**: `.rb`
|
|
185
|
-
- **Shell**: `.sh`, `.bash`, `.zsh`, `.ps1`
|
|
186
|
-
- **Web**: `.html`, `.css`, `.scss`, `.vue`, `.svelte`
|
|
187
|
-
- **Data**: `.json`, `.yaml`, `.yml`, `.xml`, `.toml`
|
|
188
|
-
- **And many more...**
|
|
189
|
-
|
|
190
|
-
## Use Cases
|
|
191
|
-
|
|
192
|
-
- **AI Pair Programming** - Provide complete context to AI assistants
|
|
193
|
-
- **Code Reviews** - Share project overview with reviewers
|
|
194
|
-
- **Documentation** - Create living documentation of your codebase
|
|
195
|
-
- **Onboarding** - Help new developers understand the project structure
|
|
196
|
-
- **Backup** - Generate searchable archives of your code
|
|
197
|
-
|
|
198
|
-
## Platform Support
|
|
199
|
-
|
|
200
|
-
- โ
**Windows** - Full support
|
|
201
|
-
- โ
**macOS** - Full support
|
|
202
|
-
- โ
**Linux** - Full support
|
|
181
|
+
/* End of Context */
|
|
182
|
+
````
|
|
203
183
|
|
|
204
|
-
##
|
|
184
|
+
## ๐จ Supported Languages
|
|
205
185
|
|
|
206
|
-
|
|
207
|
-
- **npm** (for installation)
|
|
186
|
+
mkctx automatically detects and applies proper syntax highlighting for:
|
|
208
187
|
|
|
209
|
-
|
|
188
|
+
| Category | Extensions |
|
|
189
|
+
|----------|------------|
|
|
190
|
+
| **JavaScript/TypeScript** | `.js`, `.ts`, `.jsx`, `.tsx`, `.mjs`, `.cjs` |
|
|
191
|
+
| **Python** | `.py`, `.pyw` |
|
|
192
|
+
| **Go** | `.go` |
|
|
193
|
+
| **Rust** | `.rs` |
|
|
194
|
+
| **Java/Kotlin** | `.java`, `.kt`, `.scala` |
|
|
195
|
+
| **C/C++** | `.c`, `.cpp`, `.h`, `.hpp` |
|
|
196
|
+
| **PHP** | `.php` |
|
|
197
|
+
| **Ruby** | `.rb`, `.rake` |
|
|
198
|
+
| **Shell** | `.sh`, `.bash`, `.zsh`, `.ps1` |
|
|
199
|
+
| **Web** | `.html`, `.css`, `.scss`, `.vue`, `.svelte` |
|
|
200
|
+
| **Data** | `.json`, `.yaml`, `.yml`, `.xml`, `.toml` |
|
|
201
|
+
| **And many more...** | `.sql`, `.graphql`, `.proto`, `.prisma`, `.sol` |
|
|
202
|
+
|
|
203
|
+
## ๐ก Use Cases
|
|
204
|
+
|
|
205
|
+
- **๐ค AI Code Analysis** - Feed your codebase to ChatGPT, Claude, or other AI tools
|
|
206
|
+
- **๐ Code Understanding** - Share project overview for quick understanding
|
|
207
|
+
- **๐ฅ Code Reviews** - Share project overview with reviewers
|
|
208
|
+
- **๐ Onboarding** - Help new developers understand the project
|
|
209
|
+
- **๐ Documentation** - Generate a snapshot of your codebase
|
|
210
|
+
|
|
211
|
+
## ๐ฅ๏ธ Platform Support
|
|
212
|
+
|
|
213
|
+
| Platform | Status |
|
|
214
|
+
|----------|--------|
|
|
215
|
+
| **macOS** | โ
Full support |
|
|
216
|
+
| **Linux** | โ
Full support |
|
|
217
|
+
| **Windows** | โ
Full support |
|
|
218
|
+
|
|
219
|
+
## ๐ง Troubleshooting
|
|
220
|
+
|
|
221
|
+
### Command Not Found
|
|
210
222
|
|
|
211
|
-
### Command not found
|
|
212
223
|
If `mkctx` is not found after installation:
|
|
224
|
+
|
|
213
225
|
1. Make sure npm global bin is in your PATH
|
|
214
226
|
2. Try: `npm bin -g` to see where global packages are installed
|
|
215
227
|
3. Restart your terminal
|
|
216
228
|
|
|
217
|
-
### Permission
|
|
229
|
+
### Permission Errors (Unix)
|
|
230
|
+
|
|
218
231
|
```bash
|
|
219
232
|
sudo npm install -g mkctx
|
|
220
233
|
```
|
|
221
234
|
|
|
222
235
|
Or fix npm permissions: https://docs.npmjs.com/resolving-eacces-permissions-errors
|
|
223
236
|
|
|
224
|
-
## Changelog
|
|
237
|
+
## ๐ Changelog
|
|
238
|
+
|
|
239
|
+
### v3.0.0
|
|
240
|
+
|
|
241
|
+
- ๐ฏ Simplified to focus on context generation
|
|
242
|
+
- ๐๏ธ Removed Ollama chat integration
|
|
243
|
+
- โก Faster startup and smaller footprint
|
|
244
|
+
- ๐งน Cleaner codebase
|
|
245
|
+
|
|
246
|
+
### v2.x
|
|
225
247
|
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
- Added dynamic mode for interactive path selection
|
|
229
|
-
- Improved language detection
|
|
230
|
-
- Better ignore pattern handling
|
|
231
|
-
- Zero external dependencies
|
|
248
|
+
- Ollama AI chat integration (removed in v3)
|
|
249
|
+
- Interactive chat interface
|
|
232
250
|
|
|
233
251
|
### v1.x
|
|
252
|
+
|
|
234
253
|
- Initial Go-based implementation
|
|
235
254
|
|
|
236
|
-
## Contributing
|
|
255
|
+
## ๐ค Contributing
|
|
237
256
|
|
|
238
257
|
Contributions are welcome! Please feel free to submit pull requests or open issues.
|
|
239
258
|
|
|
240
|
-
## License
|
|
259
|
+
## ๐ License
|
|
241
260
|
|
|
242
261
|
MIT License - see [LICENSE](LICENSE) file for details.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
<p align="center">
|
|
266
|
+
Made with โค๏ธ for developers who love AI-assisted coding
|
|
267
|
+
</p>
|