flowmind 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -317,6 +317,85 @@ flowmind "这个功能应该用 Redis 还是 MongoDB?"
317
317
 
318
318
  ---
319
319
 
320
+ ## 📖 CLI Reference
321
+
322
+ ### Skill Management
323
+
324
+ ```bash
325
+ # List all available skills
326
+ flowmind skills
327
+ flowmind skills --verbose # Show detailed info
328
+ flowmind skills --json # JSON output (for tool integration)
329
+ flowmind skills --category quality # Filter by category
330
+
331
+ # View single skill info
332
+ flowmind skill log-audit
333
+ flowmind skill log-audit --json # JSON output
334
+ flowmind skill log-audit --read # Read SKILL.md content
335
+ flowmind skill log-audit --config # Show configuration
336
+
337
+ # Modify skill configuration
338
+ flowmind skill log-audit --set defaultFormat sequential-list
339
+ flowmind skill code-review --set security.enabled true
340
+ ```
341
+
342
+ ### Resource Management
343
+
344
+ ```bash
345
+ # List resource files
346
+ flowmind resource --list
347
+ flowmind resource --list learning
348
+ flowmind resource --list --json # JSON output
349
+
350
+ # View/edit files
351
+ flowmind resource --show config.json
352
+ flowmind resource --edit config.json
353
+
354
+ # Show resource configuration
355
+ flowmind resource --config
356
+ flowmind resource --config --json
357
+ ```
358
+
359
+ ### Other Commands
360
+
361
+ ```bash
362
+ # Process request
363
+ flowmind process "your request"
364
+ flowmind process --skill log-audit "query logs"
365
+
366
+ # Manage learning
367
+ flowmind learn --list
368
+ flowmind learn --export learnings.json
369
+
370
+ # Scene management
371
+ flowmind scenes --list
372
+ flowmind scenes --add
373
+
374
+ # Show statistics
375
+ flowmind stats
376
+
377
+ # Configuration
378
+ flowmind config --list
379
+ flowmind config --set learning.enabled true
380
+ ```
381
+
382
+ ### Tool Integration (Codex/Claude)
383
+
384
+ All commands support `--json` flag for programmatic access:
385
+
386
+ ```bash
387
+ # Get skills list as JSON
388
+ flowmind skills --json
389
+
390
+ # Get skill info as JSON
391
+ flowmind skill log-audit --json
392
+
393
+ # Get resource list as JSON
394
+ flowmind resource --list --json
395
+ ```
396
+
397
+ ---
398
+
320
399
  ## 🏗️ Architecture
321
400
 
322
401
  ### System Architecture
@@ -614,8 +693,8 @@ flowmind init → Load component-config.json → Register adapters → Activate
614
693
  | `aliyun-dms-mcp-server` | `databaseManager` | `aliyun-dms` |
615
694
  | `friday-rds-redis-query` | `databaseQuery` | `aliyun-rds-query` |
616
695
  | `friday-aliyun-sz-rds-redis` | `redisMonitor` | `aliyun-redis` |
617
- | `aomi-yapi-mcp` | `apiDoc` | `yapi` |
618
- | `aomi-yuque-mcp` | `knowledgeBase` | `yuque` |
696
+ | `yapi-mcp` | `apiDoc` | `yapi` |
697
+ | `yuque-mcp` | `knowledgeBase` | `yuque` |
619
698
  | `friday-auto-flow` | `workflow` | `friday-flow` |
620
699
  | `friday-auto-report` | `report` | `friday-report` |
621
700
 
package/README_CN.md CHANGED
@@ -94,7 +94,13 @@ npm install -g flowmind
94
94
  ### 初始化
95
95
 
96
96
  ```bash
97
+ # 基础初始化
97
98
  flowmind init
99
+
100
+ # 带 AI 模型初始化 (推荐)
101
+ flowmind init --ai openai
102
+ flowmind init --ai anthropic
103
+ flowmind init --ai ollama
98
104
  ```
99
105
 
100
106
  > 一次配置,永久生效。配置资源连接、学习偏好、输出格式,无需每次重复设置。
@@ -113,6 +119,248 @@ FlowMind: [自动使用顺序列表格式] ✓
113
119
 
114
120
  ---
115
121
 
122
+ ## 📖 使用方式
123
+
124
+ FlowMind 支持 4 种使用方式,满足不同场景需求:
125
+
126
+ ### 方式1: CLI 独立使用
127
+
128
+ 最简单的使用方式,无需 AI 模型,直接通过命令行调用。
129
+
130
+ ```bash
131
+ # 单次执行
132
+ flowmind "查询 traceId abc123 的日志"
133
+ flowmind "审查代码质量"
134
+ flowmind "验证订单数据"
135
+
136
+ # 交互模式
137
+ flowmind
138
+
139
+ # 指定技能执行
140
+ flowmind process --skill log-audit "查询最近1小时的错误日志"
141
+ ```
142
+
143
+ **特点:**
144
+ - ✅ 无需 AI 模型
145
+ - ✅ 基于规则引擎匹配
146
+ - ✅ 支持学习和记忆
147
+ - ✅ 离线可用
148
+
149
+ ---
150
+
151
+ ### 方式2: AI 模型直接接入
152
+
153
+ FlowMind 内置 AI 模型接入层,可直接调用 OpenAI、Anthropic、Ollama 等模型。
154
+
155
+ #### 配置 AI 模型
156
+
157
+ **方式 A:通过 CLI 初始化(推荐)**
158
+
159
+ ```bash
160
+ # 配置 OpenAI
161
+ flowmind init --ai openai
162
+ # 会提示输入 API Key
163
+
164
+ # 配置 Anthropic
165
+ flowmind init --ai anthropic
166
+
167
+ # 配置 Ollama (本地模型)
168
+ flowmind init --ai ollama
169
+ ```
170
+
171
+ **方式 B:手动配置**
172
+
173
+ 创建 `~/.flowmind/ai-config.json`:
174
+
175
+ ```json
176
+ {
177
+ "ai": {
178
+ "enabled": true,
179
+ "defaultProvider": "openai",
180
+ "fallbackToRules": true,
181
+ "providers": {
182
+ "openai": {
183
+ "apiKey": "sk-your-api-key",
184
+ "model": "gpt-4",
185
+ "temperature": 0.3
186
+ },
187
+ "anthropic": {
188
+ "apiKey": "sk-ant-your-api-key",
189
+ "model": "claude-3-sonnet-20240229"
190
+ },
191
+ "ollama": {
192
+ "baseUrl": "http://localhost:11434",
193
+ "model": "llama2"
194
+ }
195
+ },
196
+ "features": {
197
+ "intentUnderstanding": true,
198
+ "parameterExtraction": true,
199
+ "skillSelection": true,
200
+ "resultSummary": true,
201
+ "learningFeedback": true
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ **方式 C:环境变量**
208
+
209
+ ```bash
210
+ export OPENAI_API_KEY=sk-your-api-key
211
+ export ANTHROPIC_API_KEY=sk-ant-your-api-key
212
+ ```
213
+
214
+ #### 测试 AI 连接
215
+
216
+ ```bash
217
+ # 测试默认 Provider
218
+ flowmind ai --test
219
+
220
+ # 测试指定 Provider
221
+ flowmind ai --test openai
222
+ flowmind ai --test anthropic
223
+ ```
224
+
225
+ #### 使用 AI 增强功能
226
+
227
+ ```bash
228
+ # AI 会理解意图、提取参数、选择技能、生成摘要
229
+ flowmind "帮我查一下最近1小时用户服务的错误日志"
230
+
231
+ # AI 会分析复杂的多步骤任务
232
+ flowmind "排查线上问题:用户下单失败,需要查看日志、检查数据库、分析原因"
233
+ ```
234
+
235
+ **特点:**
236
+ - ✅ 自然语言理解
237
+ - ✅ 智能参数提取
238
+ - ✅ 结果摘要生成
239
+ - ✅ 降级到规则引擎
240
+
241
+ ---
242
+
243
+ ### 方式3: Claude Code 集成(MCP Server)
244
+
245
+ 让 Claude Code 直接调用 FlowMind 的内部流程。
246
+
247
+ #### 步骤 1:安装 FlowMind
248
+
249
+ ```bash
250
+ npm install -g flowmind
251
+ ```
252
+
253
+ #### 步骤 2:配置 MCP Server
254
+
255
+ 在项目根目录创建 `.claude/settings.local.json`:
256
+
257
+ ```json
258
+ {
259
+ "mcpServers": {
260
+ "flowmind": {
261
+ "command": "flowmind-mcp",
262
+ "args": [],
263
+ "env": {
264
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ ```
270
+
271
+ 或者使用完整路径:
272
+
273
+ ```json
274
+ {
275
+ "mcpServers": {
276
+ "flowmind": {
277
+ "command": "node",
278
+ "args": ["/path/to/flowmind/mcp/server.js"]
279
+ }
280
+ }
281
+ }
282
+ ```
283
+
284
+ #### 步骤 3:在 Claude Code 中使用
285
+
286
+ ```
287
+ 你:帮我查询最近1小时的错误日志
288
+
289
+ Claude:我来调用 FlowMind 帮你查询...
290
+ [调用 flowmind_process 工具]
291
+
292
+ 你:审查一下这个项目的代码质量
293
+
294
+ Claude:我来使用 FlowMind 的代码审查技能...
295
+ [调用 flowmind_skill_code-review 工具]
296
+ ```
297
+
298
+ #### 可用的 MCP 工具
299
+
300
+ | 工具名称 | 描述 |
301
+ |---------|------|
302
+ | `flowmind_process` | 处理请求的主入口 |
303
+ | `flowmind_list_skills` | 列出所有可用技能 |
304
+ | `flowmind_get_skill` | 获取技能详情 |
305
+ | `flowmind_ai_status` | 查看 AI 状态 |
306
+ | `flowmind_learning_stats` | 查看学习统计 |
307
+ | `flowmind_skill_<name>` | 执行特定技能 |
308
+
309
+ **特点:**
310
+ - ✅ Claude Code 直接调用
311
+ - ✅ 无需额外配置 MCP Server
312
+ - ✅ 保留学习和记忆功能
313
+ - ✅ 支持所有 FlowMind 技能
314
+
315
+ ---
316
+
317
+ ### 方式4: Codex 集成(JSON 输出)
318
+
319
+ 通过 JSON 输出与 Codex 集成。
320
+
321
+ ```bash
322
+ # 获取技能列表 (JSON 格式)
323
+ flowmind skills --json
324
+
325
+ # 获取技能详情
326
+ flowmind skill log-audit --json
327
+
328
+ # 执行并输出 JSON
329
+ flowmind process --json "查询日志"
330
+ ```
331
+
332
+ **Codex 脚本示例:**
333
+
334
+ ```python
335
+ import subprocess
336
+ import json
337
+
338
+ def flowmind_query(query):
339
+ result = subprocess.run(
340
+ ['flowmind', 'process', '--json', query],
341
+ capture_output=True,
342
+ text=True
343
+ )
344
+ return json.loads(result.stdout)
345
+
346
+ # 使用
347
+ result = flowmind_query("查询 traceId abc123 的日志")
348
+ print(result)
349
+ ```
350
+
351
+ ---
352
+
353
+ ### 使用方式对比
354
+
355
+ | 方式 | 适用场景 | 需要 AI | 需要 MCP | 特点 |
356
+ |------|---------|---------|----------|------|
357
+ | CLI 独立使用 | 快速执行、脚本集成 | ❌ | ❌ | 简单直接 |
358
+ | AI 模型接入 | 智能理解、复杂任务 | ✅ | ❌ | 自然语言 |
359
+ | Claude Code | 智能对话、多步骤 | ✅ | ✅ | 深度集成 |
360
+ | Codex 集成 | 自动化、CI/CD | ❌ | ❌ | 程序化调用 |
361
+
362
+ ---
363
+
116
364
  ## 🧠 工作原理
117
365
 
118
366
  ### 1. 多源代码定位
@@ -317,6 +565,85 @@ flowmind "这个功能应该用 Redis 还是 MongoDB?"
317
565
 
318
566
  ---
319
567
 
568
+ ## 📖 CLI 命令参考
569
+
570
+ ### 技能管理
571
+
572
+ ```bash
573
+ # 列出所有可用技能
574
+ flowmind skills
575
+ flowmind skills --verbose # 显示详细信息
576
+ flowmind skills --json # JSON 输出(用于工具集成)
577
+ flowmind skills --category quality # 按分类过滤
578
+
579
+ # 查看单个技能信息
580
+ flowmind skill log-audit
581
+ flowmind skill log-audit --json # JSON 输出
582
+ flowmind skill log-audit --read # 读取 SKILL.md 内容
583
+ flowmind skill log-audit --config # 显示配置
584
+
585
+ # 修改技能配置
586
+ flowmind skill log-audit --set defaultFormat sequential-list
587
+ flowmind skill code-review --set security.enabled true
588
+ ```
589
+
590
+ ### 资源管理
591
+
592
+ ```bash
593
+ # 列出资源文件
594
+ flowmind resource --list
595
+ flowmind resource --list learning
596
+ flowmind resource --list --json # JSON 输出
597
+
598
+ # 查看/编辑文件
599
+ flowmind resource --show config.json
600
+ flowmind resource --edit config.json
601
+
602
+ # 显示资源配置
603
+ flowmind resource --config
604
+ flowmind resource --config --json
605
+ ```
606
+
607
+ ### 其他命令
608
+
609
+ ```bash
610
+ # 处理请求
611
+ flowmind process "your request"
612
+ flowmind process --skill log-audit "query logs"
613
+
614
+ # 管理学习记录
615
+ flowmind learn --list
616
+ flowmind learn --export learnings.json
617
+
618
+ # 场景管理
619
+ flowmind scenes --list
620
+ flowmind scenes --add
621
+
622
+ # 显示统计信息
623
+ flowmind stats
624
+
625
+ # 配置管理
626
+ flowmind config --list
627
+ flowmind config --set learning.enabled true
628
+ ```
629
+
630
+ ### 工具集成(Codex/Claude)
631
+
632
+ 所有命令支持 `--json` 参数用于程序化访问:
633
+
634
+ ```bash
635
+ # 获取技能列表 JSON
636
+ flowmind skills --json
637
+
638
+ # 获取技能信息 JSON
639
+ flowmind skill log-audit --json
640
+
641
+ # 获取资源列表 JSON
642
+ flowmind resource --list --json
643
+ ```
644
+
645
+ ---
646
+
320
647
  ## 🏗️ 架构
321
648
 
322
649
  ### 系统架构
@@ -613,8 +940,8 @@ flowmind init → 加载 component-config.json → 注册适配器 → 激活默
613
940
  | `aliyun-dms-mcp-server` | `databaseManager` | `aliyun-dms` |
614
941
  | `friday-rds-redis-query` | `databaseQuery` | `aliyun-rds-query` |
615
942
  | `friday-aliyun-sz-rds-redis` | `redisMonitor` | `aliyun-redis` |
616
- | `aomi-yapi-mcp` | `apiDoc` | `yapi` |
617
- | `aomi-yuque-mcp` | `knowledgeBase` | `yuque` |
943
+ | `yapi-mcp` | `apiDoc` | `yapi` |
944
+ | `yuque-mcp` | `knowledgeBase` | `yuque` |
618
945
  | `friday-auto-flow` | `workflow` | `friday-flow` |
619
946
  | `friday-auto-report` | `report` | `friday-report` |
620
947