@mycodemap/mycodemap 0.1.0 → 0.2.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 (283) hide show
  1. package/CHANGELOG.md +164 -6
  2. package/README.md +407 -141
  3. package/dist/cli/commands/ci.d.ts +7 -1
  4. package/dist/cli/commands/ci.d.ts.map +1 -1
  5. package/dist/cli/commands/ci.js +38 -0
  6. package/dist/cli/commands/ci.js.map +1 -1
  7. package/dist/cli/commands/cycles.d.ts.map +1 -1
  8. package/dist/cli/commands/cycles.js +2 -0
  9. package/dist/cli/commands/cycles.js.map +1 -1
  10. package/dist/cli/commands/export.d.ts +6 -0
  11. package/dist/cli/commands/export.d.ts.map +1 -0
  12. package/dist/cli/commands/export.js +108 -0
  13. package/dist/cli/commands/export.js.map +1 -0
  14. package/dist/cli/commands/generate.d.ts.map +1 -1
  15. package/dist/cli/commands/generate.js +96 -0
  16. package/dist/cli/commands/generate.js.map +1 -1
  17. package/dist/cli/commands/init.d.ts.map +1 -1
  18. package/dist/cli/commands/init.js +3 -1
  19. package/dist/cli/commands/init.js.map +1 -1
  20. package/dist/cli/commands/logs.d.ts +5 -0
  21. package/dist/cli/commands/logs.d.ts.map +1 -0
  22. package/dist/cli/commands/logs.js +189 -0
  23. package/dist/cli/commands/logs.js.map +1 -0
  24. package/dist/cli/commands/report.d.ts +12 -0
  25. package/dist/cli/commands/report.d.ts.map +1 -0
  26. package/dist/cli/commands/report.js +158 -0
  27. package/dist/cli/commands/report.js.map +1 -0
  28. package/dist/cli/commands/server.d.ts +9 -0
  29. package/dist/cli/commands/server.d.ts.map +1 -0
  30. package/dist/cli/commands/server.js +68 -0
  31. package/dist/cli/commands/server.js.map +1 -0
  32. package/dist/cli/commands/watch-foreground.d.ts.map +1 -1
  33. package/dist/cli/commands/watch-foreground.js +2 -0
  34. package/dist/cli/commands/watch-foreground.js.map +1 -1
  35. package/dist/cli/commands/watch.d.ts.map +1 -1
  36. package/dist/cli/commands/watch.js +2 -0
  37. package/dist/cli/commands/watch.js.map +1 -1
  38. package/dist/cli/first-run-guide.d.ts +23 -0
  39. package/dist/cli/first-run-guide.d.ts.map +1 -0
  40. package/dist/cli/first-run-guide.js +83 -0
  41. package/dist/cli/first-run-guide.js.map +1 -0
  42. package/dist/cli/index.js +85 -1
  43. package/dist/cli/index.js.map +1 -1
  44. package/dist/cli/platform-check.d.ts +21 -0
  45. package/dist/cli/platform-check.d.ts.map +1 -0
  46. package/dist/cli/platform-check.js +94 -0
  47. package/dist/cli/platform-check.js.map +1 -0
  48. package/dist/cli/tree-sitter-check.d.ts +35 -0
  49. package/dist/cli/tree-sitter-check.d.ts.map +1 -0
  50. package/dist/cli/tree-sitter-check.js +133 -0
  51. package/dist/cli/tree-sitter-check.js.map +1 -0
  52. package/dist/cli/utils/sanitize.d.ts +54 -0
  53. package/dist/cli/utils/sanitize.d.ts.map +1 -0
  54. package/dist/cli/utils/sanitize.js +131 -0
  55. package/dist/cli/utils/sanitize.js.map +1 -0
  56. package/dist/cli-new/commands/export.d.ts +15 -0
  57. package/dist/cli-new/commands/export.d.ts.map +1 -0
  58. package/dist/cli-new/commands/export.js +107 -0
  59. package/dist/cli-new/commands/export.js.map +1 -0
  60. package/dist/cli-new/commands/query.d.ts +14 -0
  61. package/dist/cli-new/commands/query.d.ts.map +1 -0
  62. package/dist/cli-new/commands/query.js +120 -0
  63. package/dist/cli-new/commands/query.js.map +1 -0
  64. package/dist/cli-new/commands/server.d.ts +13 -0
  65. package/dist/cli-new/commands/server.d.ts.map +1 -0
  66. package/dist/cli-new/commands/server.js +94 -0
  67. package/dist/cli-new/commands/server.js.map +1 -0
  68. package/dist/cli-new/index.d.ts +11 -0
  69. package/dist/cli-new/index.d.ts.map +1 -0
  70. package/dist/cli-new/index.js +63 -0
  71. package/dist/cli-new/index.js.map +1 -0
  72. package/dist/cli-new/types/index.d.ts +88 -0
  73. package/dist/cli-new/types/index.d.ts.map +1 -0
  74. package/dist/cli-new/types/index.js +7 -0
  75. package/dist/cli-new/types/index.js.map +1 -0
  76. package/dist/domain/entities/CodeGraph.d.ts +134 -0
  77. package/dist/domain/entities/CodeGraph.d.ts.map +1 -0
  78. package/dist/domain/entities/CodeGraph.js +316 -0
  79. package/dist/domain/entities/CodeGraph.js.map +1 -0
  80. package/dist/domain/entities/Dependency.d.ts +78 -0
  81. package/dist/domain/entities/Dependency.d.ts.map +1 -0
  82. package/dist/domain/entities/Dependency.js +132 -0
  83. package/dist/domain/entities/Dependency.js.map +1 -0
  84. package/dist/domain/entities/Module.d.ts +75 -0
  85. package/dist/domain/entities/Module.d.ts.map +1 -0
  86. package/dist/domain/entities/Module.js +151 -0
  87. package/dist/domain/entities/Module.js.map +1 -0
  88. package/dist/domain/entities/Project.d.ts +50 -0
  89. package/dist/domain/entities/Project.d.ts.map +1 -0
  90. package/dist/domain/entities/Project.js +99 -0
  91. package/dist/domain/entities/Project.js.map +1 -0
  92. package/dist/domain/entities/Symbol.d.ts +75 -0
  93. package/dist/domain/entities/Symbol.d.ts.map +1 -0
  94. package/dist/domain/entities/Symbol.js +130 -0
  95. package/dist/domain/entities/Symbol.js.map +1 -0
  96. package/dist/domain/events/DomainEvent.d.ts +76 -0
  97. package/dist/domain/events/DomainEvent.d.ts.map +1 -0
  98. package/dist/domain/events/DomainEvent.js +153 -0
  99. package/dist/domain/events/DomainEvent.js.map +1 -0
  100. package/dist/domain/index.d.ts +10 -0
  101. package/dist/domain/index.d.ts.map +1 -0
  102. package/dist/domain/index.js +18 -0
  103. package/dist/domain/index.js.map +1 -0
  104. package/dist/domain/repositories/CodeGraphRepository.d.ts +58 -0
  105. package/dist/domain/repositories/CodeGraphRepository.d.ts.map +1 -0
  106. package/dist/domain/repositories/CodeGraphRepository.js +37 -0
  107. package/dist/domain/repositories/CodeGraphRepository.js.map +1 -0
  108. package/dist/domain/services/CodeGraphBuilder.d.ts +50 -0
  109. package/dist/domain/services/CodeGraphBuilder.d.ts.map +1 -0
  110. package/dist/domain/services/CodeGraphBuilder.js +121 -0
  111. package/dist/domain/services/CodeGraphBuilder.js.map +1 -0
  112. package/dist/infrastructure/parser/implementations/GoParser.d.ts +25 -0
  113. package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -0
  114. package/dist/infrastructure/parser/implementations/GoParser.js +158 -0
  115. package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -0
  116. package/dist/infrastructure/parser/implementations/PythonParser.d.ts +30 -0
  117. package/dist/infrastructure/parser/implementations/PythonParser.d.ts.map +1 -0
  118. package/dist/infrastructure/parser/implementations/PythonParser.js +201 -0
  119. package/dist/infrastructure/parser/implementations/PythonParser.js.map +1 -0
  120. package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +63 -0
  121. package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -0
  122. package/dist/infrastructure/parser/implementations/TypeScriptParser.js +420 -0
  123. package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -0
  124. package/dist/infrastructure/parser/index.d.ts +13 -0
  125. package/dist/infrastructure/parser/index.d.ts.map +1 -0
  126. package/dist/infrastructure/parser/index.js +32 -0
  127. package/dist/infrastructure/parser/index.js.map +1 -0
  128. package/dist/infrastructure/parser/interfaces/ParserBase.d.ts +124 -0
  129. package/dist/infrastructure/parser/interfaces/ParserBase.d.ts.map +1 -0
  130. package/dist/infrastructure/parser/interfaces/ParserBase.js +200 -0
  131. package/dist/infrastructure/parser/interfaces/ParserBase.js.map +1 -0
  132. package/dist/infrastructure/parser/registry/ParserRegistry.d.ts +68 -0
  133. package/dist/infrastructure/parser/registry/ParserRegistry.d.ts.map +1 -0
  134. package/dist/infrastructure/parser/registry/ParserRegistry.js +116 -0
  135. package/dist/infrastructure/parser/registry/ParserRegistry.js.map +1 -0
  136. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts +44 -0
  137. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts.map +1 -0
  138. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js +129 -0
  139. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js.map +1 -0
  140. package/dist/infrastructure/repositories/index.d.ts +3 -0
  141. package/dist/infrastructure/repositories/index.d.ts.map +1 -0
  142. package/dist/infrastructure/repositories/index.js +7 -0
  143. package/dist/infrastructure/repositories/index.js.map +1 -0
  144. package/dist/infrastructure/storage/StorageFactory.d.ts +53 -0
  145. package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -0
  146. package/dist/infrastructure/storage/StorageFactory.js +150 -0
  147. package/dist/infrastructure/storage/StorageFactory.js.map +1 -0
  148. package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts +52 -0
  149. package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts.map +1 -0
  150. package/dist/infrastructure/storage/adapters/FileSystemStorage.js +315 -0
  151. package/dist/infrastructure/storage/adapters/FileSystemStorage.js.map +1 -0
  152. package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts +52 -0
  153. package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts.map +1 -0
  154. package/dist/infrastructure/storage/adapters/KuzuDBStorage.js +235 -0
  155. package/dist/infrastructure/storage/adapters/KuzuDBStorage.js.map +1 -0
  156. package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts +37 -0
  157. package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts.map +1 -0
  158. package/dist/infrastructure/storage/adapters/MemoryStorage.js +229 -0
  159. package/dist/infrastructure/storage/adapters/MemoryStorage.js.map +1 -0
  160. package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts +49 -0
  161. package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts.map +1 -0
  162. package/dist/infrastructure/storage/adapters/Neo4jStorage.js +222 -0
  163. package/dist/infrastructure/storage/adapters/Neo4jStorage.js.map +1 -0
  164. package/dist/infrastructure/storage/index.d.ts +6 -0
  165. package/dist/infrastructure/storage/index.d.ts.map +1 -0
  166. package/dist/infrastructure/storage/index.js +13 -0
  167. package/dist/infrastructure/storage/index.js.map +1 -0
  168. package/dist/infrastructure/storage/interfaces/StorageBase.d.ts +76 -0
  169. package/dist/infrastructure/storage/interfaces/StorageBase.d.ts.map +1 -0
  170. package/dist/infrastructure/storage/interfaces/StorageBase.js +116 -0
  171. package/dist/infrastructure/storage/interfaces/StorageBase.js.map +1 -0
  172. package/dist/interface/config/index.d.ts +102 -0
  173. package/dist/interface/config/index.d.ts.map +1 -0
  174. package/dist/interface/config/index.js +7 -0
  175. package/dist/interface/config/index.js.map +1 -0
  176. package/dist/interface/types/index.d.ts +425 -0
  177. package/dist/interface/types/index.d.ts.map +1 -0
  178. package/dist/interface/types/index.js +8 -0
  179. package/dist/interface/types/index.js.map +1 -0
  180. package/dist/interface/types/parser.d.ts +103 -0
  181. package/dist/interface/types/parser.d.ts.map +1 -0
  182. package/dist/interface/types/parser.js +7 -0
  183. package/dist/interface/types/parser.js.map +1 -0
  184. package/dist/interface/types/storage.d.ts +98 -0
  185. package/dist/interface/types/storage.d.ts.map +1 -0
  186. package/dist/interface/types/storage.js +7 -0
  187. package/dist/interface/types/storage.js.map +1 -0
  188. package/dist/orchestrator/test-linker.js +1 -1
  189. package/dist/orchestrator/test-linker.js.map +1 -1
  190. package/dist/server/CodeMapServer.d.ts +51 -0
  191. package/dist/server/CodeMapServer.d.ts.map +1 -0
  192. package/dist/server/CodeMapServer.js +146 -0
  193. package/dist/server/CodeMapServer.js.map +1 -0
  194. package/dist/server/handlers/AnalysisHandler.d.ts +82 -0
  195. package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -0
  196. package/dist/server/handlers/AnalysisHandler.js +196 -0
  197. package/dist/server/handlers/AnalysisHandler.js.map +1 -0
  198. package/dist/server/handlers/QueryHandler.d.ts +57 -0
  199. package/dist/server/handlers/QueryHandler.d.ts.map +1 -0
  200. package/dist/server/handlers/QueryHandler.js +260 -0
  201. package/dist/server/handlers/QueryHandler.js.map +1 -0
  202. package/dist/server/index.d.ts +7 -0
  203. package/dist/server/index.d.ts.map +1 -0
  204. package/dist/server/index.js +13 -0
  205. package/dist/server/index.js.map +1 -0
  206. package/dist/server/routes/api.d.ts +8 -0
  207. package/dist/server/routes/api.d.ts.map +1 -0
  208. package/dist/server/routes/api.js +372 -0
  209. package/dist/server/routes/api.js.map +1 -0
  210. package/dist/server/types/index.d.ts +171 -0
  211. package/dist/server/types/index.d.ts.map +1 -0
  212. package/dist/server/types/index.js +7 -0
  213. package/dist/server/types/index.js.map +1 -0
  214. package/dist/types/index.d.ts +6 -372
  215. package/dist/types/index.d.ts.map +1 -1
  216. package/dist/types/index.js +9 -3
  217. package/dist/types/index.js.map +1 -1
  218. package/docs/AI_ASSISTANT_SETUP.md +811 -0
  219. package/docs/PUBLISHING.md +162 -0
  220. package/docs/README.md +37 -0
  221. package/docs/SETUP_GUIDE.md +493 -0
  222. package/docs/ai-guide/COMMANDS.md +369 -0
  223. package/docs/ai-guide/INTEGRATION.md +513 -0
  224. package/docs/ai-guide/OUTPUT.md +465 -0
  225. package/docs/ai-guide/PATTERNS.md +409 -0
  226. package/docs/ai-guide/PROMPTS.md +414 -0
  227. package/docs/ai-guide/QUICKSTART.md +114 -0
  228. package/docs/ai-guide/README.md +66 -0
  229. package/docs/archive/AI_INTEGRATION_GUIDE_ARCHIVED.md +391 -0
  230. package/docs/archive/ARCHIVE.md +39 -0
  231. package/docs/archive/MYCLAUDE_GUIDE.md +305 -0
  232. package/docs/archive/PUBLISH_NPM_DESIGN_V1.md +1699 -0
  233. package/docs/archive/PUBLISH_NPM_DESIGN_V2.md +396 -0
  234. package/docs/archive/README.md +29 -0
  235. package/docs/archive/TASK_DESIGN_COVERAGE_REPORT.md +320 -0
  236. package/docs/archive/TEST_SUMMARY.md +140 -0
  237. package/docs/archive/comprehensive_test_report.md +337 -0
  238. package/docs/archive/design-docs/CI_GATEWAY_DESIGN.md +790 -0
  239. package/docs/archive/design-docs/PUBLISH_NPM_DESIGN_FINAL.md +491 -0
  240. package/docs/archive/design-docs/REFACTOR_ARCHITECTURE_OVERVIEW.md +558 -0
  241. package/docs/archive/design-docs/REFACTOR_CONFIDENCE_DESIGN.md +250 -0
  242. package/docs/archive/design-docs/REFACTOR_GIT_ANALYZER_DESIGN.md +791 -0
  243. package/docs/archive/design-docs/REFACTOR_ORCHESTRATOR_DESIGN.md +1071 -0
  244. package/docs/archive/design-docs/REFACTOR_RESULT_FUSION_DESIGN.md +321 -0
  245. package/docs/archive/design-docs/REFACTOR_TEST_LINKER_DESIGN.md +317 -0
  246. package/docs/archive/myclaude.md +1084 -0
  247. package/docs/archive/plans/2026-03-14-go-language-support-design.md +92 -0
  248. package/docs/archive/product-specs/REFACTOR_REQUIREMENTS.md +976 -0
  249. package/docs/archive/scenario-2-deps-analysis.md +353 -0
  250. package/docs/archive/test-report-symbol-search.md +384 -0
  251. package/docs/archive/test-scenario-4-complexity-analysis.md +460 -0
  252. package/docs/archive/test_report_scenario5.md +615 -0
  253. package/docs/archive/test_scenario_3_impact_analysis_report.md +520 -0
  254. package/docs/design-docs/README.md +26 -0
  255. package/docs/exec-plans/MVP3-IMPLEMENTATION-ROADMAP.md +524 -0
  256. package/docs/exec-plans/README.md +29 -0
  257. package/docs/exec-plans/active/.gitkeep +0 -0
  258. package/docs/exec-plans/completed/.gitkeep +0 -0
  259. package/docs/exec-plans/completed/2026-03-03-deps-path-extension-fix.md +186 -0
  260. package/docs/exec-plans/completed/2026-03-03-post-task-plan.md +135 -0
  261. package/docs/exec-plans/completed/harness-engineering-rollout.md +184 -0
  262. package/docs/exec-plans/tech-debt/.gitkeep +0 -0
  263. package/docs/exec-plans/tech-debt/2026-03-15-lint-guardrail-gap.md +30 -0
  264. package/docs/generated/README.md +19 -0
  265. package/docs/product-specs/MVP3-ARCHITECTURE-COMPARISON.md +504 -0
  266. package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-PRD.md +322 -0
  267. package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-TECH-PRD.md +1374 -0
  268. package/docs/product-specs/README.md +22 -0
  269. package/docs/references/README.md +15 -0
  270. package/docs/references/tmp.md +527 -0
  271. package/docs/rules/README.md +16 -0
  272. package/docs/rules/architecture-guardrails.md +349 -0
  273. package/docs/rules/code-quality-redlines.md +321 -0
  274. package/docs/rules/deployment.md +23 -0
  275. package/docs/rules/engineering-with-codex-openai.md +202 -0
  276. package/docs/rules/testing.md +73 -0
  277. package/docs/rules/validation.md +39 -0
  278. package/examples/README.md +61 -0
  279. package/examples/claude/codemap-skill.md +94 -0
  280. package/examples/codex/codemap-agent.md +66 -0
  281. package/examples/copilot/copilot-instructions.md +24 -0
  282. package/examples/kimi/codemap-skill.md +92 -0
  283. package/package.json +22 -7
@@ -0,0 +1,369 @@
1
+ # AI Guide - 命令参考
2
+
3
+ > 完整的 CLI 命令详解
4
+
5
+ ---
6
+
7
+ ## 核心命令
8
+
9
+ ### generate - 生成代码地图
10
+
11
+ ```bash
12
+ mycodemap generate # hybrid 模式(推荐)
13
+ mycodemap generate -m smart # AST 深度分析
14
+ mycodemap generate -m fast # 快速正则分析
15
+ mycodemap generate -o ./output # 指定输出目录
16
+ mycodemap generate --ai-context # 生成 AI 描述
17
+ ```
18
+
19
+ | 选项 | 说明 | 默认值 |
20
+ |------|------|--------|
21
+ | `-m, --mode <mode>` | 分析模式: fast/smart/hybrid | `hybrid` |
22
+ | `-o, --output <dir>` | 输出目录 | `.mycodemap` |
23
+ | `--ai-context` | 为每个文件生成描述 | - |
24
+
25
+ **模式说明**:
26
+ - `fast`: 正则匹配,极快,适合大型项目
27
+ - `smart`: AST 分析,较慢,信息完整
28
+ - `hybrid`: 自动选择,文件<50用fast,≥50用smart
29
+
30
+ ---
31
+
32
+ ### query - 查询代码
33
+
34
+ ```bash
35
+ mycodemap query -s "SymbolName" # 精确查询符号
36
+ mycodemap query -m "src/parser" # 查询模块
37
+ mycodemap query -d "analyzer" # 查询依赖
38
+ mycodemap query -S "cache" -l 10 # 模糊搜索
39
+ mycodemap query -s "Symbol" -j # JSON 输出
40
+ mycodemap query -s "Symbol" --include-references # 包含引用
41
+ mycodemap query -S "pattern" -r # 正则搜索
42
+ mycodemap query -c 5 # 显示上下文5行
43
+ ```
44
+
45
+ | 选项 | 说明 | 默认值 |
46
+ |------|------|--------|
47
+ | `-s, --symbol <name>` | 精确查询符号 | - |
48
+ | `-m, --module <path>` | 查询模块 | - |
49
+ | `-d, --deps <name>` | 查询依赖 | - |
50
+ | `-S, --search <word>` | 模糊搜索 | - |
51
+ | `-l, --limit <number>` | 限制结果数量 | `50` |
52
+ | `-j, --json` | JSON 格式输出 | - |
53
+ | `--structured` | 纯结构化输出 | - |
54
+ | `-r, --regex` | 使用正则表达式 | - |
55
+ | `-c, --context <lines>` | 显示代码上下文 | `0` |
56
+ | `--include-references` | 包含引用位置 | - |
57
+
58
+ ---
59
+
60
+ ### deps - 依赖分析
61
+
62
+ ```bash
63
+ mycodemap deps # 全部依赖
64
+ mycodemap deps -m "src/domain" # 指定模块
65
+ mycodemap deps -m "src/domain" -j # JSON 输出
66
+ mycodemap deps -m "src/domain" --structured # 纯结构化
67
+ ```
68
+
69
+ | 选项 | 说明 | 默认值 |
70
+ |------|------|--------|
71
+ | `-m, --module <path>` | 查询指定模块 | - |
72
+ | `-j, --json` | JSON 格式输出 | - |
73
+ | `--structured` | 纯结构化输出 | - |
74
+
75
+ ---
76
+
77
+ ### impact - 影响分析
78
+
79
+ ```bash
80
+ mycodemap impact -f "src/cli/index.ts" # 文件变更影响
81
+ mycodemap impact -f "src/cli/index.ts" -t # 包含传递依赖
82
+ mycodemap impact -f "src/cli/index.ts" -j # JSON 输出
83
+ ```
84
+
85
+ | 选项 | 说明 | 默认值 |
86
+ |------|------|--------|
87
+ | `-f, --file <path>` | **必填** 指定文件 | - |
88
+ | `-t, --transitive` | 包含传递依赖 | - |
89
+ | `-j, --json` | JSON 格式输出 | - |
90
+ | `--structured` | 纯结构化输出 | - |
91
+
92
+ ---
93
+
94
+ ### complexity - 复杂度分析
95
+
96
+ ```bash
97
+ mycodemap complexity # 项目整体
98
+ mycodemap complexity -f "src/cli/index.ts" # 指定文件
99
+ mycodemap complexity -d # 函数级详情
100
+ mycodemap complexity -j # JSON 输出
101
+ ```
102
+
103
+ | 选项 | 说明 | 默认值 |
104
+ |------|------|--------|
105
+ | `-f, --file <path>` | 指定文件 | - |
106
+ | `-d, --detail` | 函数级详情 | - |
107
+ | `-j, --json` | JSON 格式输出 | - |
108
+ | `--structured` | 纯结构化输出 | - |
109
+
110
+ ---
111
+
112
+ ### cycles - 循环依赖检测
113
+
114
+ ```bash
115
+ mycodemap cycles # 检测所有循环依赖
116
+ mycodemap cycles -d 5 # 指定检测深度
117
+ mycodemap cycles -j # JSON 输出
118
+ ```
119
+
120
+ | 选项 | 说明 | 默认值 |
121
+ |------|------|--------|
122
+ | `-d, --depth <number>` | 检测深度 | `5` |
123
+ | `-j, --json` | JSON 格式输出 | - |
124
+ | `--structured` | 纯结构化输出 | - |
125
+
126
+ ---
127
+
128
+ ## analyze - 统一分析入口
129
+
130
+ ### 8 种分析意图
131
+
132
+ ```bash
133
+ # 1. 影响分析
134
+ mycodemap analyze -i impact -t "src/index.ts"
135
+ mycodemap analyze -i impact -t "src/index.ts" --scope transitive
136
+ mycodemap analyze -i impact -t "src/index.ts" --include-tests
137
+
138
+ # 2. 依赖分析
139
+ mycodemap analyze -i dependency -t "src/orchestrator"
140
+
141
+ # 3. 复杂度分析
142
+ mycodemap analyze -i complexity -t "src/domain"
143
+
144
+ # 4. 搜索分析
145
+ mycodemap analyze -i search -k "UnifiedResult"
146
+ mycodemap analyze -i search -k "keyword" --topK 20
147
+
148
+ # 5. 项目概览
149
+ mycodemap analyze -i overview -t "src/"
150
+
151
+ # 6. 重构建议
152
+ mycodemap analyze -i refactor -t "src/cache"
153
+
154
+ # 7. 引用查找
155
+ mycodemap analyze -i reference -t "src/interface/types"
156
+
157
+ # 8. 文档生成
158
+ mycodemap analyze -i documentation -t "src/domain/services"
159
+ ```
160
+
161
+ ### 输出选项
162
+
163
+ ```bash
164
+ # JSON 输出
165
+ mycodemap analyze -i impact -t "src/index.ts" --json
166
+
167
+ # 纯结构化(移除自然语言字段)
168
+ mycodemap analyze -i impact -t "src/index.ts" --structured --json
169
+
170
+ # 机器可读模式
171
+ mycodemap analyze -i impact -t "src/index.ts" --output-mode machine
172
+
173
+ # 人类可读模式(默认)
174
+ mycodemap analyze -i impact -t "src/index.ts" --output-mode human
175
+ ```
176
+
177
+ ### 通用选项
178
+
179
+ | 选项 | 说明 | 默认值 |
180
+ |------|------|--------|
181
+ | `-i, --intent <type>` | 分析类型 | `impact` |
182
+ | `-t, --targets <paths...>` | 目标路径(必填) | - |
183
+ | `-k, --keywords <words...>` | 搜索关键词 | - |
184
+ | `-s, --scope <scope>` | 范围: direct/transitive | `direct` |
185
+ | `-n, --topK <number>` | 返回结果数量 | `8` |
186
+ | `--include-tests` | 包含测试文件关联 | - |
187
+ | `--include-git-history` | 包含 Git 历史 | - |
188
+ | `--json` | JSON 格式输出 | - |
189
+ | `--structured` | 纯结构化输出 | - |
190
+ | `--output-mode <mode>` | 输出模式: machine/human | `human` |
191
+
192
+ ---
193
+
194
+ ## ci - CI 门禁
195
+
196
+ ### 子命令
197
+
198
+ ```bash
199
+ # 验证提交格式([TAG] scope: message)
200
+ mycodemap ci check-commits
201
+ mycodemap ci check-commits -c 5 # 最近 5 个提交
202
+ mycodemap ci check-commits -r "origin/main..HEAD"
203
+
204
+ # 验证文件头注释([META] [WHY])
205
+ mycodemap ci check-headers
206
+ mycodemap ci check-headers -d "src/domain" # 指定目录
207
+ mycodemap ci check-headers -f "file1.ts,file2.ts"
208
+
209
+ # 评估变更风险
210
+ mycodemap ci assess-risk
211
+ mycodemap ci assess-risk -t 0.5 # 设置阈值 0.5
212
+ mycodemap ci assess-risk -f "changed.ts"
213
+
214
+ # 验证文档同步
215
+ mycodemap ci check-docs-sync
216
+ mycodemap ci check-docs-sync --root "/path"
217
+
218
+ # 验证输出契约
219
+ mycodemap ci check-output-contract
220
+ mycodemap ci check-output-contract -s v1.0.0 -k 8 -t 160
221
+
222
+ # 检查提交文件数量
223
+ mycodemap ci check-commit-size
224
+ mycodemap ci check-commit-size -m 15
225
+ ```
226
+
227
+ ### 支持的提交 TAG
228
+
229
+ `[REFACTOR]`, `[TEST]`, `[DOCS]`, `[FEAT]`, `[FIX]`, `[CHORE]`, `[PERF]`, `[SECURITY]`, `[BREAKING]`, `[HOTFIX]`, `[MIGRATION]`, `[WIP]`
230
+
231
+ ---
232
+
233
+ ## workflow - 工作流编排
234
+
235
+ ### 生命周期管理
236
+
237
+ ```bash
238
+ # 启动工作流
239
+ mycodemap workflow start "实现用户认证模块"
240
+ mycodemap workflow start "修复登录接口" --template bugfix
241
+
242
+ # 查看状态
243
+ mycodemap workflow status
244
+
245
+ # 可视化
246
+ mycodemap workflow visualize
247
+ mycodemap workflow visualize --timeline
248
+ mycodemap workflow visualize --results
249
+
250
+ # 推进阶段
251
+ mycodemap workflow proceed
252
+ mycodemap workflow proceed --force
253
+
254
+ # 检查点
255
+ mycodemap workflow checkpoint
256
+
257
+ # 列出/删除
258
+ mycodemap workflow list
259
+ mycodemap workflow delete "workflow-id"
260
+
261
+ # 恢复
262
+ mycodemap workflow resume
263
+ mycodemap workflow resume "workflow-id"
264
+ ```
265
+
266
+ ### 模板管理
267
+
268
+ ```bash
269
+ mycodemap workflow template list # 列出模板
270
+ mycodemap workflow template list --all # 包含内置模板
271
+ mycodemap workflow template info bugfix # 模板详情
272
+ mycodemap workflow template apply bugfix # 应用模板
273
+ mycodemap workflow template recommend "任务" # 推荐模板
274
+ ```
275
+
276
+ ### 内置模板
277
+
278
+ - `refactoring` - 重构任务
279
+ - `bugfix` - 缺陷修复
280
+ - `feature` - 新功能开发
281
+ - `hotfix` - 紧急修复
282
+
283
+ ---
284
+
285
+ ## server - HTTP 服务器
286
+
287
+ ```bash
288
+ mycodemap server # 默认端口 3000
289
+ mycodemap server -p 8080 # 指定端口
290
+ mycodemap server -h 127.0.0.1 # 指定主机
291
+ mycodemap server --cors # 启用 CORS
292
+ mycodemap server --open # 自动打开浏览器
293
+ ```
294
+
295
+ | 选项 | 说明 | 默认值 |
296
+ |------|------|--------|
297
+ | `-p, --port <number>` | 服务器端口 | `3000` |
298
+ | `-h, --host <string>` | 服务器主机 | `0.0.0.0` |
299
+ | `--cors` | 启用 CORS | `false` |
300
+ | `--open` | 自动打开浏览器 | `false` |
301
+
302
+ ### API 端点
303
+
304
+ | 方法 | 端点 | 说明 |
305
+ |------|------|------|
306
+ | GET | `/api/v1/health` | 健康检查 |
307
+ | GET | `/api/v1/stats` | 项目统计 |
308
+ | GET | `/api/v1/search/symbols?q=` | 符号搜索 |
309
+ | GET | `/api/v1/modules/:id` | 模块详情 |
310
+ | GET | `/api/v1/symbols/:id` | 符号详情 |
311
+ | POST | `/api/v1/analysis/impact` | 影响分析 |
312
+ | GET | `/api/v1/analysis/cycles` | 循环依赖检测 |
313
+ | GET | `/api/v1/graph` | 依赖图数据 |
314
+ | GET | `/api/v1/export/:format` | 数据导出 |
315
+
316
+ ---
317
+
318
+ ## 其他命令
319
+
320
+ ### watch - 监听模式
321
+
322
+ ```bash
323
+ mycodemap watch # 前台监听
324
+ mycodemap watch -d # 后台守护进程
325
+ mycodemap watch -s # 停止守护进程
326
+ mycodemap watch -t # 查看状态
327
+ mycodemap watch -m smart # 指定模式
328
+ ```
329
+
330
+ ### report - 生成报告
331
+
332
+ ```bash
333
+ mycodemap report # 最近 7 天
334
+ mycodemap report -d 14 # 最近 14 天
335
+ mycodemap report -o ./reports # 输出目录
336
+ mycodemap report -j # JSON 输出
337
+ ```
338
+
339
+ ### logs - 日志管理
340
+
341
+ ```bash
342
+ mycodemap logs list # 列出日志
343
+ mycodemap logs list -l 20 # 限制 20 条
344
+ mycodemap logs list --level ERROR # 仅错误
345
+ mycodemap logs export -d 30 # 导出 30 天
346
+ mycodemap logs clear -d 30 --confirm # 清理 30 天前
347
+ ```
348
+
349
+ ### export - 导出代码图
350
+
351
+ ```bash
352
+ mycodemap export json # JSON 格式
353
+ mycodemap export graphml # GraphML (Gephi)
354
+ mycodemap export dot # DOT (Graphviz)
355
+ mycodemap export mermaid # Mermaid 语法
356
+ mycodemap export json -o ./output.json # 指定输出
357
+ ```
358
+
359
+ ---
360
+
361
+ ## 全局选项
362
+
363
+ 所有命令支持:
364
+
365
+ | 选项 | 说明 |
366
+ |------|------|
367
+ | `-V, --version` | 显示版本号 |
368
+ | `-h, --help` | 显示帮助信息 |
369
+ | `--no-cache` | 禁用缓存(部分命令) |