devmind 1.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 (141) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +148 -0
  3. package/dist/cli.d.ts +6 -0
  4. package/dist/cli.js +232 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/codebase/generators/architecture.d.ts +4 -0
  7. package/dist/codebase/generators/architecture.js +33 -0
  8. package/dist/codebase/generators/architecture.js.map +1 -0
  9. package/dist/codebase/generators/modules.d.ts +9 -0
  10. package/dist/codebase/generators/modules.js +46 -0
  11. package/dist/codebase/generators/modules.js.map +1 -0
  12. package/dist/codebase/generators/overview.d.ts +5 -0
  13. package/dist/codebase/generators/overview.js +34 -0
  14. package/dist/codebase/generators/overview.js.map +1 -0
  15. package/dist/codebase/generators/skeleton.d.ts +8 -0
  16. package/dist/codebase/generators/skeleton.js +57 -0
  17. package/dist/codebase/generators/skeleton.js.map +1 -0
  18. package/dist/codebase/index.d.ts +24 -0
  19. package/dist/codebase/index.js +50 -0
  20. package/dist/codebase/index.js.map +1 -0
  21. package/dist/codebase/parsers/typescript.d.ts +14 -0
  22. package/dist/codebase/parsers/typescript.js +145 -0
  23. package/dist/codebase/parsers/typescript.js.map +1 -0
  24. package/dist/codebase/scanners/filesystem.d.ts +17 -0
  25. package/dist/codebase/scanners/filesystem.js +152 -0
  26. package/dist/codebase/scanners/filesystem.js.map +1 -0
  27. package/dist/codebase/utils/hashing.d.ts +15 -0
  28. package/dist/codebase/utils/hashing.js +50 -0
  29. package/dist/codebase/utils/hashing.js.map +1 -0
  30. package/dist/codebase/utils/stats.d.ts +12 -0
  31. package/dist/codebase/utils/stats.js +55 -0
  32. package/dist/codebase/utils/stats.js.map +1 -0
  33. package/dist/codebase/utils/tree.d.ts +10 -0
  34. package/dist/codebase/utils/tree.js +22 -0
  35. package/dist/codebase/utils/tree.js.map +1 -0
  36. package/dist/commands/analyze.d.ts +6 -0
  37. package/dist/commands/analyze.js +97 -0
  38. package/dist/commands/analyze.js.map +1 -0
  39. package/dist/commands/context.d.ts +4 -0
  40. package/dist/commands/context.js +54 -0
  41. package/dist/commands/context.js.map +1 -0
  42. package/dist/core/config.d.ts +20 -0
  43. package/dist/core/config.js +40 -0
  44. package/dist/core/config.js.map +1 -0
  45. package/dist/core/errors.d.ts +18 -0
  46. package/dist/core/errors.js +53 -0
  47. package/dist/core/errors.js.map +1 -0
  48. package/dist/core/fileio.d.ts +10 -0
  49. package/dist/core/fileio.js +57 -0
  50. package/dist/core/fileio.js.map +1 -0
  51. package/dist/core/index.d.ts +8 -0
  52. package/dist/core/index.js +9 -0
  53. package/dist/core/index.js.map +1 -0
  54. package/dist/core/logger.d.ts +15 -0
  55. package/dist/core/logger.js +40 -0
  56. package/dist/core/logger.js.map +1 -0
  57. package/dist/core/types.d.ts +106 -0
  58. package/dist/core/types.js +5 -0
  59. package/dist/core/types.js.map +1 -0
  60. package/dist/database/cli.d.ts +7 -0
  61. package/dist/database/cli.js +132 -0
  62. package/dist/database/cli.js.map +1 -0
  63. package/dist/database/commands/checkpoint.d.ts +13 -0
  64. package/dist/database/commands/checkpoint.js +136 -0
  65. package/dist/database/commands/checkpoint.js.map +1 -0
  66. package/dist/database/commands/generate.d.ts +21 -0
  67. package/dist/database/commands/generate.js +269 -0
  68. package/dist/database/commands/generate.js.map +1 -0
  69. package/dist/database/commands/handoff.d.ts +15 -0
  70. package/dist/database/commands/handoff.js +332 -0
  71. package/dist/database/commands/handoff.js.map +1 -0
  72. package/dist/database/commands/history.d.ts +13 -0
  73. package/dist/database/commands/history.js +148 -0
  74. package/dist/database/commands/history.js.map +1 -0
  75. package/dist/database/commands/init.d.ts +10 -0
  76. package/dist/database/commands/init.js +28 -0
  77. package/dist/database/commands/init.js.map +1 -0
  78. package/dist/database/commands/learn.d.ts +12 -0
  79. package/dist/database/commands/learn.js +93 -0
  80. package/dist/database/commands/learn.js.map +1 -0
  81. package/dist/database/commands/memory.d.ts +90 -0
  82. package/dist/database/commands/memory.js +353 -0
  83. package/dist/database/commands/memory.js.map +1 -0
  84. package/dist/database/commands/show.d.ts +9 -0
  85. package/dist/database/commands/show.js +136 -0
  86. package/dist/database/commands/show.js.map +1 -0
  87. package/dist/database/commands/validate.d.ts +9 -0
  88. package/dist/database/commands/validate.js +200 -0
  89. package/dist/database/commands/validate.js.map +1 -0
  90. package/dist/database/commands/watch.d.ts +9 -0
  91. package/dist/database/commands/watch.js +77 -0
  92. package/dist/database/commands/watch.js.map +1 -0
  93. package/dist/database/extractors/drizzle.d.ts +62 -0
  94. package/dist/database/extractors/drizzle.js +251 -0
  95. package/dist/database/extractors/drizzle.js.map +1 -0
  96. package/dist/database/extractors/firebase.d.ts +39 -0
  97. package/dist/database/extractors/firebase.js +192 -0
  98. package/dist/database/extractors/firebase.js.map +1 -0
  99. package/dist/database/extractors/index.d.ts +69 -0
  100. package/dist/database/extractors/index.js +345 -0
  101. package/dist/database/extractors/index.js.map +1 -0
  102. package/dist/database/extractors/mongodb.d.ts +44 -0
  103. package/dist/database/extractors/mongodb.js +198 -0
  104. package/dist/database/extractors/mongodb.js.map +1 -0
  105. package/dist/database/extractors/mysql.d.ts +61 -0
  106. package/dist/database/extractors/mysql.js +173 -0
  107. package/dist/database/extractors/mysql.js.map +1 -0
  108. package/dist/database/extractors/postgres.d.ts +47 -0
  109. package/dist/database/extractors/postgres.js +141 -0
  110. package/dist/database/extractors/postgres.js.map +1 -0
  111. package/dist/database/extractors/prisma.d.ts +71 -0
  112. package/dist/database/extractors/prisma.js +270 -0
  113. package/dist/database/extractors/prisma.js.map +1 -0
  114. package/dist/database/extractors/sqlite.d.ts +50 -0
  115. package/dist/database/extractors/sqlite.js +148 -0
  116. package/dist/database/extractors/sqlite.js.map +1 -0
  117. package/dist/database/generators/learning-generator.d.ts +48 -0
  118. package/dist/database/generators/learning-generator.js +221 -0
  119. package/dist/database/generators/learning-generator.js.map +1 -0
  120. package/dist/database/generators/templates.d.ts +103 -0
  121. package/dist/database/generators/templates.js +1557 -0
  122. package/dist/database/generators/templates.js.map +1 -0
  123. package/dist/database/index.d.ts +15 -0
  124. package/dist/database/index.js +16 -0
  125. package/dist/database/index.js.map +1 -0
  126. package/dist/database/utils/json-output.d.ts +26 -0
  127. package/dist/database/utils/json-output.js +37 -0
  128. package/dist/database/utils/json-output.js.map +1 -0
  129. package/dist/generators/unified.d.ts +1 -0
  130. package/dist/generators/unified.js +173 -0
  131. package/dist/generators/unified.js.map +1 -0
  132. package/dist/index.d.ts +4 -0
  133. package/dist/index.js +5 -0
  134. package/dist/index.js.map +1 -0
  135. package/dist/utils/config-detector.d.ts +1 -0
  136. package/dist/utils/config-detector.js +40 -0
  137. package/dist/utils/config-detector.js.map +1 -0
  138. package/dist/utils/config-loader.d.ts +16 -0
  139. package/dist/utils/config-loader.js +20 -0
  140. package/dist/utils/config-loader.js.map +1 -0
  141. package/package.json +78 -0
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute
108
+ must include a readable copy of the attribution notices
109
+ contained within such NOTICE file, excluding those notices
110
+ that do not pertain to any part of the Derivative Works,
111
+ in at least one of the following places: within a NOTICE text
112
+ file distributed as part of the Derivative Works; within the
113
+ Source form or documentation, if provided along with the
114
+ Derivative Works; or, within a display generated by the
115
+ Derivative Works, if and wherever such third-party notices
116
+ normally appear. The contents of the NOTICE file are for
117
+ informational purposes only and do not modify the License.
118
+ You may add Your own attribution notices within Derivative
119
+ Works that You distribute, alongside or as an addendum to
120
+ the NOTICE text from the Work, provided that such additional
121
+ attribution notices cannot be construed as modifying the
122
+ License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 DevMind Contributors
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,148 @@
1
+ # DevMind
2
+
3
+ > AI Memory Layer for development - Complete project context (codebase + database + memory)
4
+
5
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
6
+
7
+ ## Overview
8
+
9
+ **DevMind** provides AI assistants with complete understanding of your project by combining:
10
+
11
+ - 🗂️ **Codebase Structure** - Hierarchical documentation of your code
12
+ - 🗄️ **Database Schema** - Complete schema analysis with patterns
13
+ - 🧠 **Persistent Memory** - Checkpoints, learnings, and evolution tracking
14
+ - 🔍 **Context Slicing** - Focused context for optimized token usage
15
+
16
+ A single workflow generates everything your AI needs to understand your project deeply.
17
+
18
+ ## Features
19
+
20
+ - **Unified Context Generation** - Single command for complete project understanding
21
+ - **Context Slicing** - "Zoom in" on specific modules (`devmind context`)
22
+ - **Multi-Database Support** - PostgreSQL, MySQL, SQLite, MongoDB, Firebase
23
+ - **Memory System** - Checkpoints, `LEARN.md`, session history
24
+ - **Evolution Tracking** - Track both schema and codebase changes over time
25
+ - **AI-Optimized Output** - Tailored for Claude, Cursor, Windsurf, and OpenClaw
26
+
27
+ ## Quick Start
28
+
29
+ ```bash
30
+ # Install
31
+ npm install -g devmind
32
+
33
+ # Zero-Friction (auto-detect DB config and generate DB context)
34
+ devmind generate
35
+
36
+ # Full context (database + codebase)
37
+ devmind generate --all
38
+
39
+ # Or detailed setup
40
+ devmind init
41
+ ```
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ npm install -g devmind
47
+ # or
48
+ pnpm add -g devmind
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ ### ⚡ Zero-Friction Generation
54
+
55
+ DevMind automatically detects your database configuration from `.env`, `prisma/schema.prisma`, `drizzle.config.ts`, or saved config.
56
+
57
+ ```bash
58
+ # Auto-detects DB and generates database context
59
+ devmind generate
60
+
61
+ # Generate full context (database + codebase)
62
+ devmind generate --all
63
+ ```
64
+
65
+ If detection fails (or for first run):
66
+
67
+ ```bash
68
+ devmind init --url "postgres://..."
69
+ ```
70
+
71
+ ### Context Slicing (Token Efficient)
72
+
73
+ ```bash
74
+ # Get high-level map
75
+ devmind context
76
+
77
+ # Focus on specific module
78
+ devmind context --focus src/database
79
+ ```
80
+
81
+ ### Memory Commands
82
+
83
+ ```bash
84
+ # Save architectural decision
85
+ devmind learn "Services use dependency injection" --category architecture
86
+
87
+ # Save checkpoint
88
+ devmind checkpoint -m "Before refactoring auth"
89
+
90
+ # View history
91
+ devmind history --unified
92
+ ```
93
+
94
+ ### Analyze Code-to-Database Usage
95
+
96
+ ```bash
97
+ devmind analyze -p ./my-project
98
+ ```
99
+
100
+ ## Integration
101
+
102
+ ### OpenClaw
103
+
104
+ DevMind is optimized for OpenClaw agents.
105
+ See [OpenClaw Integration Skill](integrations/openclaw/SKILL.md) for agent instructions.
106
+
107
+ ### Cursor / Windsurf / Custom Agents
108
+
109
+ 1. Run `devmind generate --all`
110
+ 2. Point your AI to `.devmind/AGENTS.md`
111
+ 3. See [AI Agent Integration Guide](docs/AI_INTEGRATION.md) for detailed patterns.
112
+
113
+ ## Output Structure
114
+
115
+ ```
116
+ .devmind/
117
+ ├── codebase/
118
+ │ ├── codebase-overview.md
119
+ │ ├── architecture.md
120
+ │ └── modules/
121
+ ├── database/
122
+ │ ├── schema-overview.md
123
+ │ ├── schema.json
124
+ │ └── ...
125
+ ├── memory/
126
+ │ ├── checkpoints/
127
+ │ ├── LEARN.md # Persistent accumulated knowledge
128
+ │ ├── schema-evolution.md
129
+ │ ├── codebase-evolution.md
130
+ │ └── session-history.md
131
+ ├── analysis/
132
+ │ ├── CODE_DB_MAPPING.md
133
+ │ └── UNUSED_TABLES.md
134
+ ├── AGENTS.md # Unified context for AI
135
+ ├── devmind-tools.json # Tool definitions for agents
136
+ └── index.json
137
+ ```
138
+
139
+ ## Roadmap
140
+
141
+ - [x] Phase 1: Foundation (project setup)
142
+ - [x] Phase 2: Unified CLI + Memory Extension
143
+ - [x] Phase 3: Cross-context analysis & Context Slicing
144
+ - [x] Phase 4: Distribution & OpenClaw integration
145
+
146
+ ## License
147
+
148
+ Apache 2.0 © Nyan Lin Maung
package/dist/cli.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * DevMind CLI
4
+ * Unified tool for database and codebase analysis
5
+ */
6
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,232 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * DevMind CLI
4
+ * Unified tool for database and codebase analysis
5
+ */
6
+ import { Command } from 'commander';
7
+ import { init, generate as generateDatabase, validate, watch, show, handoff, checkpoint, learn, history, MemoryInfrastructure, } from './database/index.js';
8
+ import { generateUnifiedDocs } from './generators/unified.js';
9
+ import { scanCodebase, saveScanResult, calculateCodebaseHash, getCodebaseStats, } from './codebase/index.js';
10
+ import { logger, ensureDir, writeJSON } from './core/index.js';
11
+ import * as path from 'path';
12
+ const program = new Command();
13
+ program
14
+ .name('devmind')
15
+ .description('Unified developer assistant for database and codebase context')
16
+ .version('1.0.0');
17
+ // Database Commands
18
+ program
19
+ .command('init')
20
+ .description('Initialize DevMind in your project')
21
+ .option('-u, --url <url>', 'Database connection URL')
22
+ .option('-d, --dir <dir>', 'Output directory', '.devmind')
23
+ .action(init);
24
+ program
25
+ .command('generate')
26
+ .description('Generate context from database and/or codebase')
27
+ .option('-u, --url <url>', 'Database connection URL')
28
+ .option('--orm <orm>', 'ORM type (prisma, drizzle)')
29
+ .option('--mysql', 'Use MySQL extractor')
30
+ .option('--sqlite <path>', 'Use SQLite extractor with file path')
31
+ .option('--prisma [path]', 'Use Prisma extractor (optional path)')
32
+ .option('--drizzle [path]', 'Use Drizzle extractor (optional path)')
33
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
34
+ .option('--format <format>', 'Output format (markdown, json)', 'markdown')
35
+ .option('--all', 'Generate all contexts (database and codebase)')
36
+ .option('--code', 'Generate codebase context only')
37
+ .option('--db', 'Generate database context only (default)')
38
+ .option('-p, --path <path>', 'Path to scan (for codebase)', '.')
39
+ .action(async (options) => {
40
+ try {
41
+ // Smart Config Loading & Detection
42
+ const { loadConfig } = await import('./utils/config-loader.js');
43
+ const { detectDatabaseConfig } = await import('./utils/config-detector.js');
44
+ let savedConfig = await loadConfig(process.cwd());
45
+ // Merge options: CLI flags > Saved Config > Auto Detection
46
+ const mergedOptions = { ...savedConfig, ...options };
47
+ // Prioritize explicit URL > Env > Saved > Detected
48
+ let connectionString = options.url || process.env.DATABASE_URL || savedConfig.databaseUrl;
49
+ let configModified = false;
50
+ if (!connectionString && (options.db || options.all || (!options.code && !options.db))) {
51
+ const detectedUrl = await detectDatabaseConfig(process.cwd());
52
+ if (detectedUrl) {
53
+ logger.info(`Auto-detected database URL: ${detectedUrl.replace(/:[^:@]*@/, ':****@')}`);
54
+ connectionString = detectedUrl;
55
+ // Save for future runs
56
+ savedConfig = { ...savedConfig, databaseUrl: detectedUrl };
57
+ configModified = true;
58
+ }
59
+ }
60
+ // Apply merged connection string
61
+ if (connectionString) {
62
+ mergedOptions.url = connectionString;
63
+ }
64
+ if (configModified) {
65
+ const configPath = path.join(process.cwd(), '.devmind', 'devmind.config.json');
66
+ await ensureDir(path.dirname(configPath));
67
+ await writeJSON(configPath, savedConfig);
68
+ logger.info(`Saved configuration to ${configPath}`);
69
+ }
70
+ const runAll = mergedOptions.all;
71
+ const runCode = mergedOptions.code || runAll;
72
+ const runDb = mergedOptions.db || runAll || (!runCode && !mergedOptions.db);
73
+ if (runDb) {
74
+ logger.info('Starting Database Generation...');
75
+ const dbOutputDir = path.join(mergedOptions.output || '.devmind', 'database');
76
+ await ensureDir(dbOutputDir);
77
+ const dbOptions = { ...mergedOptions, output: dbOutputDir };
78
+ await generateDatabase(dbOptions);
79
+ }
80
+ if (runCode) {
81
+ logger.info('Starting Codebase Generation...');
82
+ const rootPath = path.resolve(mergedOptions.path || '.');
83
+ const outputDir = mergedOptions.output || '.devmind';
84
+ const codebaseOutputDir = path.join(outputDir, 'codebase');
85
+ await ensureDir(codebaseOutputDir);
86
+ const result = await scanCodebase(rootPath, codebaseOutputDir);
87
+ await saveScanResult(result, codebaseOutputDir);
88
+ // Update memory with codebase stats
89
+ try {
90
+ const memory = new MemoryInfrastructure();
91
+ const codebaseHash = calculateCodebaseHash(result.structure);
92
+ const codebaseStats = getCodebaseStats(result.structure);
93
+ await memory.updateSessionContext(outputDir, {
94
+ codebaseHash,
95
+ codebaseStats,
96
+ });
97
+ logger.info('Updated session context with codebase stats');
98
+ await memory.updateCodebaseEvolution(outputDir, codebaseHash, codebaseStats);
99
+ }
100
+ catch (error) {
101
+ logger.warn(`Failed to update session context: ${error.message}`);
102
+ }
103
+ // Generate unified docs
104
+ await generateUnifiedDocs(outputDir);
105
+ logger.success('Codebase context generated!');
106
+ }
107
+ if (runAll) {
108
+ logger.success('Unified Generation Complete!');
109
+ logger.info(`Context available in ${mergedOptions.output || '.devmind'}`);
110
+ }
111
+ }
112
+ catch (error) {
113
+ logger.error('Generation failed', error);
114
+ process.exit(1);
115
+ }
116
+ });
117
+ program
118
+ .command('validate')
119
+ .description('Validate generated context against database')
120
+ .option('--strict', 'Fail on any mismatches')
121
+ .action(validate);
122
+ program
123
+ .command('watch')
124
+ .description('Watch for database schema changes')
125
+ .option('-d, --debounce <ms>', 'Debounce time in ms', '2000')
126
+ .action(watch);
127
+ program
128
+ .command('show')
129
+ .description('Show current database schema')
130
+ .option('-f, --format <format>', 'Output format', 'markdown')
131
+ .action(show);
132
+ // Memory Commands
133
+ program
134
+ .command('handoff')
135
+ .description('Multi-agent handoff management')
136
+ .option('--record', 'Record current session state')
137
+ .option('--resume <id>', 'Resume from previous session')
138
+ .option('--list', 'List available sessions')
139
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
140
+ .option('--status <status>', 'Session status', 'in_progress')
141
+ .option('--agentId <id>', 'Agent identifier')
142
+ .action(handoff);
143
+ program
144
+ .command('checkpoint')
145
+ .description('Save or restore session checkpoint')
146
+ .option('--restore', 'Restore latest checkpoint')
147
+ .option('--list', 'List all checkpoints')
148
+ .option('-m, --message <message>', 'Checkpoint message')
149
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
150
+ .option('--json', 'Output as JSON')
151
+ .action(checkpoint);
152
+ program
153
+ .command('learn [learning]')
154
+ .description('Add a learning to accumulated knowledge')
155
+ .option('--list', 'List all learnings')
156
+ .option('--category <category>', 'Learning category')
157
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
158
+ .option('--json', 'Output as JSON')
159
+ .action(learn);
160
+ program
161
+ .command('history')
162
+ .description('View session history')
163
+ .option('--sessions', 'Show session history (default)')
164
+ .option('--evolution', 'Show schema evolution')
165
+ .option('--codebase-evolution', 'Show codebase evolution')
166
+ .option('--unified', 'Show unified project timeline')
167
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
168
+ .option('--json', 'Output as JSON')
169
+ .action(history);
170
+ // Analysis Commands
171
+ program
172
+ .command('analyze')
173
+ .description('Analyze code-to-database usage')
174
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
175
+ .option('-p, --path <path>', 'Codebase path to scan', '.')
176
+ .action(async (options) => {
177
+ const { analyze } = await import('./commands/analyze.js');
178
+ await analyze(options);
179
+ });
180
+ // Codebase Commands
181
+ program
182
+ .command('scan')
183
+ .description('Scan codebase and generate context')
184
+ .option('-p, --path <path>', 'Path to scan', '.')
185
+ .option('-o, --output <dir>', 'Output directory', '.devmind')
186
+ .option('--json', 'Output as JSON')
187
+ .action(async (options) => {
188
+ try {
189
+ const rootPath = path.resolve(options.path || '.');
190
+ const outputDir = options.output || '.devmind';
191
+ logger.info(`Scanning codebase: ${rootPath}`);
192
+ const codebaseOutputDir = path.join(outputDir, 'codebase');
193
+ // Ensure directory is created by saveScanResult but we might need it for scanCodebase if it writes logs?
194
+ // scanCodebase doesn't write files, saveScanResult does.
195
+ await ensureDir(codebaseOutputDir);
196
+ const result = await scanCodebase(rootPath, codebaseOutputDir);
197
+ await saveScanResult(result, codebaseOutputDir);
198
+ // Update memory with codebase stats
199
+ try {
200
+ const memory = new MemoryInfrastructure();
201
+ const codebaseHash = calculateCodebaseHash(result.structure);
202
+ const codebaseStats = getCodebaseStats(result.structure);
203
+ await memory.updateSessionContext(outputDir, {
204
+ codebaseHash,
205
+ codebaseStats,
206
+ });
207
+ logger.info('Updated session context with codebase stats');
208
+ await memory.updateCodebaseEvolution(outputDir, codebaseHash, codebaseStats);
209
+ }
210
+ catch (error) {
211
+ logger.warn(`Failed to update session context: ${error.message}`);
212
+ }
213
+ // Generate unified docs (CLAUDE.md, etc.)
214
+ await generateUnifiedDocs(outputDir);
215
+ logger.success('Scan complete!');
216
+ }
217
+ catch (error) {
218
+ logger.error('Failed to scan codebase', error);
219
+ process.exit(1);
220
+ }
221
+ });
222
+ program
223
+ .command('context')
224
+ .description('Get focused context for a specific part of the codebase')
225
+ .option('--focus <path>', 'Path to focus on')
226
+ .option('--query <string>', 'Search query')
227
+ .action(async (options) => {
228
+ const { context } = await import('./commands/context.js');
229
+ await context(options);
230
+ });
231
+ program.parse();
232
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CA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aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAEzD,MAAM,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE;gBAC3C,YAAY;gBACZ,aAAa;aACd,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;YAE3D,MAAM,MAAM,CAAC,uBAAuB,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,qCAAsC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/E,CAAC;QAED,0CAA0C;QAC1C,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAErC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAc,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,yDAAyD,CAAC;KACtE,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;KAC5C,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC;KAC1C,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAC1D,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generate architecture documentation template
3
+ */
4
+ export declare function generateArchitecture(): string;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Generate architecture documentation template
3
+ */
4
+ export function generateArchitecture() {
5
+ return `# Architecture
6
+
7
+ ## Directory Structure
8
+
9
+ | Layer | Description |
10
+ |-------|-------------|
11
+ | \`src/\` | Main source code |
12
+ | \`components/\` | Reusable UI components |
13
+ | \`hooks/\` | Custom React hooks |
14
+ | \`utils/\` | Utility functions |
15
+ | \`services/\` | API services |
16
+ | \`types/\` | TypeScript definitions |
17
+
18
+ ## Data Flow
19
+
20
+ _Describe how data flows through your application._
21
+
22
+ ## Key Patterns
23
+
24
+ - **Component Pattern**: Presentational + Container components
25
+ - **State Management**: _Describe your approach_
26
+ - **API Layer**: _Describe your API patterns_
27
+
28
+ ## Dependencies
29
+
30
+ _Describe key dependencies and their purposes._
31
+ `;
32
+ }
33
+ //# sourceMappingURL=architecture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../../src/codebase/generators/architecture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,UAAU,oBAAoB;IAClC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BR,CAAC;AACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generate module documentation
3
+ */
4
+ import { FileNode } from '../scanners/filesystem.js';
5
+ export interface ModuleDoc {
6
+ path: string;
7
+ content: string;
8
+ }
9
+ export declare function generateModuleDocs(structure: FileNode, outputDir: string): ModuleDoc[];