Aether 环境诊断 (aether-doctor)
版本: 2.1.0 | 优先级: P0
快速开始
/aether:doctor # 完整诊断
/aether:doctor --ssh # 仅 SSH 检查
/aether:doctor --cluster # 仅集群连接
/aether:doctor --fix # 自动修复问题
诊断项目
| 项目 | 检查内容 | 修复建议 |
|---|---|---|
| aether CLI | 安装状态、版本 | 自动安装 |
| 配置文件 | 格式、地址有效性 | 引导配置 |
| 集群连接 | Nomad/Consul API | 网络检查 |
| SSH 配置 | 密钥、权限、连接 | 提供命令 |
| CI/CD | Secrets 配置 | 修复建议 |
诊断流程
Step 0: 确定缓存位置
if [ -f "./.aether/config.yaml" ]; then
CACHE_FILE="./.aether/environment.yaml"
else
CACHE_FILE="$HOME/.aether/environment.yaml"
fi
Step 1: 检查 aether CLI
检测逻辑:
command -v aether→ PATH 中~/.aether/aether→ 用户安装~/.aether/aether.exe→ Windows
如果未安装或版本过低:
- 提供交互式安装选项
- 详见 CLI 安装流程
Step 2: 检查配置文件
# 检查配置
cat ~/.aether/config.yaml 2>/dev/null
cat ./.aether/config.yaml 2>/dev/null
# 配置优先级
# 环境变量 > 项目配置 > 全局配置
Step 3-4: 集群验证和连接测试
详见 集群拓扑和验证
Step 5-6: SSH 检查和连接测试
详见 SSH 诊断
Step 7: CI/CD 配置检查(可选)
详见 CI 配置检查
Step 8: 更新缓存
详见 环境缓存格式
详细参考
| 主题 | 文档 |
|---|---|
| CLI 安装流程 | cli-installation.md |
| 集群拓扑和验证 | cluster-validation.md |
| SSH 诊断 | ssh-diagnostics.md |
| CI 配置检查 | ci-configuration.md |
| 环境缓存格式 | environment-cache.md |
| 输出示例 | output-examples.md |
与其他 Skills 的集成
缓存读取示例
# 获取集群信息
SERVERS=$(yq '.cluster.servers[] | .ip' ./.aether/environment.yaml)
LEADER=$(yq '.cluster.current_leader' ./.aether/environment.yaml)
HEAVY_NODES=$(yq '.cluster.clients[] | select(.class == "heavy_workload") | .ip' ./.aether/environment.yaml)
错误诊断建议
| 错误类型 | 建议 |
|---|---|
command not found |
运行 /aether:doctor 安装 CLI |
connection refused |
运行 /aether:doctor --cluster |
permission denied (SSH) |
运行 /aether:doctor --ssh |
命令行等价操作
# 检查 CLI
aether version
# 检查集群
curl -s http://192.168.69.70:4646/v1/status/leader
curl -s http://192.168.69.70:4646/v1/nodes
# 测试 SSH
ssh -o ConnectTimeout=5 root@192.168.69.80 "hostname"
Skill 版本: 2.0.0 最后更新: 2026-03-12 维护者: 10CG Infrastructure Team