@cloudbase/cli 2.8.28 → 2.9.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/bin/tcb.js +2 -1
- package/cloudbaserc.json +12 -2
- package/dist/standalone/cli.js +416 -39
- package/lib/commands/account/login.js +2 -6
- package/lib/commands/ai/index.js +2 -2
- package/lib/commands/pull/pull.js +6 -4
- package/lib/help.js +5 -17
- package/lib/utils/ai/banner.js +6 -3
- package/lib/utils/ai/config.js +16 -2
- package/lib/utils/ai/const.js +15 -2
- package/lib/utils/ai/router.js +52 -1
- package/lib/utils/ai/setup.js +45 -2
- package/package.json +2 -2
- package/specs/codebuddy-integration/design.md +152 -0
- package/specs/codebuddy-integration/requirements.md +53 -0
- package/specs/codebuddy-integration/tasks.md +159 -0
- package/types/commands/pull/pull.d.ts +2 -1
- package/types/utils/ai/config.d.ts +7 -3
- package/types/utils/ai/const.d.ts +39 -0
- package/types/utils/ai/router.d.ts +3 -0
- package/types/utils/ai/setup.d.ts +1 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# 实施计划
|
|
2
|
+
|
|
3
|
+
## 任务概览
|
|
4
|
+
|
|
5
|
+
本计划将分阶段实现 Codebuddy Code CLI 在 CloudBase CLI 中的集成,包括基础集成、配置管理、MCP 服务器管理等功能。
|
|
6
|
+
|
|
7
|
+
## 详细任务
|
|
8
|
+
|
|
9
|
+
### 阶段 1: 基础架构扩展
|
|
10
|
+
|
|
11
|
+
- [ ] 1. 添加 Codebuddy 常量定义
|
|
12
|
+
- 在 `src/utils/ai/const.ts` 中添加 CODEBUDDY 常量
|
|
13
|
+
- 定义配置验证 Schema
|
|
14
|
+
- 添加默认配置选项
|
|
15
|
+
- _需求: 需求1, 需求4
|
|
16
|
+
|
|
17
|
+
- [ ] 2. 扩展 AI 命令选项
|
|
18
|
+
- 在 `src/commands/ai/index.ts` 中添加 codebuddy 选项
|
|
19
|
+
- 更新命令描述和示例
|
|
20
|
+
- 确保参数透传功能正常工作
|
|
21
|
+
- _需求: 需求1, 需求3
|
|
22
|
+
|
|
23
|
+
- [ ] 3. 添加 Codebuddy 路由逻辑
|
|
24
|
+
- 在 `src/utils/ai/router.ts` 中添加 executeCodebuddyAgent 方法
|
|
25
|
+
- 实现命令执行和参数透传
|
|
26
|
+
- 添加错误处理和日志记录
|
|
27
|
+
- _需求: 需求1, 需求3
|
|
28
|
+
|
|
29
|
+
### 阶段 2: 配置管理实现
|
|
30
|
+
|
|
31
|
+
- [ ] 4. 扩展现有配置管理器
|
|
32
|
+
- 在 AIConfigManager 中添加 Codebuddy 配置支持
|
|
33
|
+
- 实现配置验证逻辑
|
|
34
|
+
- 复用现有的配置管理机制
|
|
35
|
+
- _需求: 需求4
|
|
36
|
+
|
|
37
|
+
- [ ] 5. 实现配置向导
|
|
38
|
+
- 创建交互式配置向导
|
|
39
|
+
- 支持 API 密钥和模型配置
|
|
40
|
+
- 提供配置验证和错误提示
|
|
41
|
+
- _需求: 需求1, 需求4
|
|
42
|
+
|
|
43
|
+
- [ ] 6. 实现配置显示和重置功能
|
|
44
|
+
- 添加配置信息显示功能
|
|
45
|
+
- 实现配置重置功能
|
|
46
|
+
- 提供配置备份和恢复
|
|
47
|
+
- _需求: 需求1
|
|
48
|
+
|
|
49
|
+
### 阶段 3: 安装和依赖管理
|
|
50
|
+
|
|
51
|
+
- [ ] 7. 实现 Codebuddy CLI 安装检查
|
|
52
|
+
- 检查 codebuddy 命令是否可用
|
|
53
|
+
- 提供安装指导和自动安装选项
|
|
54
|
+
- 支持不同平台的安装方式
|
|
55
|
+
- _需求: 需求1
|
|
56
|
+
|
|
57
|
+
- [ ] 8. 实现版本兼容性检查
|
|
58
|
+
- 检查 Codebuddy CLI 版本
|
|
59
|
+
- 验证功能兼容性
|
|
60
|
+
- 提供升级建议
|
|
61
|
+
- _需求: 需求1
|
|
62
|
+
|
|
63
|
+
### 阶段 4: MCP 服务器管理
|
|
64
|
+
|
|
65
|
+
- [ ] 9. 实现 MCP 命令透传
|
|
66
|
+
- 支持 mcp add 命令透传
|
|
67
|
+
- 支持 mcp list 命令透传
|
|
68
|
+
- 支持 mcp get 命令透传
|
|
69
|
+
- 支持 mcp remove 命令透传
|
|
70
|
+
- _需求: 需求2
|
|
71
|
+
|
|
72
|
+
- [ ] 10. 实现 MCP 配置作用域支持
|
|
73
|
+
- 支持 Local 作用域配置
|
|
74
|
+
- 支持 Project 作用域配置
|
|
75
|
+
- 支持 User 作用域配置
|
|
76
|
+
- 实现配置文件自动合并
|
|
77
|
+
- _需求: 需求2
|
|
78
|
+
|
|
79
|
+
### 阶段 5: 测试和文档
|
|
80
|
+
|
|
81
|
+
- [ ] 11. 编写单元测试
|
|
82
|
+
- 测试配置验证逻辑
|
|
83
|
+
- 测试命令执行流程
|
|
84
|
+
- 测试参数透传功能
|
|
85
|
+
- 测试错误处理机制
|
|
86
|
+
- _需求: 需求1, 需求2, 需求3, 需求4
|
|
87
|
+
|
|
88
|
+
- [ ] 12. 编写集成测试
|
|
89
|
+
- 测试完整命令执行流程
|
|
90
|
+
- 测试配置管理流程
|
|
91
|
+
- 测试 MCP 服务器管理
|
|
92
|
+
- 测试跨平台兼容性
|
|
93
|
+
- _需求: 需求1, 需求2, 需求3, 需求4
|
|
94
|
+
|
|
95
|
+
- [ ] 13. 更新文档
|
|
96
|
+
- 更新 README.md 文档
|
|
97
|
+
- 添加 Codebuddy 使用示例
|
|
98
|
+
- 更新命令行帮助信息
|
|
99
|
+
- 添加故障排除指南
|
|
100
|
+
- _需求: 需求1, 需求2, 需求3, 需求4
|
|
101
|
+
|
|
102
|
+
### 阶段 6: 优化和发布
|
|
103
|
+
|
|
104
|
+
- [ ] 14. 性能优化
|
|
105
|
+
- 优化命令执行性能
|
|
106
|
+
- 优化配置加载速度
|
|
107
|
+
- 减少内存占用
|
|
108
|
+
- _需求: 需求1, 需求3
|
|
109
|
+
|
|
110
|
+
- [ ] 15. 用户体验优化
|
|
111
|
+
- 改进错误提示信息
|
|
112
|
+
- 优化安装向导流程
|
|
113
|
+
- 添加进度指示器
|
|
114
|
+
- _需求: 需求1, 需求4
|
|
115
|
+
|
|
116
|
+
- [ ] 16. 发布准备
|
|
117
|
+
- 版本号更新
|
|
118
|
+
- 更新 CHANGELOG
|
|
119
|
+
- 发布到 npm
|
|
120
|
+
- _需求: 需求1, 需求2, 需求3, 需求4
|
|
121
|
+
|
|
122
|
+
## 风险评估
|
|
123
|
+
|
|
124
|
+
### 技术风险
|
|
125
|
+
- **Codebuddy CLI 版本兼容性**: 需要确保与不同版本的 Codebuddy CLI 兼容
|
|
126
|
+
- **跨平台支持**: 需要测试在不同操作系统上的兼容性
|
|
127
|
+
- **配置冲突**: 需要处理与现有 AI 工具配置的冲突
|
|
128
|
+
|
|
129
|
+
### 缓解措施
|
|
130
|
+
- 建立版本兼容性测试矩阵
|
|
131
|
+
- 在多个平台上进行充分测试
|
|
132
|
+
- 实现配置隔离和冲突检测机制
|
|
133
|
+
|
|
134
|
+
## 时间估算
|
|
135
|
+
|
|
136
|
+
- 阶段 1: 2-3 天
|
|
137
|
+
- 阶段 2: 2-3 天
|
|
138
|
+
- 阶段 3: 1-2 天
|
|
139
|
+
- 阶段 4: 2-3 天
|
|
140
|
+
- 阶段 5: 2-3 天
|
|
141
|
+
- 阶段 6: 1-2 天
|
|
142
|
+
|
|
143
|
+
**总计**: 10-16 天
|
|
144
|
+
|
|
145
|
+
## 验收标准
|
|
146
|
+
|
|
147
|
+
### 功能验收
|
|
148
|
+
- [ ] 所有需求中的验收标准都已实现
|
|
149
|
+
- [ ] 命令执行正常,参数透传正确
|
|
150
|
+
- [ ] 配置管理功能完整
|
|
151
|
+
- [ ] MCP 服务器管理功能正常
|
|
152
|
+
- [ ] 错误处理机制完善
|
|
153
|
+
|
|
154
|
+
### 质量验收
|
|
155
|
+
- [ ] 单元测试覆盖率 > 80%
|
|
156
|
+
- [ ] 集成测试通过率 100%
|
|
157
|
+
- [ ] 代码审查通过
|
|
158
|
+
- [ ] 文档完整且准确
|
|
159
|
+
- [ ] 性能指标达标
|
|
@@ -3,6 +3,7 @@ import { Logger } from '../../utils/log';
|
|
|
3
3
|
export declare class PullCommand extends Command {
|
|
4
4
|
get options(): {
|
|
5
5
|
cmd: string;
|
|
6
|
+
childCmd: string;
|
|
6
7
|
options: {
|
|
7
8
|
flags: string;
|
|
8
9
|
desc: string;
|
|
@@ -11,6 +12,6 @@ export declare class PullCommand extends Command {
|
|
|
11
12
|
requiredEnvId: boolean;
|
|
12
13
|
withoutAuth: boolean;
|
|
13
14
|
};
|
|
14
|
-
execute(options: any, log: Logger): Promise<void>;
|
|
15
|
+
execute(options: any, params: string[], log: Logger): Promise<void>;
|
|
15
16
|
private showTemplateList;
|
|
16
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigParser } from '@cloudbase/toolbox';
|
|
2
|
-
import { CLAUDE, QWEN, CODEX, AIDER, CURSOR } from './const';
|
|
2
|
+
import { CLAUDE, QWEN, CODEX, AIDER, CURSOR, CODEBUDDY } from './const';
|
|
3
3
|
import z from 'zod/v3';
|
|
4
4
|
export declare const CONFIG_NOT_FOUND = "CONFIG_NOT_FOUND";
|
|
5
5
|
export declare function isValidAgent(agent: unknown): agent is keyof AIConfig['agents'];
|
|
@@ -11,6 +11,7 @@ export interface AIConfig {
|
|
|
11
11
|
codex?: z.infer<(typeof CODEX)['configSchema']>;
|
|
12
12
|
aider?: z.infer<(typeof AIDER)['configSchema']>;
|
|
13
13
|
cursor?: z.infer<(typeof CURSOR)['configSchema']>;
|
|
14
|
+
codebuddy?: z.infer<(typeof CODEBUDDY)['configSchema']>;
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
export interface AgentConfig {
|
|
@@ -28,12 +29,12 @@ export declare const TOOLKIT_CONFIGS: {
|
|
|
28
29
|
config?: undefined;
|
|
29
30
|
} | {
|
|
30
31
|
config: string;
|
|
31
|
-
rules: string;
|
|
32
32
|
mcp?: undefined;
|
|
33
|
+
rules?: undefined;
|
|
33
34
|
} | {
|
|
34
35
|
config: string;
|
|
36
|
+
rules: string;
|
|
35
37
|
mcp?: undefined;
|
|
36
|
-
rules?: undefined;
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
export declare function createConfigParser(): ConfigParser;
|
|
@@ -77,5 +78,8 @@ export declare class AIConfigManager {
|
|
|
77
78
|
provider?: string;
|
|
78
79
|
}): Promise<void>;
|
|
79
80
|
updateCursorConfig(type: 'none'): Promise<void>;
|
|
81
|
+
updateCodebuddyConfig(type: 'custom' | 'none', config: {
|
|
82
|
+
apiKey?: string;
|
|
83
|
+
}): Promise<void>;
|
|
80
84
|
private updateConfig;
|
|
81
85
|
}
|
|
@@ -166,6 +166,26 @@ export declare const CURSOR: {
|
|
|
166
166
|
type?: "none";
|
|
167
167
|
}>;
|
|
168
168
|
};
|
|
169
|
+
export declare const CODEBUDDY: {
|
|
170
|
+
name: string;
|
|
171
|
+
value: string;
|
|
172
|
+
configSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
173
|
+
type: z.ZodLiteral<"none">;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
type?: "none";
|
|
176
|
+
}, {
|
|
177
|
+
type?: "none";
|
|
178
|
+
}>, z.ZodObject<{
|
|
179
|
+
type: z.ZodLiteral<"custom">;
|
|
180
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
type?: "custom";
|
|
183
|
+
apiKey?: string;
|
|
184
|
+
}, {
|
|
185
|
+
type?: "custom";
|
|
186
|
+
apiKey?: string;
|
|
187
|
+
}>]>;
|
|
188
|
+
};
|
|
169
189
|
export declare const NONE: {
|
|
170
190
|
name: string;
|
|
171
191
|
value: string;
|
|
@@ -325,6 +345,25 @@ export declare const AGENTS: readonly [{
|
|
|
325
345
|
}, {
|
|
326
346
|
type?: "none";
|
|
327
347
|
}>;
|
|
348
|
+
}, {
|
|
349
|
+
name: string;
|
|
350
|
+
value: string;
|
|
351
|
+
configSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
352
|
+
type: z.ZodLiteral<"none">;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
type?: "none";
|
|
355
|
+
}, {
|
|
356
|
+
type?: "none";
|
|
357
|
+
}>, z.ZodObject<{
|
|
358
|
+
type: z.ZodLiteral<"custom">;
|
|
359
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, "strip", z.ZodTypeAny, {
|
|
361
|
+
type?: "custom";
|
|
362
|
+
apiKey?: string;
|
|
363
|
+
}, {
|
|
364
|
+
type?: "custom";
|
|
365
|
+
apiKey?: string;
|
|
366
|
+
}>]>;
|
|
328
367
|
}, {
|
|
329
368
|
name: string;
|
|
330
369
|
value: string;
|