etcd Skill
A clean and safe etcd management skill for OpenClaw.
Safety Rules
- 1. Read-first: Always prefer read operations (list, get) over write operations
- Backup before modification: Always show old value before put/delete
- Production protection: Be extra cautious with prod environments
- Explicit confirmation: Require clear user intent for destructive operations
Command Conventions
List keys by prefix
CODEBLOCK0
Get key and value
CODEBLOCK1
Put key (with backup)
CODEBLOCK2
Delete key (with backup)
CODEBLOCK3
For TLS connections, add:
CODEBLOCK4
Workflow
- 1. Environment identification: Determine if this is dev/test/prod
- Safety check: Verify operation safety based on environment
- Backup: For write operations, show current state
- Execution: Perform the requested operation
- Verification: Confirm the operation succeeded
Output Format
Use standardized output format:
CODEBLOCK5
Examples
List keys
CODEBLOCK6
Get value
CODEBLOCK7
Put value
CODEBLOCK8
Delete key
CODEBLOCK9
Notes
- - Always use etcdctl version 3.6.1 or higher
- For production environments, consider using TLS
- The skill includes built-in backup mechanisms
- Operations are logged for audit purposes
etcd 技能
一个用于 OpenClaw 的干净安全的 etcd 管理技能。
安全规则
- 1. 优先读取:始终优先执行读取操作(list、get),而非写入操作
- 修改前备份:在执行 put/delete 操作前,始终显示旧值
- 生产环境保护:对生产环境需格外谨慎
- 明确确认:对于破坏性操作,需获得用户的明确意图确认
命令规范
按前缀列出键
bash
etcdctl --endpoints=$ENDPOINTS get $PREFIX --prefix --keys-only
获取键和值
bash
etcdctl --endpoints=$ENDPOINTS get $KEY
写入键(带备份)
bash
先显示旧值
etcdctl --endpoints=$ENDPOINTS get $KEY || true
写入新值
etcdctl --endpoints=$ENDPOINTS put $KEY $VALUE
删除键(带备份)
bash
备份旧值
etcdctl --endpoints=$ENDPOINTS get $KEY || true
删除
etcdctl --endpoints=$ENDPOINTS del $KEY
对于 TLS 连接,添加:
bash
--cacert=$CACERT --cert=$CERT --key=$KEY_FILE
工作流程
- 1. 环境识别:判断当前是开发/测试/生产环境
- 安全检查:根据环境验证操作安全性
- 备份:对于写入操作,显示当前状态
- 执行:执行请求的操作
- 验证:确认操作成功完成
输出格式
使用标准化输出格式:
【ETCD 操作结果】
- 1. 操作信息
- 2. 执行结果
- 3. 数据
- 4. 风险提示
列出键
请使用etcd技能:
- - 操作:list
- 环境:test
- 端点:http://etcd-test:2379
- 前缀:/app/config/
获取值
请使用etcd技能:
- - 操作:get
- 环境:prod
- 端点:https://etcd-prod:2379
- key:/app/config/database
写入值
请使用etcd技能:
- - 操作:put
- 环境:dev
- 端点:http://localhost:2379
- key:/test/key
- value:test_value
删除键
请使用etcd技能:
- - 操作:delete
- 环境:test
- 端点:http://etcd-test:2379
- key:/test/old_key
备注
- - 始终使用 etcdctl 3.6.1 或更高版本
- 对于生产环境,考虑使用 TLS
- 该技能包含内置备份机制
- 操作会被记录以供审计