weflow-cli 1.5.0 → 1.6.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 (331) hide show
  1. package/ARCHITECTURE.md +105 -0
  2. package/CHANGELOG.md +110 -0
  3. package/CONTRIBUTING.md +45 -0
  4. package/LICENSE +21 -21
  5. package/OPERATIONS.md +272 -0
  6. package/README.en.md +281 -0
  7. package/README.md +333 -149
  8. package/SECURITY.md +47 -0
  9. package/bin/weflow-cli.ts +4032 -583
  10. package/dist/bin/weflow-cli.js +4296 -593
  11. package/dist/bin/weflow-cli.js.map +1 -1
  12. package/dist/mcp-server/index.js +178 -236
  13. package/dist/mcp-server/index.js.map +1 -1
  14. package/dist/src/core/dbPathService.d.ts +15 -1
  15. package/dist/src/core/dbPathService.d.ts.map +1 -1
  16. package/dist/src/core/dbPathService.js +177 -19
  17. package/dist/src/core/dbPathService.js.map +1 -1
  18. package/dist/src/core/keyService.d.ts +8 -0
  19. package/dist/src/core/keyService.d.ts.map +1 -1
  20. package/dist/src/core/keyService.js +127 -22
  21. package/dist/src/core/keyService.js.map +1 -1
  22. package/dist/src/core/ntCore.d.ts +59 -1
  23. package/dist/src/core/ntCore.d.ts.map +1 -1
  24. package/dist/src/core/ntCore.js +188 -64
  25. package/dist/src/core/ntCore.js.map +1 -1
  26. package/dist/src/core/sqlcipherCore.d.ts.map +1 -1
  27. package/dist/src/core/sqlcipherCore.js +18 -1
  28. package/dist/src/core/sqlcipherCore.js.map +1 -1
  29. package/dist/src/core/wcdbCore.d.ts.map +1 -1
  30. package/dist/src/core/wcdbCore.js +3 -6
  31. package/dist/src/core/wcdbCore.js.map +1 -1
  32. package/dist/src/services/assistantDaemon.d.ts +19 -0
  33. package/dist/src/services/assistantDaemon.d.ts.map +1 -0
  34. package/dist/src/services/assistantDaemon.js +117 -0
  35. package/dist/src/services/assistantDaemon.js.map +1 -0
  36. package/dist/src/services/assistantMemory.d.ts +36 -0
  37. package/dist/src/services/assistantMemory.d.ts.map +1 -0
  38. package/dist/src/services/assistantMemory.js +182 -0
  39. package/dist/src/services/assistantMemory.js.map +1 -0
  40. package/dist/src/services/assistantPrivacy.d.ts +25 -0
  41. package/dist/src/services/assistantPrivacy.d.ts.map +1 -0
  42. package/dist/src/services/assistantPrivacy.js +77 -0
  43. package/dist/src/services/assistantPrivacy.js.map +1 -0
  44. package/dist/src/services/assistantRouting.d.ts +18 -0
  45. package/dist/src/services/assistantRouting.d.ts.map +1 -0
  46. package/dist/src/services/assistantRouting.js +68 -0
  47. package/dist/src/services/assistantRouting.js.map +1 -0
  48. package/dist/src/services/assistantService.d.ts +37 -0
  49. package/dist/src/services/assistantService.d.ts.map +1 -0
  50. package/dist/src/services/assistantService.js +284 -0
  51. package/dist/src/services/assistantService.js.map +1 -0
  52. package/dist/src/services/assistantTools.d.ts +24 -0
  53. package/dist/src/services/assistantTools.d.ts.map +1 -0
  54. package/dist/src/services/assistantTools.js +582 -0
  55. package/dist/src/services/assistantTools.js.map +1 -0
  56. package/dist/src/services/chatService.d.ts +44 -0
  57. package/dist/src/services/chatService.d.ts.map +1 -1
  58. package/dist/src/services/chatService.js +105 -4
  59. package/dist/src/services/chatService.js.map +1 -1
  60. package/dist/src/services/configService.d.ts +55 -0
  61. package/dist/src/services/configService.d.ts.map +1 -1
  62. package/dist/src/services/configService.js +147 -6
  63. package/dist/src/services/configService.js.map +1 -1
  64. package/dist/src/services/evidenceService.d.ts +30 -0
  65. package/dist/src/services/evidenceService.d.ts.map +1 -0
  66. package/dist/src/services/evidenceService.js +98 -0
  67. package/dist/src/services/evidenceService.js.map +1 -0
  68. package/dist/src/services/exportService.d.ts +13 -20
  69. package/dist/src/services/exportService.d.ts.map +1 -1
  70. package/dist/src/services/exportService.js +113 -47
  71. package/dist/src/services/exportService.js.map +1 -1
  72. package/dist/src/services/initKeyService.d.ts +19 -0
  73. package/dist/src/services/initKeyService.d.ts.map +1 -0
  74. package/dist/src/services/initKeyService.js +80 -0
  75. package/dist/src/services/initKeyService.js.map +1 -0
  76. package/dist/src/services/messageContract.d.ts +23 -0
  77. package/dist/src/services/messageContract.d.ts.map +1 -0
  78. package/dist/src/services/messageContract.js +49 -0
  79. package/dist/src/services/messageContract.js.map +1 -0
  80. package/dist/src/services/messageQuery.d.ts +7 -0
  81. package/dist/src/services/messageQuery.d.ts.map +1 -0
  82. package/dist/src/services/messageQuery.js +30 -0
  83. package/dist/src/services/messageQuery.js.map +1 -0
  84. package/dist/src/services/wechat-formatter.js +14 -14
  85. package/dist/src/services/wechatMessageService.d.ts.map +1 -1
  86. package/dist/src/services/wechatMessageService.js +31 -3
  87. package/dist/src/services/wechatMessageService.js.map +1 -1
  88. package/dist/src/services/whitelistService.d.ts +52 -4
  89. package/dist/src/services/whitelistService.d.ts.map +1 -1
  90. package/dist/src/services/whitelistService.js +183 -17
  91. package/dist/src/services/whitelistService.js.map +1 -1
  92. package/dist/src/types.d.ts +20 -0
  93. package/dist/src/types.d.ts.map +1 -1
  94. package/dist/src/utils/dateRange.d.ts +15 -0
  95. package/dist/src/utils/dateRange.d.ts.map +1 -0
  96. package/dist/src/utils/dateRange.js +48 -0
  97. package/dist/src/utils/dateRange.js.map +1 -0
  98. package/dist/src/utils/mcpSecurity.d.ts +5 -0
  99. package/dist/src/utils/mcpSecurity.d.ts.map +1 -0
  100. package/dist/src/utils/mcpSecurity.js +39 -0
  101. package/dist/src/utils/mcpSecurity.js.map +1 -0
  102. package/dist/src/utils/packageRoot.d.ts +2 -0
  103. package/dist/src/utils/packageRoot.d.ts.map +1 -0
  104. package/dist/src/utils/packageRoot.js +16 -0
  105. package/dist/src/utils/packageRoot.js.map +1 -0
  106. package/dist/src/utils/python.d.ts +2 -0
  107. package/dist/src/utils/python.d.ts.map +1 -0
  108. package/dist/src/utils/python.js +72 -0
  109. package/dist/src/utils/python.js.map +1 -0
  110. package/dist/src/utils/pythonProcessEnv.d.ts +3 -0
  111. package/dist/src/utils/pythonProcessEnv.d.ts.map +1 -0
  112. package/dist/src/utils/pythonProcessEnv.js +46 -0
  113. package/dist/src/utils/pythonProcessEnv.js.map +1 -0
  114. package/dist/src/utils/talkerUtils.d.ts +4 -1
  115. package/dist/src/utils/talkerUtils.d.ts.map +1 -1
  116. package/dist/src/utils/talkerUtils.js +9 -9
  117. package/dist/src/utils/talkerUtils.js.map +1 -1
  118. package/dist/src/utils/wechatEmoji.d.ts +5 -0
  119. package/dist/src/utils/wechatEmoji.d.ts.map +1 -0
  120. package/dist/src/utils/wechatEmoji.js +35 -0
  121. package/dist/src/utils/wechatEmoji.js.map +1 -0
  122. package/docs/AI_INTERFACE.md +189 -0
  123. package/docs/BRANCHES.md +87 -0
  124. package/docs/DATA_CONTRACT.md +74 -0
  125. package/docs/DECISIONS.md +270 -0
  126. package/docs/DEEPSEEK_V4_FLASH/346/226/275/345/267/245/346/226/207/346/241/243.md +234 -0
  127. package/docs/EVIDENCE_GUIDE.md +96 -0
  128. package/docs/MCP.md +95 -0
  129. package/docs/PARTNERS.md +41 -0
  130. package/docs/PROJECT_STATE.md +96 -0
  131. package/docs/ROADMAP.md +191 -0
  132. package/docs/SETUP.md +103 -0
  133. package/docs/images/weflow-architecture-gpt-image-2.png +0 -0
  134. package/docs/images/weflow-architecture.png +0 -0
  135. package/docs/images/weflow-architecture.svg +65 -0
  136. package/mcp-server/index.ts +169 -269
  137. package/package.json +81 -72
  138. package/requirements-3x.txt +4 -0
  139. package/requirements-voice.txt +15 -0
  140. package/requirements.txt +9 -0
  141. package/resources/js/marked.min.js +69 -0
  142. package/resources/wechat-emoji/666.png +0 -0
  143. package/resources/wechat-emoji/Awesome.png +0 -0
  144. package/resources/wechat-emoji/Concerned.png +0 -0
  145. package/resources/wechat-emoji/Cry.png +0 -0
  146. package/resources/wechat-emoji/Emm.png +0 -0
  147. package/resources/wechat-emoji/Facepalm.png +0 -0
  148. package/resources/wechat-emoji/Grin.png +0 -0
  149. package/resources/wechat-emoji/OK.png +0 -0
  150. package/resources/wechat-emoji/Respect.png +0 -0
  151. package/resources/wechat-emoji/Sick.png +0 -0
  152. package/resources/wechat-emoji/Sleep.png +0 -0
  153. package/resources/wechat-emoji/Smile.png +0 -0
  154. package/resources/wechat-emoji//344/272/262/344/272/262.png +0 -0
  155. package/resources/wechat-emoji//344/276/277/344/276/277.png +0 -0
  156. package/resources/wechat-emoji//345/201/267/347/254/221.png +0 -0
  157. package/resources/wechat-emoji//345/202/262/346/205/242.png +0 -0
  158. package/resources/wechat-emoji//345/206/215/350/247/201.png +0 -0
  159. package/resources/wechat-emoji//345/207/213/350/260/242.png +0 -0
  160. package/resources/wechat-emoji//345/212/240/346/262/271.png +0 -0
  161. package/resources/wechat-emoji//345/213/276/345/274/225.png +0 -0
  162. package/resources/wechat-emoji//345/217/221/345/221/206.png +0 -0
  163. package/resources/wechat-emoji//345/217/221/346/200/222.png +0 -0
  164. package/resources/wechat-emoji//345/217/221/346/212/226.png +0 -0
  165. package/resources/wechat-emoji//345/217/257/346/200/234.png +0 -0
  166. package/resources/wechat-emoji//345/217/263/345/223/274/345/223/274.png +0 -0
  167. package/resources/wechat-emoji//345/217/271/346/260/224.png +0 -0
  168. package/resources/wechat-emoji//345/220/203/347/223/234.png +0 -0
  169. package/resources/wechat-emoji//345/220/210/345/215/201.png +0 -0
  170. package/resources/wechat-emoji//345/220/220.png +0 -0
  171. package/resources/wechat-emoji//345/221/262/347/211/231.png +0 -0
  172. package/resources/wechat-emoji//345/222/222/351/252/202.png +0 -0
  173. package/resources/wechat-emoji//345/222/226/345/225/241.png +0 -0
  174. package/resources/wechat-emoji//345/223/207.png +0 -0
  175. package/resources/wechat-emoji//345/225/244/351/205/222.png +0 -0
  176. package/resources/wechat-emoji//345/230/230.png +0 -0
  177. package/resources/wechat-emoji//345/230/264/345/224/207.png +0 -0
  178. package/resources/wechat-emoji//345/230/277/345/223/210.png +0 -0
  179. package/resources/wechat-emoji//345/233/247.png +0 -0
  180. package/resources/wechat-emoji//345/233/260.png +0 -0
  181. package/resources/wechat-emoji//345/235/217/347/254/221.png +0 -0
  182. package/resources/wechat-emoji//345/244/247/345/223/255.png +0 -0
  183. package/resources/wechat-emoji//345/244/251/345/225/212.png +0 -0
  184. package/resources/wechat-emoji//345/244/252/351/230/263.png +0 -0
  185. package/resources/wechat-emoji//345/244/261/346/234/233.png +0 -0
  186. package/resources/wechat-emoji//345/245/270/347/254/221.png +0 -0
  187. package/resources/wechat-emoji//345/245/275/347/232/204.png +0 -0
  188. package/resources/wechat-emoji//345/247/224/345/261/210.png +0 -0
  189. package/resources/wechat-emoji//345/256/263/347/276/236.png +0 -0
  190. package/resources/wechat-emoji//345/260/264/345/260/254.png +0 -0
  191. package/resources/wechat-emoji//345/272/206/347/245/235.png +0 -0
  192. package/resources/wechat-emoji//345/274/261.png +0 -0
  193. package/resources/wechat-emoji//345/274/272.png +0 -0
  194. package/resources/wechat-emoji//345/276/227/346/204/217.png +0 -0
  195. package/resources/wechat-emoji//345/276/256/347/254/221.png +0 -0
  196. package/resources/wechat-emoji//345/277/203/347/242/216.png +0 -0
  197. package/resources/wechat-emoji//345/277/253/345/223/255/344/272/206.png +0 -0
  198. package/resources/wechat-emoji//346/201/220/346/203/247.png +0 -0
  199. package/resources/wechat-emoji//346/202/240/351/227/262.png +0 -0
  200. package/resources/wechat-emoji//346/203/212/346/201/220.png +0 -0
  201. package/resources/wechat-emoji//346/203/212/350/256/266.png +0 -0
  202. package/resources/wechat-emoji//346/204/211/345/277/253.png +0 -0
  203. package/resources/wechat-emoji//346/206/250/347/254/221.png +0 -0
  204. package/resources/wechat-emoji//346/211/223/350/204/270.png +0 -0
  205. package/resources/wechat-emoji//346/212/223/347/213/202.png +0 -0
  206. package/resources/wechat-emoji//346/212/240/351/274/273.png +0 -0
  207. package/resources/wechat-emoji//346/212/261/346/213/263.png +0 -0
  208. package/resources/wechat-emoji//346/213/245/346/212/261.png +0 -0
  209. package/resources/wechat-emoji//346/213/263/345/244/264.png +0 -0
  210. package/resources/wechat-emoji//346/215/202/350/204/270.png +0 -0
  211. package/resources/wechat-emoji//346/217/241/346/211/213.png +0 -0
  212. package/resources/wechat-emoji//346/222/207/345/230/264.png +0 -0
  213. package/resources/wechat-emoji//346/223/246/346/261/227.png +0 -0
  214. package/resources/wechat-emoji//346/225/262/346/211/223.png +0 -0
  215. package/resources/wechat-emoji//346/227/240/350/257/255.png +0 -0
  216. package/resources/wechat-emoji//346/227/272/346/237/264.png +0 -0
  217. package/resources/wechat-emoji//346/231/225.png +0 -0
  218. package/resources/wechat-emoji//346/234/210/344/272/256.png +0 -0
  219. package/resources/wechat-emoji//346/234/272/346/231/272.png +0 -0
  220. package/resources/wechat-emoji//346/261/227.png +0 -0
  221. package/resources/wechat-emoji//346/265/201/346/263/252.png +0 -0
  222. package/resources/wechat-emoji//347/202/270/345/274/271.png +0 -0
  223. package/resources/wechat-emoji//347/203/237/350/212/261.png +0 -0
  224. package/resources/wechat-emoji//347/210/206/347/253/271.png +0 -0
  225. package/resources/wechat-emoji//347/210/261/345/277/203.png +0 -0
  226. package/resources/wechat-emoji//347/214/252/345/244/264.png +0 -0
  227. package/resources/wechat-emoji//347/216/253/347/221/260.png +0 -0
  228. package/resources/wechat-emoji//347/224/237/347/227/205.png +0 -0
  229. package/resources/wechat-emoji//347/226/221/351/227/256.png +0 -0
  230. package/resources/wechat-emoji//347/231/274.png +0 -0
  231. package/resources/wechat-emoji//347/231/275/347/234/274.png +0 -0
  232. package/resources/wechat-emoji//347/232/261/347/234/211.png +0 -0
  233. package/resources/wechat-emoji//347/235/241.png +0 -0
  234. package/resources/wechat-emoji//347/240/264/346/266/225/344/270/272/347/254/221.png +0 -0
  235. package/resources/wechat-emoji//347/244/274/347/211/251.png +0 -0
  236. package/resources/wechat-emoji//347/244/276/344/274/232/347/244/276/344/274/232.png +0 -0
  237. package/resources/wechat-emoji//347/246/217.png +0 -0
  238. package/resources/wechat-emoji//347/254/221/350/204/270.png +0 -0
  239. package/resources/wechat-emoji//347/272/242/345/214/205.png +0 -0
  240. package/resources/wechat-emoji//347/277/273/347/231/275/347/234/274.png +0 -0
  241. package/resources/wechat-emoji//350/200/266.png +0 -0
  242. package/resources/wechat-emoji//350/203/234/345/210/251.png +0 -0
  243. package/resources/wechat-emoji//350/204/270/347/272/242.png +0 -0
  244. package/resources/wechat-emoji//350/211/262.png +0 -0
  245. package/resources/wechat-emoji//350/213/246/346/266/251.png +0 -0
  246. package/resources/wechat-emoji//350/217/234/345/210/200.png +0 -0
  247. package/resources/wechat-emoji//350/233/213/347/263/225.png +0 -0
  248. package/resources/wechat-emoji//350/241/260.png +0 -0
  249. package/resources/wechat-emoji//350/243/202/345/274/200.png +0 -0
  250. package/resources/wechat-emoji//350/256/251/346/210/221/347/234/213/347/234/213.png +0 -0
  251. package/resources/wechat-emoji//350/260/203/347/232/256.png +0 -0
  252. package/resources/wechat-emoji//350/267/263/350/267/263.png +0 -0
  253. package/resources/wechat-emoji//350/275/254/345/234/210.png +0 -0
  254. package/resources/wechat-emoji//351/204/231/350/247/206.png +0 -0
  255. package/resources/wechat-emoji//351/227/255/345/230/264.png +0 -0
  256. package/resources/wechat-emoji//351/230/264/351/231/251.png +0 -0
  257. package/resources/wechat-emoji//351/232/276/350/277/207.png +0 -0
  258. package/resources/wechat-emoji//351/252/267/351/253/205.png +0 -0
  259. package/resources/wechat-emoji//351/274/223/346/216/214.png +0 -0
  260. package/scripts/_batch_link_sources.py +73 -73
  261. package/scripts/_utils.py +29 -0
  262. package/scripts/annual_report.py +796 -796
  263. package/scripts/auto_tag.py +128 -128
  264. package/scripts/biz_daily.py +210 -53
  265. package/scripts/chat_report.py +10 -0
  266. package/scripts/chat_stats.py +702 -702
  267. package/scripts/classify_daily.py +17 -11
  268. package/scripts/create_reading_notes.py +370 -370
  269. package/scripts/daily_stats.py +132 -0
  270. package/scripts/enrich_backlinks.py +163 -163
  271. package/scripts/export_chat_html.py +1704 -107
  272. package/scripts/extract_todos.py +445 -404
  273. package/scripts/fav_server.py +119 -12
  274. package/scripts/fix_topics.py +111 -111
  275. package/scripts/generate_ai_report.py +1 -1
  276. package/scripts/generate_html.py +597 -277
  277. package/scripts/inspection_records.py +354 -0
  278. package/scripts/mcp_bridge.py +398 -398
  279. package/scripts/nt_decrypt.py +693 -48
  280. package/scripts/pipeline.py +27 -19
  281. package/scripts/promote_all.py +312 -310
  282. package/scripts/promote_ideas.py +299 -297
  283. package/scripts/rag_chat.py +194 -191
  284. package/scripts/semantic_search.py +435 -431
  285. package/scripts/sync_fav.py +201 -146
  286. package/scripts/sync_weread.py +192 -192
  287. package/scripts/vault_rag.py +140 -139
  288. package/scripts/vault_search.py +141 -141
  289. package/scripts/wechat_emoji.py +132 -0
  290. package/scripts/wechat_emoticon.py +433 -0
  291. package/scripts/wechat_image.py +258 -0
  292. package/scripts/wechat_voice.py +327 -0
  293. package/src/core/dbPathService.ts +163 -18
  294. package/src/core/keyService.ts +137 -25
  295. package/src/core/ntCore.ts +202 -61
  296. package/src/core/sqlcipherCore.ts +17 -1
  297. package/src/core/wcdbCore.ts +3 -7
  298. package/src/services/assistantDaemon.ts +111 -0
  299. package/src/services/assistantMemory.ts +193 -0
  300. package/src/services/assistantPrivacy.ts +87 -0
  301. package/src/services/assistantRouting.ts +92 -0
  302. package/src/services/assistantService.ts +295 -0
  303. package/src/services/assistantTools.ts +549 -0
  304. package/src/services/chatService.ts +133 -4
  305. package/src/services/configService.ts +194 -6
  306. package/src/services/evidenceService.ts +129 -0
  307. package/src/services/exportService.ts +113 -48
  308. package/src/services/initKeyService.ts +83 -0
  309. package/src/services/messageContract.ts +77 -0
  310. package/src/services/messageQuery.ts +38 -0
  311. package/src/services/wechat-formatter.ts +348 -348
  312. package/src/services/wechatMessageService.ts +25 -3
  313. package/src/services/wereadService.ts +308 -308
  314. package/src/services/whitelistService.ts +209 -22
  315. package/src/types.ts +20 -0
  316. package/src/utils/dateRange.ts +58 -0
  317. package/src/utils/mcpSecurity.ts +39 -0
  318. package/src/utils/packageRoot.ts +14 -0
  319. package/src/utils/python.ts +73 -0
  320. package/src/utils/pythonProcessEnv.ts +45 -0
  321. package/src/utils/talkerUtils.ts +14 -2
  322. package/dist/src/utils/errors.d.ts +0 -25
  323. package/dist/src/utils/errors.d.ts.map +0 -1
  324. package/dist/src/utils/errors.js +0 -43
  325. package/dist/src/utils/errors.js.map +0 -1
  326. package/dist/src/utils/pythonRunner.d.ts +0 -27
  327. package/dist/src/utils/pythonRunner.d.ts.map +0 -1
  328. package/dist/src/utils/pythonRunner.js +0 -62
  329. package/dist/src/utils/pythonRunner.js.map +0 -1
  330. package/src/utils/errors.ts +0 -42
  331. package/src/utils/pythonRunner.ts +0 -81
package/README.md CHANGED
@@ -1,149 +1,333 @@
1
-
2
- <div align="center">
3
-
4
- <h1>WeFlow CLI</h1>
5
-
6
- **让 AI 读懂你的微信 — 一键生成公众号日报、导出聊天记录**
7
-
8
- [![npm](https://img.shields.io/npm/v/weflow-cli)](https://www.npmjs.com/package/weflow-cli)
9
- ![Node](https://img.shields.io/badge/node-18+-green)
10
- ![Python](https://img.shields.io/badge/python-3.10+-blue)
11
- ![License](https://img.shields.io/badge/license-MIT-yellow)
12
-
13
- </div>
14
-
15
- ---
16
-
17
- ## 一分钟上手
18
-
19
- ```bash
20
- # 1. 安装
21
- npm install -g weflow-cli
22
-
23
- # 2. 初始化(自动提取微信密钥)
24
- weflow-cli init
25
-
26
- # 3. 让 AI 接管
27
- weflow-cli mcp-config > .mcp.json
28
-
29
- # 4. 生成今日公众号日报
30
- weflow-cli daily --api-key <你的DeepSeek密钥>
31
- ```
32
-
33
- 重启 AI 编辑器后,你的 AI 助手就可以自动搜索、浏览、分析你的微信知识库。
34
-
35
- ---
36
-
37
- ## 你能做什么
38
-
39
- | 场景 | 操作 |
40
- |------|------|
41
- | 📰 **公众号日报** | 每天自动抓取所有公众号推送 → AI 分类·摘要·行动建议 |
42
- | 🔍 **知识库搜索** | 搜索所有历史文章(支持 MCP,AI 直接调用) |
43
- | 💬 **聊天记录导出** | 导出任意会话为 HTML/JSON/TXT/Excel |
44
- | 📊 **统计报告** | 聊天月报、年度数字生活报告、待办提取 |
45
- | 📖 **微信读书** | 书架同步、笔记划线、阅读统计、书评浏览 |
46
- | 🧠 **Obsidian 集成** | RAG 问答、语义搜索、知识管道 |
47
-
48
- ---
49
-
50
- ## 环境检查
51
-
52
- ```bash
53
- weflow-cli check # 一键检测 Python、依赖、数据库
54
- ```
55
-
56
- ---
57
-
58
- ## 公众号日报流水线
59
-
60
- ```bash
61
- # 生成今日日报(抓取 + AI 摘要 + 行动建议 + HTML 阅读器)
62
- weflow-cli daily --api-key <key>
63
-
64
- # 仅抓取某天
65
- weflow-cli daily --date 2026-06-20 --api-key <key>
66
-
67
- # 启动本地阅读器(浏览器浏览 + 收藏 + 笔记)
68
- weflow-cli daily-server --date 2026-06-20
69
- ```
70
-
71
- ---
72
-
73
- ## MCP Server AI 直接操作
74
-
75
- ```bash
76
- # 输出 MCP 配置
77
- weflow-cli mcp-config # 打印 JSON
78
- weflow-cli mcp-config -o .mcp.json # 写入文件
79
- ```
80
-
81
- 重启编辑器后,AI 自动获得以下工具:
82
-
83
- | 工具 | 用途 |
84
- |------|------|
85
- | `wechat.search_articles` | 按关键词/主题/日期搜索知识库 |
86
- | `wechat.get_daily` | 获取某天的公众号日报 |
87
- | `wechat.get_review` | 获取 AI 学习日报 |
88
- | `wechat.get_stats` | 知识库统计概览 |
89
- | `wechat.get_concepts` | 概念图谱查询 |
90
-
91
- ---
92
-
93
- ## 命令速查
94
-
95
- ```bash
96
- # 初始化
97
- weflow-cli init # 自动检测微信 + 提取密钥
98
- weflow-cli check # 环境检查
99
-
100
- # MCP
101
- weflow-cli mcp-config # 输出 MCP 配置
102
-
103
- # 公众号日报
104
- weflow-cli daily # 今天
105
- weflow-cli daily --date D # 指定日期
106
- weflow-cli daily-server # 启动阅读器
107
- weflow-cli daily-server --open # 启动并自动打开浏览器
108
-
109
- # 聊天
110
- weflow-cli sessions # 会话列表
111
- weflow-cli messages <昵称> # 查看消息
112
- weflow-cli export <昵称> html # 导出 HTML
113
-
114
- # 报告
115
- weflow-cli report # 聊天月报
116
- weflow-cli annual-report # 年度报告
117
-
118
- # 微信读书
119
- weflow-cli weread shelf # 书架
120
- weflow-cli weread stats # 阅读统计
121
- weflow-cli weread notes # 笔记划线
122
- weflow-cli weread search <书名>
123
- ```
124
-
125
- ---
126
-
127
- ## 常见问题
128
-
129
- **Q: 需要哪些前置环境?**
130
- A: Node.js 18+、Python 3.10+、微信桌面版已登录。运行 `weflow-cli check` 检查。
131
-
132
- **Q: 会泄露隐私吗?**
133
- A: 不会。所有数据纯本地处理,密钥 AES-256-GCM 加密绑定单机。公众号文章仅本地索引。
134
-
135
- **Q: 图片不显示?**
136
- A: 文章图片自动下载到 `images/` 目录,HTML 阅读器通过本地服务器代理加载,绕过微信防盗链。
137
-
138
- **Q: 如何让 AI 自动操作?**
139
- A: `weflow-cli mcp-config -o .mcp.json`,重启 AI 编辑器即可。
140
-
141
- ---
142
-
143
- ## Thanks
144
-
145
- - [WeFlow](https://github.com/hicccc77/WeFlow) 原始桌面应用
146
- - [DeepSeek](https://deepseek.com/) — AI 摘要引擎
147
- - [sqlcipher3](https://pypi.org/project/sqlcipher3/) — 数据库解密
148
-
149
- MIT License · [GitHub](https://github.com/zhuobichen/weflow-cli)
1
+ <div align="center">
2
+
3
+ <h1>𝗪𝗲𝗙𝗹𝗼𝘄 𝗖𝗟𝗜 <img src="./logo.png" width="280" valign="middle" alt="WeFlow CLI logo" /></h1>
4
+
5
+ **简体中文** · [English](./README.en.md)
6
+
7
+ *今人不见古时月,今月曾经照古人*
8
+
9
+ > 夫天地者,万物之逆旅也;光阴者,百代之过客也。
10
+
11
+ > 让聊天记录、公众号阅读和个人知识工作流回到你的本地电脑。
12
+
13
+ [![npm](https://img.shields.io/npm/v/weflow-cli)](https://www.npmjs.com/package/weflow-cli)
14
+ [![Node.js](https://img.shields.io/badge/Node.js-18%2B-339933)](https://nodejs.org/)
15
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB)](https://www.python.org/)
16
+ [![WeChat](https://img.shields.io/badge/WeChat-4.x%20tested-07C160?logo=wechat&logoColor=white)](https://github.com/zhuobichen/weflow-cli/releases)
17
+ [![Local-first](https://img.shields.io/badge/local--first-zero%20telemetry-8A2BE2)](./SECURITY.md)
18
+ [![License](https://img.shields.io/badge/License-MIT-f4b400)](./LICENSE)
19
+
20
+ </div>
21
+
22
+ **WeFlow CLI 把微信变成你的本地第二大脑**:在本机读取和查询聊天记录、导出可读 HTML;把公众号文章整理成带 AI 摘要的日报;读取微信收藏;构建可语义搜索的知识库;并通过 MCP 接入 Claude Code 等 AI 编辑器。支持 Windows 与 Linux。
23
+
24
+ > 🔒 **本地优先**:完全在你的电脑上运行——零遥测、零云上报;数据库密钥以机器绑定的 AES-256-GCM 加密存储在本机。AI 功能仅在显式配置你自己的 API Key 后启用。详见[安全与隐私声明](./SECURITY.md)。
25
+
26
+ > 本项目仅限于处理你有权访问的数据。请遵守适用法律、微信规则和他人的隐私边界。
27
+
28
+ > **⚠️ 使用边界与风险**:仅在你本人控制的设备上,处理你本人拥有或明确获授权访问的数据。请勿将本项目用于监控、跟踪或读取他人的微信数据,也不要部署到他人设备或远程静默运行。使用前请自行确认适用法律、微信服务条款及账号权限;第三方工具可能触发账号风控、限制或封禁。本项目不构成法律意见,使用者需自行承担使用责任。
29
+
30
+ ## 效果一览
31
+
32
+ **微信收藏查询**(读取本地 `favorite.db`,支持类型过滤与关键词搜索):
33
+
34
+ ```text
35
+ $ weflow-cli fav list -n 3
36
+
37
+ 收藏列表 (共 1042 条, 显示 3 条):
38
+
39
+ [2026/8/21 19:42:42] [文章] “豆包型人格”爆火,可千万别学
40
+ 来源: 中国研究生
41
+ https://mp.weixin.qq.com/s/eDk_kcyd8ltuqn6J3iReVg
42
+ [2026/8/21 10:50:38] [文章] 爆火插件让DeepSeek V4 Pro 0813性能拉满,全面超越 Fable 5!
43
+ 来源: 智猩猩AI
44
+ https://mp.weixin.qq.com/s/3GXFjmtUsq42sXJHJGgwyg
45
+ [2026/8/21 10:47:21] [文章] 250年前,一个26岁年轻人写了一本小册子,至今仍在拷问每一个文明社会
46
+ 来源: 悦读撷英
47
+ https://mp.weixin.qq.com/s/YIkB8TyyyimPP1hmgQQPZg
48
+ ```
49
+
50
+ **完整工作流,一条命令一个环节**:
51
+
52
+ ```text
53
+ weflow-cli sessions # 会话列表
54
+ weflow-cli messages "联系人" -n 20 # 查询聊天消息
55
+ weflow-cli export "联系人" html # 导出 HTML / Excel / Markdown / JSON
56
+ weflow-cli fav list -t article -k AI # 微信收藏: 类型过滤 + 关键词搜索
57
+ weflow-cli daily --date 2026-08-21 # 公众号日报 + AI 摘要与分类
58
+ weflow-cli daily-server # 本地阅读器 http://localhost:8765
59
+ weflow-cli chat "RAG 的原理是什么?" # 知识库 RAG 问答
60
+ weflow-cli mcp-config # 一键接入 Claude Code 等 MCP 客户端
61
+ ```
62
+
63
+ ## 平台支持
64
+
65
+ | 能力 | Windows | macOS | Linux |
66
+ | --- | --- | --- | --- |
67
+ | 数据目录自动发现 | | ✅ | ✅ |
68
+ | 本地数据初始化 | ✅ 自动发现/验证 | ❌ 需手动提供凭据 | ⚠️ 取决于发行版与权限 |
69
+ | 聊天记录查询(NT / 本地数据库) | ✅ | ✅ | ✅ |
70
+ | WCDB 数据服务(联系人昵称等) | ✅ | ⚠️ 依赖原生库 | ⚠️ 依赖原生库 |
71
+ | 公众号日报 / 知识库 / MCP | ✅ | ✅ | ✅ |
72
+
73
+ macOS:当前不提供自动初始化;如你已通过官方或其他经授权的方式取得本地数据访问凭据,请按 `weflow-cli init --path` `config` 的帮助完成配置。
74
+
75
+ ### Linux 快速上手(微信 4.x Linux 原生版)
76
+
77
+ ```bash
78
+ # 1. 安装 sqlcipher 开发库(编译 sqlcipher3 需要)
79
+ sudo apt install libsqlcipher-dev
80
+
81
+ # 2. 安装 Python 依赖
82
+ pip3 install --user sqlcipher3 cryptography html2text zstandard
83
+
84
+ # 3. 安装 CLI 并初始化
85
+ npm install -g weflow-cli
86
+ weflow-cli init # 按提示完成本地初始化
87
+ ```
88
+
89
+ Linux 的自动初始化能力取决于微信发行版、Python 依赖和当前用户权限;请先运行 `weflow-cli check`,按系统安全策略配置,不要为了排障降低整机权限。
90
+
91
+ ## 你可以做什么
92
+
93
+ | 场景 | 能力 |
94
+ | --- | --- |
95
+ | 聊天记录 | 查询会话、联系人和消息;导出 JSON、TXT、Markdown、HTML、Excel。 |
96
+ | 公众号日报 | 抓取文章、AI 摘要与分类、生成本地阅读页,保留收藏和已读状态。 |
97
+ | 个人知识库 | 同步微信读书笔记、构建 Obsidian Vault、语义搜索、RAG 问答和概念 Wiki。 |
98
+ | AI 协作 | 通过 MCP 把文章、知识库、日报和受控的本地数据能力交给兼容客户端;工具清单以 `weflow-cli mcp-config` 和 `docs/MCP.md` 为准。 |
99
+ | 个人回顾 | 聊天月报、年度报告、待办提取与朋友圈本地缓存查询。 |
100
+ | 微信收藏 | 读取微信"收藏"内容(公众号文章、文字、图片、视频、聊天记录),支持类型过滤、关键词搜索与 Markdown/JSON 导出。 |
101
+ | 第二大脑 Agent | 在微信里和本地 AI 助手对话:自然语言查询聊天记录、收藏、朋友圈、日报、微信读书、待办与知识库;三层记忆跨会话延续,守护进程常驻后台。 |
102
+
103
+ > **⚠️ 合法使用边界**:本工具仅限访问**你自己拥有并登录的微信账号**在自己设备上的数据。未经他人明确同意,不得用它监控配偶、员工或任何第三方,也不得部署到他人设备或远程静默运行。请同时留意微信服务条款、账号风控和当地法律要求。详见 [SECURITY.md](SECURITY.md)。
104
+
105
+ ## 三分钟上手
106
+
107
+ ### 1. 安装与检查
108
+
109
+ > npm 包与 GitHub 发布分开进行;需要最新修复时,请先确认 npm 包版本,或直接使用 GitHub `master` 分支代码。
110
+
111
+ 需要 Node.js 18+、Python 3.10+,以及已登录的 Windows 微信。安装后先检查本机环境:
112
+
113
+ ```powershell
114
+ npm install -g weflow-cli
115
+ weflow-cli check
116
+ ```
117
+
118
+ 安装标准 Windows 4.x 工作流所需的 Python 依赖:
119
+
120
+ ```powershell
121
+ python -m pip install -r requirements.txt
122
+ ```
123
+
124
+ 若仍在使用微信 3.x,再安装可选依赖:`python -m pip install -r requirements-3x.txt`。
125
+
126
+ ### 2. 初始化本地数据访问
127
+
128
+ 关闭微信后运行初始化,按提示启动并登录微信,CLI 会尝试发现数据目录并提取所需密钥:
129
+
130
+ ```powershell
131
+ weflow-cli init
132
+ ```
133
+
134
+ 微信“存储位置”、账号目录和其 `db_storage` 目录都可以直接指定:
135
+
136
+ ```powershell
137
+ weflow-cli init --path "D:\WeChat\xwechat_files"
138
+ ```
139
+
140
+ 初始化完成后,先验证是否能读取到自己的数据:
141
+
142
+ ```powershell
143
+ weflow-cli sessions
144
+ weflow-cli contacts -k "关键词"
145
+ weflow-cli messages "联系人" -n 10
146
+ ```
147
+
148
+ 遇到密钥、数据库或 Python 环境问题,请按 [操作与排障手册](./OPERATIONS.md) 逐项检查。
149
+
150
+ ### 3. 选择一条工作流
151
+
152
+ **导出一段聊天记录**
153
+
154
+ ```powershell
155
+ weflow-cli export "联系人" html --output ./output
156
+ ```
157
+
158
+ HTML 导出默认内嵌微信缓存里的缩略图,并尽力还原图片、表情包、系统消息和公众号卡片。远程媒体按 URL 缓存在输出目录的 `.cover-cache/`,所以**重复导出接近瞬时**(实测 1600+ 条约 2 秒),首次导出才需要联网。自定义表情包从本地缓存离线解密,seed 未配置时会自动扫描微信内存反推并提示固化命令。确需原图(5–24MB/张)时加 `--full-images`,代价是慢数倍。细节见[操作与排障手册](./OPERATIONS.md#4-导出聊天记录)。
159
+
160
+ **生成当天公众号日报**
161
+
162
+ ```powershell
163
+ weflow-cli daily --date 2026-08-12 --api-key "你的 DeepSeek API Key"
164
+ weflow-cli daily-server --date 2026-08-12
165
+
166
+ # 仅预览指定日期的文章,不调用 AI、不写入日报
167
+ weflow-cli daily --date 2026-08-12 --dry-run
168
+
169
+ # 单次生成日报时关闭所有 AI,仍保留抓取、HTML 和本地索引
170
+ weflow-cli daily --date 2026-08-12 --no-ai
171
+
172
+ # 查看最近 30 天各公众号的推送与日报处理频率
173
+ weflow-cli daily-stats --days 30 --limit 30
174
+
175
+ # 只生成指定公众号的日报(可重复,也可用逗号分隔)
176
+ weflow-cli daily --source "公众号A" --source "公众号B"
177
+ weflow-cli daily --source "公众号A,公众号B"
178
+
179
+ # 持久化日报来源;留空则恢复为全部公众号
180
+ weflow-cli config set dailySources "公众号A,公众号B"
181
+
182
+ # 持久化关闭日报 AI;恢复为 true 即重新启用
183
+ weflow-cli config set dailyAiEnabled false
184
+ weflow-cli config set dailyAiEnabled true
185
+
186
+ # 为来源设置固定类别;已分类来源只生成摘要,不再调用文章主题分类
187
+ weflow-cli config set dailySourceCategories '<JSON object: source name or gh_ ID -> AI/政治/学术/新闻/文学/投资>'
188
+ ```
189
+
190
+ 阅读器默认在 `http://localhost:8765/` 提供服务。
191
+
192
+ **接入 AI 编辑器**
193
+
194
+ ```powershell
195
+ weflow-cli mcp-config > .mcp.json
196
+ ```
197
+
198
+ 将生成的配置放到所用 MCP 客户端的配置位置后重启客户端即可。MCP 的工具列表与配置方式见 `weflow-cli mcp-config` 输出。
199
+
200
+ 除知识库类工具外,MCP 也暴露受控的只读本地微信数据能力(会话、聊天记录、收藏、朋友圈、日报、微信读书、待办、知识库与助手记忆查询)。默认 MCP 不发送消息、不发布文章,也不修改待办、记忆或配置。工具清单以当前代码和 [MCP 集成指南](./docs/MCP.md) 为准,不固定写死数量。
201
+
202
+ **在微信里挂一个本地 AI 助手(第二大脑)**
203
+
204
+ ```powershell
205
+ weflow-cli config set deepseekApiKey "sk-..." # 或任意 OpenAI 兼容端点: aiBaseUrl + aiModel
206
+ weflow-cli login-wechat # 扫码绑定消息通道 (微信里会出现 ClawBot 联系人)
207
+ weflow-cli assistant start # 后台守护进程常驻
208
+ ```
209
+
210
+ 之后在手机微信的 ClawBot 对话里直接说话,助手会自动查询本地聊天记录和收藏作答,并具备跨会话记忆:
211
+
212
+ - 「我最近都在忙什么?」— 自动检索会话与聊天记录综合回答
213
+ - 「总结我和 XX 的聊天」— 定向读取与某联系人的消息
214
+ - 「收藏里有哪些关于 AI 的文章?」— 搜索微信收藏
215
+ - 「这篇收藏讲了什么?」— 抓取收藏文章正文并总结
216
+ - 「最近朋友圈都发了啥?」「谁最爱发朋友圈?」— 朋友圈时间线与统计
217
+ - 「今天公众号推了什么?有哪些 AI 类的?」— 日报查询,按分类/关键词过滤
218
+ - 「我在读什么书?」「XX 这本书的笔记」— 微信读书书架与笔记本
219
+ - 「我有什么待办?有急事吗?」— 待办清单(按紧急度排序)
220
+ - 「知识库里怎么讲 RAG 的?」— 概念 Wiki 检索
221
+ - 「记住:我的项目叫 weflow-cli」— 写入长期记忆
222
+
223
+ 运行机制:守护进程通过微信官方 Bot 通道(iLink)长轮询收发消息,Agent 循环、三层记忆(工作窗口 / 滚动摘要 / 长期事实)、数据库查询全部在本机执行;仅最终提问与回复文本会发送给所配置的 LLM,工具输出中的电话/邮箱/链接等 PII 默认自动脱敏(`config set assistantPrivacy strict` 可加强,`ollama` 本地引擎则完全不出网)。会话 24 小时未活跃需重新扫码,单窗口内主动回复有官方条数限制。
224
+
225
+ 成本护栏:内置每日 100 条处理上限(防异常流量烧钱,微信内发「记忆」可查用量);助手默认拒绝所有来信,必须明确配置白名单后才会触发 AI 调用:
226
+
227
+ ```powershell
228
+ weflow-cli config set assistantWhitelist "你的@im.wechat ID" # 未设置 = 拒绝所有人
229
+ ```
230
+
231
+ 群聊功能目前取决于微信官方 Bot 通道是否返回明确的群事件;本项目不会通过客户端自动化或非官方协议强行入群。若上游未来提供群 ID、发送成员 ID 与 @ 提及字段,群消息仍默认拒绝,必须同时设置群白名单、成员白名单并保留 @ 门槛:
232
+
233
+ ```powershell
234
+ weflow-cli config set assistantGroupWhitelist "群聊ID"
235
+ weflow-cli config set assistantGroupRequireMention true
236
+ ```
237
+
238
+ 仅当官方通道实际送来群事件时,上述配置才会生效;当前 ClawBot 私聊能力不受影响。
239
+
240
+ 常用管理命令:`weflow-cli assistant status` / `log` / `stop`;微信内发送「帮助」查看助手指令。
241
+
242
+ ## 常用命令
243
+
244
+ | 目标 | 命令 |
245
+ | --- | --- |
246
+ | 检查环境与配置 | `weflow-cli check` · `weflow-cli config show` |
247
+ | 初始化或手动指定路径 | `weflow-cli init [--path <目录>]` |
248
+ | 浏览聊天数据 | `weflow-cli sessions` · `weflow-cli messages <联系人>` · `weflow-cli contacts` |
249
+ | 导出聊天记录 | `weflow-cli export <联系人> <json\|txt\|md\|html\|excel>` |
250
+ | 公众号日报与阅读器 | `weflow-cli daily` · `weflow-cli daily-server` · `weflow-cli review` |
251
+ | 朋友圈缓存 | `weflow-cli sns timeline` · `weflow-cli sns users` · `weflow-cli sns stats` |
252
+ | 微信收藏 | `weflow-cli fav list` · `weflow-cli fav export markdown` · `weflow-cli fav set-key` |
253
+ | 微信读书 | `weflow-cli weread shelf` · `notes` · `search` · `stats` |
254
+ | 知识库 | `weflow-cli vault` · `weflow-cli wiki` · `weflow-cli search <query>` · `weflow-cli chat` |
255
+ | 总结与任务 | `weflow-cli report` · `annual-report` · `todos` |
256
+ | 第二大脑助手 | `weflow-cli assistant start` · `status` · `log` · `stop` |
257
+ | AI 编辑器集成 | `weflow-cli mcp-config` |
258
+
259
+ 运行 `weflow-cli <命令> --help` 可以查看某个命令的完整参数。例如:
260
+
261
+ ```powershell
262
+ weflow-cli export --help
263
+ weflow-cli daily --help
264
+ ```
265
+
266
+ ## 从源码运行
267
+
268
+ ```powershell
269
+ git clone https://github.com/zhuobichen/weflow-cli.git
270
+ cd weflow-cli
271
+ npm install
272
+ npm run build
273
+ npm run dev -- check
274
+ npm run dev -- init
275
+ ```
276
+
277
+ 主要 Python 工作流:
278
+
279
+ ```powershell
280
+ # 文章抓取 -> AI 分类 -> HTML 阅读页 -> Wiki / 学习日报
281
+ python scripts/pipeline.py --date YYYY-MM-DD --api-key "你的 API Key" --engine deepseek
282
+
283
+ # 分步运行
284
+ python scripts/biz_daily.py --date YYYY-MM-DD --api-key "你的 API Key"
285
+ python scripts/generate_html.py --date YYYY-MM-DD
286
+ python scripts/fav_server.py --date YYYY-MM-DD
287
+ ```
288
+
289
+ ## 架构
290
+
291
+ ![WeFlow CLI architecture](./docs/images/weflow-architecture-gpt-image-2.png)
292
+
293
+ 项目分为四个边界清晰的部分:
294
+
295
+ | 目录 | 职责 |
296
+ | --- | --- |
297
+ | `bin/` | Commander CLI 入口与交互流程。 |
298
+ | `src/core/` | 微信数据目录发现、密钥、NT/WCDB/SQLCipher 数据库访问。 |
299
+ | `src/services/` | 聊天、联系人、导出、配置、消息通道等业务能力。 |
300
+ | `scripts/` | 公众号日报、阅读器、知识管道、报告和搜索等 Python 工作流。 |
301
+ | `mcp-server/` | 供 MCP 客户端调用的 stdio 服务。 |
302
+
303
+ 查看更完整的模块关系与数据流,请阅读 [ARCHITECTURE.md](./ARCHITECTURE.md)。
304
+
305
+ ## 隐私与安全
306
+
307
+ - 数据库、密钥配置和导出文件默认保留在本机;密钥字段以机器绑定的加密形式存储。
308
+ - 涉及 DeepSeek、公众号抓取、微信读书或 MCP 的联网请求仅在你执行相应工作流时发生。
309
+ - 使用 `whitelist`、`blacklist` 和 `audit` 管理或审计消息发送;发送前请确认目标联系人与内容。
310
+ - 升级微信、切换账号或迁移电脑后,可能需要重新初始化或扫描 NT 密钥。
311
+ - `init` 会先验证已有本地配置;验证通过时不再重复捕获密钥。仅在迁移、切换账号或访问失败后使用 `weflow-cli init --refresh`。
312
+ - 测试首次初始化或密钥失效时,优先使用 `weflow-cli init --test-missing-keys`;它只在本次运行模拟密钥缺失,不改动已保存配置。实际密钥失效时可使用 `weflow-cli config forget-keys`,该命令仅清除数据库访问密钥并要求确认。
313
+ - 不指定日期运行 `weflow-cli daily` 时,会先检查昨天的日报产物;昨天缺少 `README.md`、文章索引或 `index.html` 时,会先补齐昨天,成功后才生成今天。指定 `--date` 或使用 `--dry-run` 时不执行补日报。
314
+
315
+ ## 文档与反馈
316
+
317
+ - [操作与排障手册](./OPERATIONS.md):初始化、NT 密钥、环境问题和常见错误。
318
+ - [跨电脑部署指南](./docs/SETUP.md):从新 Windows 电脑完成完整安装。
319
+ - [MCP 集成指南](./docs/MCP.md):客户端配置、工具范围与安全边界。
320
+ - [详细架构说明](./ARCHITECTURE.md):模块、数据流与实现边界。
321
+ - [项目维护状态](./docs/PROJECT_STATE.md):当前能力、限制、优先级与交接入口。
322
+ - [技术决策记录](./docs/DECISIONS.md):长期维护中的关键设计取舍。
323
+ - [分支与合并记录](./docs/BRANCHES.md):分支用途、合并时间线与并行开发的对齐约定。
324
+ - [电子数据证据指南](./docs/EVIDENCE_GUIDE.md):证据保全、法律边界与使用注意事项。
325
+ - [贡献指南](./CONTRIBUTING.md) 与 [安全策略](./SECURITY.md):开发、反馈和敏感问题处理。
326
+ - [变更记录](./CHANGELOG.md):版本更新摘要。
327
+ - [GitHub Issues](https://github.com/zhuobichen/weflow-cli/issues):请附上脱敏后的命令输出、操作系统、微信版本和复现步骤。
328
+
329
+ ## 致谢与许可
330
+
331
+ 项目借鉴或使用了 [WeFlow](https://github.com/hicccc77/WeFlow)、[koffi](https://koffi.dev/)、[ExcelJS](https://github.com/exceljs/exceljs)、[Scrapling](https://github.com/D4Vinci/Scrapling) 等优秀项目。
332
+
333
+ 采用 [MIT License](./LICENSE) 发布。
package/SECURITY.md ADDED
@@ -0,0 +1,47 @@
1
+ # Security Policy
2
+
3
+ ## Intended use — access your own data only
4
+
5
+ This tool is designed for a single purpose: letting a WeChat account owner access and back up **their own** local data, on **their own** machine, with **their own** consent.
6
+
7
+ - Accessing a database you are not the owner of (another person's account, a device you do not control) is illegal in most jurisdictions, regardless of who owns the hardware. Monitoring a partner, employee, or any third party without their informed consent is a crime, not a gray area.
8
+ - Deploying this tool onto someone else's machine, bundling it into other software, or operating it remotely and silently is strictly prohibited.
9
+ - Users are solely responsible for compliance with local laws. The authors provide the code for legitimate personal-data management and accept no liability for misuse.
10
+ - Open-source software can be modified by anyone. Forks or rebuilds that remove safeguards or repurpose this tool for surveillance, stalking, or black/gray-market use have nothing to do with this project; the original repository is the only official source.
11
+
12
+ If you suspect this tool was installed on a device without consent, stop using the device for sensitive activity and ask a qualified security professional to inspect it. Do not publish the configuration directory or its contents while reporting the concern.
13
+
14
+ ## Local-first data handling
15
+
16
+ - **Local-first**: WeFlow CLI reads local data directly and has no built-in tracking or telemetry. Explicit article, WeRead, Bot-channel and cloud-AI workflows can make network requests.
17
+ - **Encrypted key storage**: database keys are written to `~/.weflow-cli/config.json` only after machine- and user-bound AES-256-GCM encryption; the ciphertext cannot be decrypted on another machine or under another account.
18
+ - **Explicit AI opt-in**: AI features (article summaries, classification, RAG Q&A) activate only after you explicitly configure your own API key, and only the content you select for processing is uploaded.
19
+ - **Secret-safe subprocesses**: CLI-provided AI keys, database credentials, account identifiers, and selected conversation identifiers are passed to Python workers through their environment rather than copied into child-process command lines. Persistent configuration or environment variables are preferred over entering a secret directly on the command line.
20
+ - **Sanitized worker failures**: subprocess failures report a bounded category or exit code instead of repeating the full command, local path, query, or credential-bearing argument list.
21
+ - **Strict assistant defaults**: the WeChat assistant denies all senders until `assistantWhitelist` is explicitly configured, and cloud inference defaults to `strict` privacy mode.
22
+ - **Loopback-only web services**: local readers and servers bind to `127.0.0.1` and are never exposed to the network.
23
+ - **Bounded MCP network reads**: article URLs require exact HTTPS host validation; redirects are revalidated and external responses have time and size limits.
24
+ - **Path-minimized send previews**: image and file sends validate a non-empty regular file, reject conflicting media options, and expose only the base name and size in previews and audit records.
25
+ - **Bounded favorite sources**: daily-favorite synchronization accepts only existing Markdown files contained by the selected daily directory and rejects absolute paths, traversal, and escaping symlinks from both CLI input and saved state.
26
+ - **Narrow initialization scope**: platform-specific initialization is only an optional local setup path; it must not be repurposed for remote access, surveillance, or collection of another account's data.
27
+ - **Human-gated channel login**: Bot-channel login requires an interactive QR scan. Machine-readable login requests only preview the action; logout requires explicit confirmation and does not expose account identifiers.
28
+ - **Human-gated foreground listeners**: message listening, assistant foreground debugging, and process-memory key capture cannot be started through JSON execution. Their previews do not connect, scan, read messages, or call AI.
29
+
30
+ ## Reporting a vulnerability
31
+
32
+ Do not open a public issue for a vulnerability involving database access, key extraction, message sending, credentials, path traversal, command execution or data disclosure.
33
+
34
+ Email the repository owner through the contact channel listed on the GitHub profile, with a concise description, affected version, reproduction steps and impact. Do not attach real databases, keys, access tokens, personal messages or unredacted screenshots. You should receive an acknowledgement within seven days.
35
+
36
+ ## Supported releases
37
+
38
+ Security fixes are applied to the current `master` branch and the latest npm release when practical. Older releases may require upgrading.
39
+
40
+ ## Handling local data
41
+
42
+ - Treat `~/.weflow-cli/config.json`, `.mcp.json`, `output/`, exported chats and every `*.db` file as sensitive.
43
+ - Treat `vault sync` as an external disclosure action. Preview it first; machine execution requires `--yes`, and its JSON response omits file names and remote URLs.
44
+ - Preview Vault initialization, semantic indexing, knowledge pipelines, and report generation before execution. Their machine interfaces require `--yes`; structured output omits local paths, selected names, and generated content.
45
+ - Never share encryption keys, wxid values, API keys, WeChat credentials or full process output in an issue.
46
+ - Before running an MCP client, confirm its approval model and the directory configured as its working directory.
47
+ - The project can make network requests for explicitly selected article, AI, WeRead and official-account workflows. Review your provider and account permissions before enabling them.