aico-cli 0.3.20 → 0.4.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/dist/chunks/simple-config.mjs +1 -1
- package/package.json +1 -1
- package/templates/agents/aico/requirement/WINDOWS_USAGE.md +478 -0
- package/templates/agents/aico/requirement/crossplatform-utils.ps1 +465 -0
- package/templates/agents/aico/requirement/requirement-aligner.md +47 -0
- package/templates/agents/aico/requirement/requirement-functions-crossplatform.ps1 +458 -0
- package/templates/agents/aico/requirement/requirement-identifier.md +43 -4
- package/templates/agents/aico/requirement/requirement-launcher.ps1 +223 -0
- package/templates/agents/aico/requirement/task-executor-validator.md +42 -0
- package/templates/agents/aico/requirement/task-executor.md +44 -0
- package/templates/agents/aico/requirement/task-splitter-validator.md +44 -2
- package/templates/agents/aico/requirement/test-crossplatform.ps1 +506 -0
- package/templates/hooks/claude-code-hooks.json +69 -0
- package/templates/hooks/notify.ps1 +1 -27
- package/templates/hooks/notify.sh +0 -23
- package/templates/hooks/scripts/Notification/bash/desktop-notifier.sh +63 -0
- package/templates/hooks/scripts/Notification/powershell/desktop-notifier.ps1 +67 -0
- package/templates/hooks/scripts/PostToolUse/bash/code-formatter.sh +73 -0
- package/templates/hooks/scripts/PostToolUse/powershell/code-formatter.ps1 +90 -0
- package/templates/hooks/scripts/PreToolUse/bash/command-logger.sh +38 -0
- package/templates/hooks/scripts/PreToolUse/bash/file-protection.sh +55 -0
- package/templates/hooks/scripts/PreToolUse/powershell/command-logger.ps1 +34 -0
- package/templates/hooks/scripts/PreToolUse/powershell/file-protection.ps1 +46 -0
- package/templates/hooks/scripts/Stop/bash/session-summary.sh +83 -0
- package/templates/hooks/scripts/Stop/powershell/session-summary.ps1 +95 -0
- package/templates/hooks/scripts/UserPromptSubmit/bash/input-notifier.sh +58 -0
- package/templates/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1 +57 -0
- package/templates/hooks/utils/crossplatform-detector.ps1 +117 -0
- package/templates/hooks/utils/crossplatform-detector.sh +111 -0
- package/templates/personality.md +3 -3
- package/templates/settings.json +4 -4
- package/templates/agents/aico/requirement/PLATFORM_COMPATIBILITY.md +0 -219
- package/templates/hooks/claude-code-hook-config.json +0 -35
- package/templates/hooks/hooks-config.json +0 -47
- package/templates/hooks/requirement/common-utils.sh +0 -186
- package/templates/hooks/requirement/hook-utils.ps1 +0 -365
- package/templates/hooks/requirement/post-requirement-aligner.sh +0 -61
- package/templates/hooks/requirement/post-requirement-identifier.sh +0 -58
- package/templates/hooks/requirement/post-task-executor-validator.sh +0 -96
- package/templates/hooks/requirement/post-task-executor.sh +0 -78
- package/templates/hooks/requirement/post-task-splitter-validator.sh +0 -73
- package/templates/hooks/requirement/pre-requirement-aligner.sh +0 -70
- package/templates/hooks/requirement/pre-requirement-identifier.sh +0 -61
- package/templates/hooks/requirement/pre-task-executor-validator.sh +0 -81
- package/templates/hooks/requirement/pre-task-executor.sh +0 -91
- package/templates/hooks/requirement/pre-task-splitter-validator.sh +0 -61
- package/templates/test-windows-compatibility.ps1 +0 -476
|
@@ -13,7 +13,7 @@ import { join as join$1 } from 'node:path';
|
|
|
13
13
|
import { join, dirname, basename } from 'pathe';
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
15
|
|
|
16
|
-
const version = "0.
|
|
16
|
+
const version = "0.4.0";
|
|
17
17
|
|
|
18
18
|
function displayBanner(subtitle) {
|
|
19
19
|
const defaultSubtitle = "\u4E00\u952E\u914D\u7F6E\u4F60\u7684\u5F00\u53D1\u73AF\u5883";
|
package/package.json
CHANGED
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
# Windows 平台使用指南
|
|
2
|
+
|
|
3
|
+
> 🌐 AICO 需求场景识别智能体全平台兼容性指南
|
|
4
|
+
|
|
5
|
+
## 📋 目录
|
|
6
|
+
|
|
7
|
+
- [系统要求](#系统要求)
|
|
8
|
+
- [环境配置](#环境配置)
|
|
9
|
+
- [安装与设置](#安装与设置)
|
|
10
|
+
- [使用方式](#使用方式)
|
|
11
|
+
- [故障排除](#故障排除)
|
|
12
|
+
- [常见问题](#常见问题)
|
|
13
|
+
- [最佳实践](#最佳实践)
|
|
14
|
+
|
|
15
|
+
## 🖥️ 系统要求
|
|
16
|
+
|
|
17
|
+
### 支持的 Windows 版本
|
|
18
|
+
- ✅ **Windows 10** (版本 1809 及以上)
|
|
19
|
+
- ✅ **Windows 11** (所有版本)
|
|
20
|
+
- ✅ **Windows Server 2019** 及以上
|
|
21
|
+
|
|
22
|
+
### PowerShell 版本要求
|
|
23
|
+
- ✅ **PowerShell 5.1** (Windows 内置)
|
|
24
|
+
- ✅ **PowerShell Core 6.0+** (推荐)
|
|
25
|
+
- ❌ PowerShell 4.0 及以下 (不支持)
|
|
26
|
+
|
|
27
|
+
### 可选兼容层
|
|
28
|
+
- ✅ **Git Bash** (通过 Git for Windows)
|
|
29
|
+
- ✅ **Windows Subsystem for Linux (WSL)**
|
|
30
|
+
- ✅ **Cygwin**
|
|
31
|
+
- ✅ **MSYS2**
|
|
32
|
+
|
|
33
|
+
## ⚙️ 环境配置
|
|
34
|
+
|
|
35
|
+
### 方式一:Windows PowerShell (推荐)
|
|
36
|
+
|
|
37
|
+
#### 1. 检查 PowerShell 版本
|
|
38
|
+
```powershell
|
|
39
|
+
# 检查 PowerShell 版本
|
|
40
|
+
$PSVersionTable.PSVersion
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**预期输出示例:**
|
|
44
|
+
```
|
|
45
|
+
Major Minor Build Revision
|
|
46
|
+
----- ----- ----- --------
|
|
47
|
+
5 1 19041 1682 # PowerShell 5.1
|
|
48
|
+
# 或
|
|
49
|
+
7 3 6 0 # PowerShell Core
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### 2. 安装 PowerShell Core (可选但推荐)
|
|
53
|
+
```powershell
|
|
54
|
+
# 使用 winget 安装 PowerShell Core
|
|
55
|
+
winget install Microsoft.PowerShell
|
|
56
|
+
|
|
57
|
+
# 或从官网下载安装
|
|
58
|
+
# https://github.com/PowerShell/PowerShell/releases
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### 3. 配置执行策略
|
|
62
|
+
```powershell
|
|
63
|
+
# 允许本地脚本执行
|
|
64
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
65
|
+
|
|
66
|
+
# 验证执行策略
|
|
67
|
+
Get-ExecutionPolicy
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### 4. 启用脚本运行(如果被阻止)
|
|
71
|
+
```powershell
|
|
72
|
+
# 临时绕过执行策略(仅限当前会话)
|
|
73
|
+
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 方式二:Git Bash
|
|
77
|
+
|
|
78
|
+
#### 1. 安装 Git for Windows
|
|
79
|
+
```bash
|
|
80
|
+
# 下载地址:https://git-scm.com/download/win
|
|
81
|
+
# 安装时确保选择 "Use Git and optional Unix tools from the Command Prompt"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### 2. 验证 Git Bash 环境
|
|
85
|
+
```bash
|
|
86
|
+
# 验证关键工具
|
|
87
|
+
bash --version
|
|
88
|
+
which sed grep find head tail
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 方式三:WSL (Windows Subsystem for Linux)
|
|
92
|
+
|
|
93
|
+
#### 1. 启用 WSL
|
|
94
|
+
```powershell
|
|
95
|
+
# 启用 WSL 功能
|
|
96
|
+
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
|
|
97
|
+
|
|
98
|
+
# 重启后安装 WSL 发行版
|
|
99
|
+
wsl --install
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### 2. 在 WSL 中配置
|
|
103
|
+
```bash
|
|
104
|
+
# 更新包列表
|
|
105
|
+
sudo apt update
|
|
106
|
+
|
|
107
|
+
# 安装基础工具
|
|
108
|
+
sudo apt install -y bash grep sed findutils coreutils
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 🚀 安装与设置
|
|
112
|
+
|
|
113
|
+
### 1. 下载脚本文件
|
|
114
|
+
确保以下文件存在于您的项目目录中:
|
|
115
|
+
```
|
|
116
|
+
templates/agents/aico/requirement/
|
|
117
|
+
├── requirement-launcher.ps1 # PowerShell 启动器
|
|
118
|
+
├── requirement-launcher.sh # Bash 启动器
|
|
119
|
+
├── requirement-functions-crossplatform.ps1 # PowerShell 功能库
|
|
120
|
+
├── requirement-functions-crossplatform.sh # Bash 功能库
|
|
121
|
+
├── crossplatform-utils.ps1 # PowerShell 工具库
|
|
122
|
+
├── crossplatform-utils.sh # Bash 工具库
|
|
123
|
+
└── WINDOWS_USAGE.md # 本文档
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 2. 设置文件权限 (Git Bash/WSL)
|
|
127
|
+
```bash
|
|
128
|
+
# 设置脚本执行权限
|
|
129
|
+
chmod +x requirement-launcher.sh
|
|
130
|
+
chmod +x requirement-functions-crossplatform.sh
|
|
131
|
+
chmod +x crossplatform-utils.sh
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 3. 验证环境
|
|
135
|
+
```powershell
|
|
136
|
+
# PowerShell 环境验证
|
|
137
|
+
.\requirement-launcher.ps1 --help
|
|
138
|
+
|
|
139
|
+
# Git Bash 环境验证
|
|
140
|
+
./requirement-launcher.sh --help
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## 💻 使用方式
|
|
144
|
+
|
|
145
|
+
### PowerShell 使用方式
|
|
146
|
+
|
|
147
|
+
#### 基本用法
|
|
148
|
+
```powershell
|
|
149
|
+
# 使用 PowerShell 启动器
|
|
150
|
+
.\requirement-launcher.ps1 "需要开发一个用户登录功能"
|
|
151
|
+
|
|
152
|
+
# 帮助信息
|
|
153
|
+
.\requirement-launcher.ps1 --help
|
|
154
|
+
|
|
155
|
+
# 版本信息
|
|
156
|
+
.\requirement-launcher.ps1 --version
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### 高级用法
|
|
160
|
+
```powershell
|
|
161
|
+
# 详细输出模式
|
|
162
|
+
.\requirement-launcher.ps1 "优化数据库查询性能" -Verbose
|
|
163
|
+
|
|
164
|
+
# 静默模式(减少输出)
|
|
165
|
+
.\requirement-launcher.ps1 "修复页面加载问题" -Silent
|
|
166
|
+
|
|
167
|
+
# 批量处理从文件
|
|
168
|
+
Get-Content "requirements.txt" | ForEach-Object {
|
|
169
|
+
.\requirement-launcher.ps1 $_
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### 直接调用函数库
|
|
174
|
+
```powershell
|
|
175
|
+
# 加载 PowerShell 函数库
|
|
176
|
+
. .\requirement-functions-crossplatform.ps1
|
|
177
|
+
|
|
178
|
+
# 直接调用功能
|
|
179
|
+
Collect-Context -UserInput "用户需要登录功能"
|
|
180
|
+
Main-Workflow -UserInput "开发新的API接口"
|
|
181
|
+
|
|
182
|
+
# 使用跨平台工具
|
|
183
|
+
$platform = Get-Platform
|
|
184
|
+
$files = Find-Files -Pattern "*.js|*.ts" -MaxResults 10
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Git Bash/WSL 使用方式
|
|
188
|
+
|
|
189
|
+
#### 基本用法
|
|
190
|
+
```bash
|
|
191
|
+
# 使用 Bash 启动器
|
|
192
|
+
./requirement-launcher.sh "需要开发一个用户登录功能"
|
|
193
|
+
|
|
194
|
+
# 帮助信息
|
|
195
|
+
./requirement-launcher.sh --help
|
|
196
|
+
|
|
197
|
+
# 版本信息
|
|
198
|
+
./requirement-launcher.sh --version
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### 直接调用函数库
|
|
202
|
+
```bash
|
|
203
|
+
# 加载 Bash 函数库
|
|
204
|
+
source requirement-functions-crossplatform.sh
|
|
205
|
+
|
|
206
|
+
# 直接调用功能
|
|
207
|
+
collect_context "用户需要登录功能"
|
|
208
|
+
main_workflow "开发新的API接口"
|
|
209
|
+
|
|
210
|
+
# 使用跨平台工具
|
|
211
|
+
PLATFORM=$(detect_platform)
|
|
212
|
+
files=$(find_files "*.js|*.ts" 10)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## 🔄 智能体使用示例
|
|
216
|
+
|
|
217
|
+
### 需求识别阶段
|
|
218
|
+
```powershell
|
|
219
|
+
# PowerShell
|
|
220
|
+
.\requirement-launcher.ps1 "我需要实现一个用户注册和登录系统"
|
|
221
|
+
|
|
222
|
+
# Git Bash
|
|
223
|
+
./requirement-launcher.sh "我需要实现一个用户注册和登录系统"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 技术方案对齐
|
|
227
|
+
```powershell
|
|
228
|
+
# PowerShell
|
|
229
|
+
.\requirement-launcher.ps1 "技术方案评估:基于 React 的用户认证系统"
|
|
230
|
+
|
|
231
|
+
# Git Bash
|
|
232
|
+
./requirement-launcher.sh "技术方案评估:基于 React 的用户认证系统"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 任务执行
|
|
236
|
+
```powershell
|
|
237
|
+
# PowerShell
|
|
238
|
+
.\requirement-launcher.ps1 "执行任务:创建登录表单组件"
|
|
239
|
+
|
|
240
|
+
# Git Bash
|
|
241
|
+
./requirement-launcher.sh "执行任务:创建登录表单组件"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### 质量验证
|
|
245
|
+
```powershell
|
|
246
|
+
# PowerShell
|
|
247
|
+
.\requirement-launcher.ps1 "质量验证:登录功能测试"
|
|
248
|
+
|
|
249
|
+
# Git Bash
|
|
250
|
+
./requirement-launcher.sh "质量验证:登录功能测试"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## 🛠️ 故障排除
|
|
254
|
+
|
|
255
|
+
### 常见错误及解决方案
|
|
256
|
+
|
|
257
|
+
#### 1. 执行策略限制
|
|
258
|
+
**错误信息:**
|
|
259
|
+
```
|
|
260
|
+
无法加载文件,因为在此系统上禁止运行脚本。
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**解决方案:**
|
|
264
|
+
```powershell
|
|
265
|
+
# 临时解决
|
|
266
|
+
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
|
267
|
+
|
|
268
|
+
# 永久解决(当前用户)
|
|
269
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
#### 2. 找不到脚本文件
|
|
273
|
+
**错误信息:**
|
|
274
|
+
```
|
|
275
|
+
无法找到路径,因为该路径不存在。
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**解决方案:**
|
|
279
|
+
```powershell
|
|
280
|
+
# 检查文件是否存在
|
|
281
|
+
Test-Path ".\requirement-launcher.ps1"
|
|
282
|
+
|
|
283
|
+
# 查看当前目录
|
|
284
|
+
Get-Location
|
|
285
|
+
|
|
286
|
+
# 切换到正确目录
|
|
287
|
+
Set-Location "D:\your-project-path\templates\agents\aico\requirement"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### 3. 编码问题
|
|
291
|
+
**错误信息:**
|
|
292
|
+
```
|
|
293
|
+
无法处理包含中文字符的内容。
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**解决方案:**
|
|
297
|
+
```powershell
|
|
298
|
+
# 设置正确的编码
|
|
299
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
300
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
301
|
+
|
|
302
|
+
# 或者在 PowerSehll 配置文件中设置
|
|
303
|
+
# 在 $PROFILE 文件中添加上述设置
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
#### 4. 网络连接问题
|
|
307
|
+
**错误信息:**
|
|
308
|
+
```
|
|
309
|
+
无法连接到远程服务器。
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**解决方案:**
|
|
313
|
+
```powershell
|
|
314
|
+
# 检查网络连接
|
|
315
|
+
Test-NetConnection -ComputerName "github.com" -Port 443
|
|
316
|
+
|
|
317
|
+
# 设置代理(如果需要)
|
|
318
|
+
$env:HTTP_PROXY = "http://your-proxy:port"
|
|
319
|
+
$env:HTTPS_PROXY = "http://your-proxy:port"
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
#### 5. Git Bash 工具不可用
|
|
323
|
+
**错误信息:**
|
|
324
|
+
```
|
|
325
|
+
command not found: sed
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**解决方案:**
|
|
329
|
+
```bash
|
|
330
|
+
# 安装 Git for Windows
|
|
331
|
+
# 或安装 WSL
|
|
332
|
+
# 或使用 MSYS2
|
|
333
|
+
|
|
334
|
+
# 安装必要工具
|
|
335
|
+
pacman -S sed grep findutils coreutils # MSYS2
|
|
336
|
+
sudo apt install sed grep findutils # WSL
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### 调试模式
|
|
340
|
+
|
|
341
|
+
#### PowerShell 调试
|
|
342
|
+
```powershell
|
|
343
|
+
# 启用详细输出
|
|
344
|
+
$VerbosePreference = "Continue"
|
|
345
|
+
|
|
346
|
+
# 启用调试输出
|
|
347
|
+
$DebugPreference = "Continue"
|
|
348
|
+
|
|
349
|
+
# 启用调试模式运行
|
|
350
|
+
.\requirement-launcher.ps1 "测试需求" -Debug -Verbose
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
#### Bash 调试
|
|
354
|
+
```bash
|
|
355
|
+
# 启用调试模式
|
|
356
|
+
set -x
|
|
357
|
+
|
|
358
|
+
# 运行脚本
|
|
359
|
+
./requirement-launcher.sh "测试需求"
|
|
360
|
+
|
|
361
|
+
# 禁用调试
|
|
362
|
+
set +x
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## ❓ 常见问题
|
|
366
|
+
|
|
367
|
+
### Q1: PowerShell 和 Git Bash 应该选择哪个?
|
|
368
|
+
|
|
369
|
+
**A:**
|
|
370
|
+
- **PowerShell**: 推荐 Windows 原生使用,更好的 Windows 集成
|
|
371
|
+
- **Git Bash**: 如果您习惯 Unix/Linux 环境,或者需要与 Linux 保持一致
|
|
372
|
+
- **WSL**: 如果需要完整的 Linux 环境
|
|
373
|
+
|
|
374
|
+
### Q2: 为什么脚本无法执行?
|
|
375
|
+
|
|
376
|
+
**A:**
|
|
377
|
+
1. 检查执行策略:运行 `Get-ExecutionPolicy`
|
|
378
|
+
2. 检查文件路径:确保在正确的目录中
|
|
379
|
+
3. 检查文件权限:Git Bash 下需要执行权限
|
|
380
|
+
|
|
381
|
+
### Q3: 如何处理中文乱码?
|
|
382
|
+
|
|
383
|
+
**A:**
|
|
384
|
+
```powershell
|
|
385
|
+
# PowerShell 中设置
|
|
386
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
387
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
388
|
+
|
|
389
|
+
# Git Bash 中设置
|
|
390
|
+
export LANG=zh_CN.UTF-8
|
|
391
|
+
export LC_ALL=zh_CN.UTF-8
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Q4: 如何创建桌面快捷方式?
|
|
395
|
+
|
|
396
|
+
**A:**
|
|
397
|
+
```powershell
|
|
398
|
+
# 创建快捷方式脚本
|
|
399
|
+
$WScriptShell = New-Object -ComObject WScript.Shell
|
|
400
|
+
$Shortcut = $WScriptShell.CreateShortcut("$Home\Desktop\AICO 启动器.lnk")
|
|
401
|
+
$Shortcut.TargetPath = "powershell.exe"
|
|
402
|
+
$Shortcut.Arguments = "-NoExit -Command `"$PWD\requirement-launcher.ps1`""
|
|
403
|
+
$Shortcut.WorkingDirectory = $PWD
|
|
404
|
+
$Shortcut.Save()
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Q5: 如何配置环境变量?
|
|
408
|
+
|
|
409
|
+
**A:**
|
|
410
|
+
```powershell
|
|
411
|
+
# 临时设置(当前会话)
|
|
412
|
+
$env:AICO_HOME = "D:\your-project-path"
|
|
413
|
+
|
|
414
|
+
# 永久设置(系统级别)
|
|
415
|
+
[Environment]::SetEnvironmentVariable("AICO_HOME", "D:\your-project-path", "User")
|
|
416
|
+
|
|
417
|
+
# 重启 PowerShell 生效
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
## 💡 最佳实践
|
|
421
|
+
|
|
422
|
+
### 1. 项目组织
|
|
423
|
+
```
|
|
424
|
+
your-project/
|
|
425
|
+
├── .aico/
|
|
426
|
+
│ ├── docs/ # 生成的文档
|
|
427
|
+
│ ├── scripts/ # 生成的脚本
|
|
428
|
+
│ └── logs/ # 日志文件
|
|
429
|
+
├── src/ # 源代码
|
|
430
|
+
└── templates/
|
|
431
|
+
└── agents/
|
|
432
|
+
└── aico/
|
|
433
|
+
└── requirement/
|
|
434
|
+
└── [脚本文件]
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### 2. 工作流建议
|
|
438
|
+
1. **项目初始化**: 先使用 `requirement-identifier` 明确需求
|
|
439
|
+
2. **方案制定**: 使用 `requirement-aligner` 确定技术方案
|
|
440
|
+
3. **任务拆分**: 使用 `task-splitter-validator` 分解任务
|
|
441
|
+
4. **执行实施**: 使用 `task-executor` 完成开发
|
|
442
|
+
5. **质量验证**: 使用 `task-executor-validator` 进行测试
|
|
443
|
+
|
|
444
|
+
### 3. 性能优化
|
|
445
|
+
```powershell
|
|
446
|
+
# 使用 PowerShell Core 获得更好性能
|
|
447
|
+
# 避免在大量循环中使用外部命令
|
|
448
|
+
# 优先使用 PowerShell 内置命令
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### 4. 安全考虑
|
|
452
|
+
- 始终检查脚本内容,特别是下载的脚本
|
|
453
|
+
- 使用适当的执行策略,不要设置为 `Unrestricted`
|
|
454
|
+
- 定期更新 PowerShell 和相关工具
|
|
455
|
+
|
|
456
|
+
### 5. 备份与恢复
|
|
457
|
+
```powershell
|
|
458
|
+
# 备份配置
|
|
459
|
+
Copy-Item ".aico" -Destination ".aico-backup-$(Get-Date -Format 'yyyyMMdd')" -Recurse
|
|
460
|
+
|
|
461
|
+
# 恢复配置
|
|
462
|
+
Copy-Item ".aico-backup-20241201" -Destination ".aico" -Recurse -Force
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## 📞 技术支持
|
|
466
|
+
|
|
467
|
+
如果遇到问题,请按以下步骤排查:
|
|
468
|
+
|
|
469
|
+
1. **检查本文档**:确保已对应版本的处理方案
|
|
470
|
+
2. **查看日志文件**:`.aico/logs/` 目录日志可能包含详细信息
|
|
471
|
+
3. **社区支持**:在项目 Issues 中搜索相关问题
|
|
472
|
+
4. **简化重现**:创建最小可复现的测试场景
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
**最后更新时间**: 2024年12月
|
|
477
|
+
**适用版本**: AICO CLI v0.3.0+
|
|
478
|
+
**兼容平台**: Windows 10/11, PowerShell 5.1+
|