360 Secure SkillHub
360 安全技能中心

etcd-manager

用于 etcd 键值存储的查询、写入和删除,强调先读后写、修改前展示旧值、区分开发/测试/生产环境,并要求破坏性操作获得明确确认;提供 etcdctl 命令示例和标准化操作结果格式。

fpbear
fpbear
热度 49.67
最近更新 2026-05-18 12:32:45
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add etcd-manager
Metadata
name
etcd
description
Manage etcd key-value store operations (list, get, put, delete) with safety checks and backup mechanisms. Use when: reading/writing configuration, managing distributed system state, or performing safe etcd operations in dev/test/prod environments.

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
  2. Backup before modification: Always show old value before put/delete
  3. Production protection: Be extra cautious with prod environments
  4. Explicit confirmation: Require clear user intent for destructive operations

Command Conventions

List keys by prefix

etcdctl --endpoints="$ENDPOINTS" get "$PREFIX" --prefix --keys-only

Get key and value

etcdctl --endpoints="$ENDPOINTS" get "$KEY"

Put key (with backup)

# Show old value first
etcdctl --endpoints="$ENDPOINTS" get "$KEY" || true
# Write new value
etcdctl --endpoints="$ENDPOINTS" put "$KEY" "$VALUE"

Delete key (with backup)

# Backup old value
etcdctl --endpoints="$ENDPOINTS" get "$KEY" || true
# Delete
etcdctl --endpoints="$ENDPOINTS" del "$KEY"

For TLS connections, add:

--cacert="$CACERT" --cert="$CERT" --key="$KEY_FILE"

Workflow

  1. Environment identification: Determine if this is dev/test/prod
  2. Safety check: Verify operation safety based on environment
  3. Backup: For write operations, show current state
  4. Execution: Perform the requested operation
  5. Verification: Confirm the operation succeeded

Output Format

Use standardized output format:

【ETCD 操作结果】

1. 操作信息
- 环境:
- Endpoint:
- Action:
- Prefix:
- Key:

2. 执行结果
- 状态:成功 / 失败
- 摘要:

3. 数据
- Key 列表:
- 原值:
- 新值:
- 删除前备份:

4. 风险提示
- 

5. 备注
- 

Examples

List keys

请使用etcd技能:
- 操作:list
- 环境:test
- 端点:http://etcd-test:2379
- 前缀:/app/config/

Get value

请使用etcd技能:
- 操作:get
- 环境:prod
- 端点:https://etcd-prod:2379
- key:/app/config/database

Put value

请使用etcd技能:
- 操作:put
- 环境:dev
- 端点:http://localhost:2379
- key:/test/key
- value:test_value

Delete key

请使用etcd技能:
- 操作:delete
- 环境:test
- 端点:http://etcd-test:2379
- key:/test/old_key

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