kodu 1.1.21 → 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.
Files changed (129) hide show
  1. package/AGENTS.md +36 -68
  2. package/README.md +97 -96
  3. package/dist/package.json +1 -2
  4. package/dist/src/app.module.js +0 -8
  5. package/dist/src/app.module.js.map +1 -1
  6. package/dist/src/commands/init/init.command.d.ts +2 -9
  7. package/dist/src/commands/init/init.command.js +15 -241
  8. package/dist/src/commands/init/init.command.js.map +1 -1
  9. package/dist/src/commands/pack/pack.command.d.ts +9 -0
  10. package/dist/src/commands/pack/pack.command.js +72 -3
  11. package/dist/src/commands/pack/pack.command.js.map +1 -1
  12. package/dist/src/core/config/config.schema.d.ts +0 -46
  13. package/dist/src/core/config/config.schema.js +1 -51
  14. package/dist/src/core/config/config.schema.js.map +1 -1
  15. package/dist/src/core/config/config.service.js +2 -2
  16. package/dist/src/core/config/config.service.js.map +1 -1
  17. package/dist/src/core/config/prompt.service.d.ts +1 -4
  18. package/dist/src/core/config/prompt.service.js +4 -17
  19. package/dist/src/core/config/prompt.service.js.map +1 -1
  20. package/dist/src/core/file-system/fs.service.d.ts +1 -0
  21. package/dist/src/core/file-system/fs.service.js +4 -1
  22. package/dist/src/core/file-system/fs.service.js.map +1 -1
  23. package/dist/src/shared/constants.d.ts +0 -4
  24. package/dist/src/shared/constants.js +1 -5
  25. package/dist/src/shared/constants.js.map +1 -1
  26. package/dist/src/shared/git/git.module.js +0 -2
  27. package/dist/src/shared/git/git.module.js.map +1 -1
  28. package/dist/src/shared/git/git.service.d.ts +0 -8
  29. package/dist/src/shared/git/git.service.js +2 -34
  30. package/dist/src/shared/git/git.service.js.map +1 -1
  31. package/dist/src/shared/tokenizer/tokenizer.module.js +0 -2
  32. package/dist/src/shared/tokenizer/tokenizer.module.js.map +1 -1
  33. package/dist/src/shared/tokenizer/tokenizer.service.d.ts +0 -6
  34. package/dist/src/shared/tokenizer/tokenizer.service.js +8 -38
  35. package/dist/src/shared/tokenizer/tokenizer.service.js.map +1 -1
  36. package/dist/tsconfig.build.tsbuildinfo +1 -1
  37. package/kodu.schema.json +0 -139
  38. package/package.json +1 -2
  39. package/skills/kodu-ops/SKILL.md +184 -0
  40. package/src/app.module.ts +0 -8
  41. package/src/commands/init/init.command.ts +15 -310
  42. package/src/commands/pack/pack.command.ts +66 -3
  43. package/src/core/config/config.schema.ts +1 -68
  44. package/src/core/config/config.service.ts +2 -2
  45. package/src/core/config/prompt.service.ts +4 -26
  46. package/src/core/file-system/fs.service.ts +7 -1
  47. package/src/shared/constants.ts +0 -4
  48. package/src/shared/git/git.module.ts +0 -2
  49. package/src/shared/git/git.service.ts +1 -33
  50. package/src/shared/tokenizer/tokenizer.module.ts +0 -2
  51. package/src/shared/tokenizer/tokenizer.service.ts +9 -39
  52. package/.kodu/prompts/.keep +0 -0
  53. package/.kodu/prompts/commit.md +0 -9
  54. package/.kodu/prompts/pack.md +0 -7
  55. package/.kodu/prompts/review-bug.md +0 -6
  56. package/.kodu/prompts/review-security.md +0 -6
  57. package/.kodu/prompts/review-style.md +0 -6
  58. package/.opencode/command/openspec-apply.md +0 -24
  59. package/.opencode/command/openspec-archive.md +0 -27
  60. package/.opencode/command/openspec-proposal.md +0 -29
  61. package/.opencode/skills/kodu-ops/SKILL.md +0 -60
  62. package/dist/src/commands/commit/commit.command.d.ts +0 -18
  63. package/dist/src/commands/commit/commit.command.js +0 -149
  64. package/dist/src/commands/commit/commit.command.js.map +0 -1
  65. package/dist/src/commands/commit/commit.module.d.ts +0 -2
  66. package/dist/src/commands/commit/commit.module.js +0 -25
  67. package/dist/src/commands/commit/commit.module.js.map +0 -1
  68. package/dist/src/commands/ops/ops.command.d.ts +0 -4
  69. package/dist/src/commands/ops/ops.command.js +0 -39
  70. package/dist/src/commands/ops/ops.command.js.map +0 -1
  71. package/dist/src/commands/ops/ops.module.d.ts +0 -2
  72. package/dist/src/commands/ops/ops.module.js +0 -33
  73. package/dist/src/commands/ops/ops.module.js.map +0 -1
  74. package/dist/src/commands/ops/ops.types.d.ts +0 -13
  75. package/dist/src/commands/ops/ops.types.js +0 -12
  76. package/dist/src/commands/ops/ops.types.js.map +0 -1
  77. package/dist/src/commands/ops/ops.utils.d.ts +0 -13
  78. package/dist/src/commands/ops/ops.utils.js +0 -121
  79. package/dist/src/commands/ops/ops.utils.js.map +0 -1
  80. package/dist/src/commands/ops/subcommands/ops-env.command.d.ts +0 -24
  81. package/dist/src/commands/ops/subcommands/ops-env.command.js +0 -156
  82. package/dist/src/commands/ops/subcommands/ops-env.command.js.map +0 -1
  83. package/dist/src/commands/ops/subcommands/ops-routes.command.d.ts +0 -22
  84. package/dist/src/commands/ops/subcommands/ops-routes.command.js +0 -203
  85. package/dist/src/commands/ops/subcommands/ops-routes.command.js.map +0 -1
  86. package/dist/src/commands/ops/subcommands/ops-service.command.d.ts +0 -22
  87. package/dist/src/commands/ops/subcommands/ops-service.command.js +0 -169
  88. package/dist/src/commands/ops/subcommands/ops-service.command.js.map +0 -1
  89. package/dist/src/commands/ops/subcommands/ops-sysinfo.command.d.ts +0 -14
  90. package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js +0 -75
  91. package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js.map +0 -1
  92. package/dist/src/commands/review/review.command.d.ts +0 -26
  93. package/dist/src/commands/review/review.command.js +0 -205
  94. package/dist/src/commands/review/review.command.js.map +0 -1
  95. package/dist/src/commands/review/review.module.d.ts +0 -2
  96. package/dist/src/commands/review/review.module.js +0 -26
  97. package/dist/src/commands/review/review.module.js.map +0 -1
  98. package/dist/src/core/config/default-prompts.d.ts +0 -9
  99. package/dist/src/core/config/default-prompts.js +0 -49
  100. package/dist/src/core/config/default-prompts.js.map +0 -1
  101. package/dist/src/shared/ai/ai.module.d.ts +0 -2
  102. package/dist/src/shared/ai/ai.module.js +0 -23
  103. package/dist/src/shared/ai/ai.module.js.map +0 -1
  104. package/dist/src/shared/ai/ai.service.d.ts +0 -22
  105. package/dist/src/shared/ai/ai.service.js +0 -164
  106. package/dist/src/shared/ai/ai.service.js.map +0 -1
  107. package/dist/src/shared/ssh/ssh.module.d.ts +0 -2
  108. package/dist/src/shared/ssh/ssh.module.js +0 -21
  109. package/dist/src/shared/ssh/ssh.module.js.map +0 -1
  110. package/dist/src/shared/ssh/ssh.service.d.ts +0 -11
  111. package/dist/src/shared/ssh/ssh.service.js +0 -53
  112. package/dist/src/shared/ssh/ssh.service.js.map +0 -1
  113. package/src/commands/commit/commit.command.ts +0 -139
  114. package/src/commands/commit/commit.module.ts +0 -12
  115. package/src/commands/ops/ops.command.ts +0 -30
  116. package/src/commands/ops/ops.module.ts +0 -20
  117. package/src/commands/ops/ops.types.ts +0 -24
  118. package/src/commands/ops/ops.utils.ts +0 -160
  119. package/src/commands/ops/subcommands/ops-env.command.ts +0 -165
  120. package/src/commands/ops/subcommands/ops-routes.command.ts +0 -221
  121. package/src/commands/ops/subcommands/ops-service.command.ts +0 -190
  122. package/src/commands/ops/subcommands/ops-sysinfo.command.ts +0 -77
  123. package/src/commands/review/review.command.ts +0 -199
  124. package/src/commands/review/review.module.ts +0 -13
  125. package/src/core/config/default-prompts.ts +0 -53
  126. package/src/shared/ai/ai.module.ts +0 -10
  127. package/src/shared/ai/ai.service.ts +0 -216
  128. package/src/shared/ssh/ssh.module.ts +0 -8
  129. package/src/shared/ssh/ssh.service.ts +0 -61
package/AGENTS.md CHANGED
@@ -4,11 +4,10 @@ This file provides guidelines and instructions for AI assistants working on the
4
4
 
5
5
  ## 1. Project Overview
6
6
 
7
- **Kodu** is a high-performance CLI utility that bridges local development environments with LLMs. It automates context preparation, code cleaning, reviews, and commit drafting.
7
+ **Kodu** is a high-performance CLI utility that bridges local development environments with LLMs. It automates context preparation and code cleaning.
8
8
 
9
9
  - **Key Goals:** Speed (<0.5s startup), Determinism (no AI for critical file ops), DX (Developer Experience)
10
- - **Current Phase:** Phase 4 - AI Integration with Mastra/Git
11
- - **Available Commands:** `init`, `pack`, `clean`, `review`, `commit`, `ops`
10
+ - **Available Commands:** `pack`, `clean`
12
11
 
13
12
  ## 2. Technology Stack (Enforced)
14
13
 
@@ -18,10 +17,8 @@ This file provides guidelines and instructions for AI assistants working on the
18
17
  | File System | node:fs/promises + tinyglobby | fs-extra, glob, rimraf |
19
18
  | Config | lilconfig | cosmiconfig, rc |
20
19
  | Validation | zod | class-validator, joi |
21
- | Process/Git | execa | child_process, shelljs |
22
20
  | CLI UI | @inquirer/prompts + picocolors | inquirer (legacy), chalk |
23
21
  | Spinners | yocto-spinner | ora, cli-spinners |
24
- | AI Agent | mastra | Direct openai SDK |
25
22
  | AST/Parsing | ts-morph | Regex, babel |
26
23
  | Tokens | js-tiktoken | gpt-3-encoder |
27
24
  | Clipboard | clipboardy | Native APIs |
@@ -39,16 +36,10 @@ src/
39
36
  ├── shared/ # Shared Business Logic
40
37
  │ ├── tokenizer/ # TokenizerModule
41
38
  │ ├── git/ # GitModule
42
- │ ├── ai/ # AiModule (Mastra)
43
39
  │ └── cleaner/ # CleanerService (AST)
44
- │ └── ssh/ # SshModule (remote ops via SSH)
45
40
  └── commands/ # Feature Commands
46
- ├── init/ # kodu init
47
41
  ├── pack/ # kodu pack
48
- ├── clean/ # kodu clean
49
- ├── review/ # kodu review
50
- ├── commit/ # kodu commit
51
- └── ops/ # kodu ops <subcommand>
42
+ └── clean/ # kodu clean
52
43
  ```
53
44
 
54
45
  ## 4. Build, Lint & Test Commands
@@ -70,26 +61,6 @@ npm run lint:fix # Biome with auto-fix
70
61
 
71
62
  # Full check (required before commit)
72
63
  npm run check # TypeCheck + Biome + Knip
73
-
74
- # Run tests (if configured)
75
- npm test # Run all tests
76
- npm test -- <pattern> # Run tests matching pattern
77
- npm test -- --testPathPattern=<pattern> # Alternative
78
- ```
79
-
80
- ### Running a Single Test
81
- ```bash
82
- # By file name
83
- npm test -- filename
84
-
85
- # By pattern
86
- npm test -- --testNamePattern="test name"
87
-
88
- # Watch mode
89
- npm test -- --watch
90
-
91
- # With coverage
92
- npm test -- --coverage
93
64
  ```
94
65
 
95
66
  ## 5. Code Style Guidelines
@@ -136,10 +107,6 @@ npm test -- --coverage
136
107
 
137
108
  ```json
138
109
  {
139
- "llm": {
140
- "model": "openai/gpt-4o",
141
- "apiKeyEnv": "OPENAI_API_KEY"
142
- },
143
110
  "cleaner": {
144
111
  "whitelist": ["//!"],
145
112
  "keepJSDoc": true,
@@ -148,48 +115,50 @@ npm test -- --coverage
148
115
  "packer": {
149
116
  "ignore": ["*.lock", "node_modules", "dist"],
150
117
  "useGitignore": true
151
- },
152
- "ops": {
153
- "servers": {
154
- "dev": {
155
- "host": "example.com",
156
- "port": 22,
157
- "user": "ubuntu",
158
- "sshKeyPath": "~/.ssh/id_rsa",
159
- "paths": {
160
- "apps": "/var/agent-apps",
161
- "caddy": "/var/agent-apps/caddy"
162
- }
163
- }
164
- }
165
118
  }
166
119
  }
167
120
  ```
168
121
 
169
- - Model format: `provider/model-name` (e.g., `openai/gpt-4o`, `anthropic/claude-4-5-sonnet`)
170
- - API keys from env vars only (never store in config)
171
122
  - Config validated via Zod on startup
123
+ - `kodu.json` must be in current working directory
172
124
 
173
125
  ## 7. Commands Reference
174
126
 
175
- | Command | Description | Key Options |
176
- |---------|-------------|-------------|
177
- | `kodu init` | Interactive setup wizard | - |
178
- | `kodu pack` | Bundle files for LLM | `--copy`, `--template`, `--out` |
179
- | `kodu clean` | Remove comments (AST-based) | `--dry-run` |
180
- | `kodu review` | AI code review | `--mode`, `--ci`, `--output` |
181
- | `kodu commit` | Generate commit message | `--ci`, `--output` |
182
- | `kodu ops` | Remote server operations over SSH (JSON-only) | `sysinfo`, `env`, `routes`, `service` |
127
+ ### `kodu init`
128
+
129
+ Add `.kodu/context.txt` to `.gitignore` (if `.gitignore` exists). Run once after cloning or setting up a project.
130
+
131
+ ### `kodu pack`
132
+
133
+ Bundle project files into a single context file for LLMs.
134
+
135
+ | Option | Description |
136
+ |--------|-------------|
137
+ | `-c, --copy` | Copy result to clipboard |
138
+ | `-o, --out <path>` | Path to save result (default: `.kodu/context.txt`) |
139
+ | `-p, --path <path>` | Directory or glob to include (repeatable) |
140
+ | `-e, --exclude <pattern>` | Additional exclude pattern (repeatable) |
141
+ | `-l, --list` | Print file list only, without content |
142
+ | `-f, --format <format>` | Output format: `xml` (default) or `text` |
143
+ | `-t, --template <name>` | Template name from `.kodu/prompts` |
144
+
145
+ Output format `xml` wraps each file in `<file path="...">` tags — recommended for LLM consumption. Format `text` uses `// file: ...` header comments.
146
+
147
+ ### `kodu clean`
148
+
149
+ Remove comments from source files using AST-based parsing (deterministic, no AI).
150
+
151
+ | Option | Description |
152
+ |--------|-------------|
153
+ | `-d, --dry-run` | Show what will be removed without modifying files |
154
+ | `-c, --changed` | Clean only git-changed files |
183
155
 
184
156
  ## 8. Critical Constraints
185
157
 
186
- 1. **No AI in Cleaner:** `clean` command is deterministic (AST-based), never AI-generated
158
+ 1. **No AI:** Both commands are deterministic no AI integration
187
159
  2. **Validation First:** Invalid `kodu.json` causes graceful crash with Zod error
188
- 3. **Secrets:** Never commit secrets. API keys from env vars only
189
- 4. **Performance:** Mindful of import costs. Use lightweight libraries
190
- 5. **Git Preconditions:** AI commands require git repo with staged changes
191
- 6. **Config Location:** `kodu.json` must be in current working directory
192
- 7. **AgentOps Output Contract:** `kodu ops` commands must return strict JSON (no spinners/colors/prompts)
160
+ 3. **Performance:** Mindful of import costs. Use lightweight libraries
161
+ 4. **Config Location:** `kodu.json` must be in current working directory
193
162
 
194
163
  ## 9. Development Workflow
195
164
 
@@ -199,7 +168,7 @@ npm test -- --coverage
199
168
  3. Implement `run()` extending `CommandRunner`
200
169
  4. Decorate with `@Command()` from `nest-commander`
201
170
  5. Register module in `app.module.ts`
202
- 6. Test: `npm run build && node dist/main.js <name>`
171
+ 6. Test: `npm run build && node dist/src/main.js <name>`
203
172
 
204
173
  ### Before Commit
205
174
  Always run:
@@ -214,7 +183,6 @@ This executes: TypeScript check + Biome lint + Knip dead code detection.
214
183
  - **Primary Gate:** Static analysis (TypeScript + Biome + Knip)
215
184
  - **No Legacy Tests:** Project relies on strict static typing
216
185
  - If tests exist: place in `__tests__/` or `*.test.ts` files
217
- - Use Vitest or Jest (check package.json for actual test runner)
218
186
 
219
187
  ## 11. Handling Uncertainties
220
188
 
package/README.md CHANGED
@@ -1,171 +1,172 @@
1
1
  <div align="center">
2
2
 
3
- # Kodu 🦄
3
+ # Kodu
4
4
 
5
- **The AI-First CLI for Modern Developers**
6
-
7
- Generate contexts, clean code, review PRs, draft commits, and run remote ops—instantly.
5
+ **Bundle your codebase for LLMs. Strip noise. Ship faster.**
8
6
 
9
7
  [![npm version](https://img.shields.io/npm/v/kodu?style=flat-square&color=black)](https://www.npmjs.com/package/kodu)
10
8
  [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&color=black)](LICENSE)
11
- [![Privacy](https://img.shields.io/badge/Privacy-First-green.svg?style=flat-square)](https://github.com/uxname/kodu)
12
9
 
13
10
  </div>
14
11
 
15
12
  ---
16
13
 
17
- ## The Problem vs. Kodu
14
+ ## What it does
18
15
 
19
- | You (Manual) ❌ | Kodu (Automated) ✅ |
16
+ | Problem | Kodu |
20
17
  | :--- | :--- |
21
- | Copy-pasting 10 files one by one | **`kodu pack`** bundles context in 1 click |
22
- | Hitting token limits with comments | **`kodu clean`** strips noise deterministically |
23
- | Context switching for code reviews | **`kodu review`** checks logic inside your terminal |
24
- | Writing boring commit messages | **`kodu commit`** generates semantic git messages |
25
- | SSHing around servers manually | **`kodu ops`** runs machine-readable remote operations |
18
+ | Copy-pasting files one by one into ChatGPT | `kodu pack` bundles your entire project in one command |
19
+ | Hitting token limits with comments and docs | `kodu clean` strips comments deterministically via AST |
26
20
 
27
21
  ---
28
22
 
29
- ## 🚀 Instant Start
30
-
31
- Don't want to install? Run it directly:
23
+ ## Install
32
24
 
33
25
  ```bash
34
- # 1. Initialize config (creates kodu.json)
35
- npx kodu init
36
-
37
- # 2. Bundle your project to clipboard
38
- npx kodu pack --copy
26
+ npm install -g kodu
39
27
  ```
40
28
 
41
- **Or install globally for speed (<0.5s startup):**
29
+ Or run without installing:
42
30
 
43
31
  ```bash
44
- npm install -g kodu
32
+ npx kodu pack --copy
45
33
  ```
46
34
 
47
35
  ---
48
36
 
49
- ## 🛡️ Privacy & Security
37
+ ## kodu init
50
38
 
51
- We know trust is paramount when dealing with code.
39
+ Add `.kodu/context.txt` to `.gitignore` so generated context files are never committed:
52
40
 
53
- * **Local Execution:** Code analysis runs locally.
54
- * **Zero Data Retention:** We don't store your code.
55
- * **Explicit Control:** `.env`, `node_modules`, and lockfiles are ignored by default.
56
- * **You Own the Keys:** Your API key (`OPENAI_API_KEY`) goes directly to the provider.
41
+ ```bash
42
+ kodu init
43
+ ```
44
+
45
+ Run once after cloning or setting up the project.
57
46
 
58
47
  ---
59
48
 
60
- ## 💡 Common Workflows
49
+ ## kodu pack
61
50
 
62
- ### 1. "I need to ask ChatGPT about my project"
63
- Pack your entire source code (minus ignored files) into the clipboard, optimized for tokens.
51
+ Bundle project files into a single context file optimized for LLMs.
64
52
 
65
53
  ```bash
54
+ # Pack everything and copy to clipboard
66
55
  kodu pack --copy
67
- # Output: Copied 45 files (12k tokens) to clipboard. Paste into ChatGPT!
68
- ```
69
56
 
70
- ### 2. "I want to save money on API costs"
71
- Strip comments and docs to reduce token count by ~30% before sending.
57
+ # Pack only specific directories
58
+ kodu pack --path src --path tests --copy
72
59
 
73
- ```bash
74
- # Preview savings
75
- kodu clean --dry-run
60
+ # Just see what files would be included
61
+ kodu pack --list
76
62
 
77
- # Clean only what you changed (Great for PRs)
78
- kodu clean --changed
63
+ # Exclude extra patterns on the fly
64
+ kodu pack --exclude "**/*.test.ts" --exclude "docs/" --copy
65
+
66
+ # Save to a custom path
67
+ kodu pack --out /tmp/context.txt
68
+
69
+ # Use plain text format instead of XML
70
+ kodu pack --format text --copy
79
71
  ```
80
72
 
81
- ### 3. "Check my code before I push"
82
- Get an AI review of your **staged** changes without leaving the terminal.
73
+ ### Output format
83
74
 
84
- ```bash
85
- # Detect bugs and logical errors
86
- kodu review --mode bug
75
+ By default, kodu wraps each file in XML tags — the format that LLMs parse most reliably:
76
+
77
+ ```xml
78
+ <files>
79
+ <file path="src/index.ts">
80
+ // your code here
81
+ </file>
87
82
 
88
- # Check for security leaks
89
- kodu review --mode security
83
+ <file path="src/utils.ts">
84
+ // more code
85
+ </file>
86
+ </files>
90
87
  ```
91
88
 
92
- ### 4. "I need my agent to inspect a server"
93
- Run remote diagnostics and operations via `kodu ops` with strict JSON output.
89
+ Use `--format text` for legacy `// file: path` style headers.
90
+
91
+ ### Options
92
+
93
+ | Flag | Description |
94
+ |------|-------------|
95
+ | `-c, --copy` | Copy result to clipboard |
96
+ | `-o, --out <path>` | Output file path (default: `.kodu/context.txt`) |
97
+ | `-p, --path <path>` | Include only this directory/glob (repeatable) |
98
+ | `-e, --exclude <pattern>` | Additional exclude pattern (repeatable) |
99
+ | `-l, --list` | Print file list only, no content |
100
+ | `-f, --format <xml\|text>` | Output format (default: `xml`) |
101
+ | `-t, --template <name>` | Wrap output in a prompt template from `.kodu/prompts/` |
102
+
103
+ ---
104
+
105
+ ## kodu clean
106
+
107
+ Remove comments from source files using AST-based parsing. No AI, fully deterministic.
94
108
 
95
109
  ```bash
96
- # Server health snapshot
97
- kodu ops sysinfo dev
110
+ # Preview what would be removed
111
+ kodu clean --dry-run
98
112
 
99
- # Manage app env vars remotely
100
- kodu ops env dev set my-app --key NODE_ENV --val production
113
+ # Clean only git-changed files (great before committing)
114
+ kodu clean --changed
101
115
 
102
- # Read Caddy routes (raw Caddyfile)
103
- kodu ops routes dev list
116
+ # Clean all project files
117
+ kodu clean
104
118
  ```
105
119
 
106
- ---
120
+ Supports `.ts`, `.tsx`, `.js`, `.jsx`, `.html`. Respects `cleaner.whitelist` in `kodu.json` (e.g. `//!` to preserve important comments).
107
121
 
108
- ## ⚙️ Configuration
122
+ ---
109
123
 
110
- Kodu creates a `kodu.json` in your root. It's pre-configured, but fully hackable.
124
+ ## Configuration
111
125
 
112
- <details>
113
- <summary><b>Click to see example configuration</b></summary>
126
+ Create `kodu.json` in your project root:
114
127
 
115
128
  ```json
116
129
  {
117
- "llm": {
118
- "model": "openai/gpt-4o",
119
- "apiKeyEnv": "OPENAI_API_KEY"
120
- },
121
130
  "cleaner": {
122
- // Kodu will NEVER remove comments starting with these:
123
- "whitelist": ["//!"]
131
+ "whitelist": ["//!"],
132
+ "keepJSDoc": true,
133
+ "useGitignore": true
124
134
  },
125
135
  "packer": {
126
- "ignore": ["package-lock.json", "dist", "coverage"]
127
- },
128
- "ops": {
129
- "servers": {
130
- "dev": {
131
- "host": "example.com",
132
- "port": 22,
133
- "user": "ubuntu",
134
- "sshKeyPath": "~/.ssh/id_rsa",
135
- "paths": {
136
- "apps": "/var/agent-apps",
137
- "caddy": "/var/agent-apps/caddy"
138
- }
139
- }
140
- }
141
- },
136
+ "ignore": ["package-lock.json", "dist", "coverage"],
137
+ "useGitignore": true
138
+ }
139
+ }
140
+ ```
141
+
142
+ Both commands work without a config file using sensible defaults.
143
+
144
+ ### Custom pack template
145
+
146
+ Point `prompts.pack` at a markdown file to wrap packed context in a prompt:
147
+
148
+ ```json
149
+ {
142
150
  "prompts": {
143
- "review": {
144
- "bug": ".kodu/prompts/review-bug.md"
145
- }
151
+ "pack": ".kodu/prompts/pack.md"
146
152
  }
147
153
  }
148
154
  ```
149
155
 
150
- `kodu ops` is designed for agents: responses are strict JSON (including errors), with no spinner/colors/prompts.
151
- </details>
156
+ Available template variables: `{{context}}`, `{{fileList}}`, `{{tokenCount}}`, `{{usdEstimate}}`.
152
157
 
153
158
  ---
154
159
 
155
- ## 🏎️ Tech Stack (Fresh & Modern)
156
-
157
- Built for speed and maintainability.
160
+ ## Privacy
158
161
 
159
- * **Runtime:** Node.js (ESM)
160
- * **Framework:** NestJS + Commander
161
- * **Parsing:** `ts-morph` (AST-based, not Regex)
162
- * **Globbing:** `tinyglobby`
163
- * **UI:** `@inquirer` + `yocto-spinner`
162
+ - All processing runs locally
163
+ - No data sent anywhere
164
+ - API keys are never stored — only read from env vars
164
165
 
165
166
  ---
166
167
 
167
168
  <div align="center">
168
- <sub>Built with ❤️ for productive developers.</sub>
169
+ <sub>Built for productive developers.</sub>
169
170
  <br>
170
171
  <a href="CONTRIBUTING.md">Contributing</a> • <a href="LICENSE">License</a>
171
172
  </div>
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodu",
3
- "version": "1.1.21",
3
+ "version": "2.0.0",
4
4
  "description": "High-performance CLI to prepare codebase for LLMs, automate reviews, and draft commits.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,6 @@
50
50
  "@inquirer/confirm": "^6.0.4",
51
51
  "@inquirer/input": "^5.0.4",
52
52
  "@inquirer/select": "^5.0.4",
53
- "@mastra/core": "^1.0.4",
54
53
  "@nestjs/common": "^11.0.1",
55
54
  "@nestjs/core": "^11.0.1",
56
55
  "clipboardy": "^5.0.2",
@@ -9,15 +9,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.AppModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const clean_module_1 = require("./commands/clean/clean.module");
12
- const commit_module_1 = require("./commands/commit/commit.module");
13
12
  const init_module_1 = require("./commands/init/init.module");
14
- const ops_module_1 = require("./commands/ops/ops.module");
15
13
  const pack_module_1 = require("./commands/pack/pack.module");
16
- const review_module_1 = require("./commands/review/review.module");
17
14
  const config_module_1 = require("./core/config/config.module");
18
15
  const fs_module_1 = require("./core/file-system/fs.module");
19
16
  const ui_module_1 = require("./core/ui/ui.module");
20
- const ai_module_1 = require("./shared/ai/ai.module");
21
17
  const git_module_1 = require("./shared/git/git.module");
22
18
  const tokenizer_module_1 = require("./shared/tokenizer/tokenizer.module");
23
19
  let AppModule = class AppModule {
@@ -30,14 +26,10 @@ exports.AppModule = AppModule = __decorate([
30
26
  ui_module_1.UiModule,
31
27
  fs_module_1.FsModule,
32
28
  git_module_1.GitModule,
33
- ai_module_1.AiModule,
34
29
  tokenizer_module_1.TokenizerModule,
35
30
  init_module_1.InitModule,
36
31
  pack_module_1.PackModule,
37
32
  clean_module_1.CleanModule,
38
- review_module_1.ReviewModule,
39
- commit_module_1.CommitModule,
40
- ops_module_1.OpsModule,
41
33
  ],
42
34
  })
43
35
  ], AppModule);
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,gEAA4D;AAC5D,mEAA+D;AAC/D,6DAAyD;AACzD,0DAAsD;AACtD,6DAAyD;AACzD,mEAA+D;AAC/D,+DAA2D;AAC3D,4DAAwD;AACxD,mDAA+C;AAC/C,qDAAiD;AACjD,wDAAoD;AACpD,0EAAsE;AAkB/D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAhBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,oBAAQ;YACR,oBAAQ;YACR,sBAAS;YACT,oBAAQ;YACR,kCAAe;YACf,wBAAU;YACV,wBAAU;YACV,0BAAW;YACX,4BAAY;YACZ,4BAAY;YACZ,sBAAS;SACV;KACF,CAAC;GACW,SAAS,CAAG"}
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,gEAA4D;AAC5D,6DAAyD;AACzD,6DAAyD;AACzD,+DAA2D;AAC3D,4DAAwD;AACxD,mDAA+C;AAC/C,wDAAoD;AACpD,0EAAsE;AAc/D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAZrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,oBAAQ;YACR,oBAAQ;YACR,sBAAS;YACT,kCAAe;YACf,wBAAU;YACV,wBAAU;YACV,0BAAW;SACZ;KACF,CAAC;GACW,SAAS,CAAG"}
@@ -4,13 +4,6 @@ export declare class InitCommand extends CommandRunner {
4
4
  private readonly ui;
5
5
  constructor(ui: UiService);
6
6
  run(): Promise<void>;
7
- private buildModelQuestion;
8
- private askIgnoreList;
9
- private mergeWhitelist;
10
- private writeConfig;
11
- private ensurePromptFiles;
12
- private buildPromptPaths;
13
- private writePromptIfMissing;
14
- private ensureGitignore;
15
- private fileExists;
7
+ private updateGitignore;
8
+ private exists;
16
9
  }