skills/key-rotation/SKILL.md
# Key Rotation Skill **触发词**: "换key", "更换key", "替换key", "rotate key", "key rotation", "更新密钥", "换API key", "给XX换key" ## 概述 统一管理 OpenClaw 所有 API key 的轮换流程。所有 key 通过 `pass` 金库存储,通过 `~/.openclaw/.env` 分发到 OpenClaw Gateway 和所有 Agent。 ## 架构 ``` pass (金库) ↓ pass show api/xxx ~/.openclaw/.env (运行时环境变量文件) ↓ EnvironmentFile= (systemd) openclaw-gateway 进程环境变量 ↓ ${VAR_NAME} 引用 openclaw.json + agents/*/agent/models.json ``` ## Key 换新流程 ### 用户说 "给 XX 换 key" 时,执行以下步骤: **Step 1: 确认新 key** ```bash #
npx skillsauth add aaaaqwq/agi-super-team skills/key-rotationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
触发词: "换key", "更换key", "替换key", "rotate key", "key rotation", "更新密钥", "换API key", "给XX换key"
统一管理 OpenClaw 所有 API key 的轮换流程。所有 key 通过 pass 金库存储,通过 ~/.openclaw/.env 分发到 OpenClaw Gateway 和所有 Agent。
pass (金库)
↓ pass show api/xxx
~/.openclaw/.env (运行时环境变量文件)
↓ EnvironmentFile= (systemd)
openclaw-gateway 进程环境变量
↓ ${VAR_NAME} 引用
openclaw.json + agents/*/agent/models.json
Step 1: 确认新 key
# 用户提供新 key 后,存入 pass
pass insert api/<provider-name>
# 输入新 key
Step 2: 更新 .env
# 运行 env 重建脚本
bash ~/.openclaw/skills/key-rotation/scripts/rebuild-env.sh
Step 3: 重启 Gateway
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway
Step 4: 验证
bash ~/.openclaw/skills/key-rotation/scripts/verify-keys.sh
| 供应商 | 环境变量 | pass 路径 | 用途 |
|--------|----------|-----------|------|
| ZAI | ZAI_API_KEY | api/zai | GLM-5 系列 |
| Xingsuancode | XINGSUANCODE_KEY | api/xingsuancode | Claude Opus/Sonnet |
| XSC Backup | XSC_BACKUP_API_KEY | api/xingsuancode | 同上备份 |
| Xingjiabiapi | XINGJIABIAPI_KEY | api/xingjiabiapi | 多模型中转 |
| AIXN | AIXN_API_KEY | api/aixn | Claude 中转 |
| xAI | XAI_API_KEY | api/xai | Grok 系列 |
| Moonshot | MOONSHOT_API_KEY | api/kimi | Kimi K2.5 |
| Minimax | MINIMAX_API_KEY | api/minimax | MiniMax M2/M2.5 |
| WoW | WOW_API_KEY | api/wow | 多模型中转 |
| Xinyuan | XINYUAN_API_KEY | api/xinyuan | 多模型中转 |
| OpenRouter | OPENROUTER_API_KEY | api/openrouter-vip | 多模型中转 |
| GitHub Copilot | GITHUB_COPILOT_KEY | api/github-copilot | GPT/Gemini/Claude |
| GitHub Copilot (Agents) | GITHUB_COPILOT_AGENTS_KEY | api/github-copilot-agents | Agent用 |
| Ollama | OLLAMA_API_KEY | - | 固定值 ollama |
| Google AI Studio | GOOGLE_AI_STUDIO_KEY | api/google-ai-studio | Gemini/Veo/Imagen |
| Brave Search | BRAVE_API_KEY | api/brave | 网络搜索 |
| DeepSeek | DEEPSEEK_API_KEY | api/deepseek | DeepSeek 系列 |
| Exa | EXA_API_KEY | api/exa | 语义搜索 |
| Perplexity | PERPLEXITY_API_KEY | api/perplexity | AI 搜索 |
| Tavily | TAVILY_API_KEY | api/tavily | 网络搜索 |
| Firecrawl | FIREFRAWL_API_KEY | api/firecrawl | 网页爬取 |
| KlingAI | KLINGAI_API_KEY | api/klingai | 视频生成 |
| Notion | NOTION_API_KEY | api/notion | Notion API |
***REDACTED*** 遮罩.env 从 pass 生成,不手动编辑development
Technology-agnostic prompt generator that creates customizable AI prompts for scanning codebases and identifying high-quality code exemplars. Supports multiple programming languages (.NET, Java, JavaScript, TypeScript, React, Angular, Python) with configurable analysis depth, categorization methods, and documentation formats to establish coding standards and maintain consistency across development teams.
tools
Expert-level browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, capturing screenshots, analyzing network traffic, and profiling performance.
data-ai
Prompt for creating detailed feature implementation plans, following Epoch monorepo structure.
tools
Interactive prompt refinement workflow: interrogates scope, deliverables, constraints; copies final markdown to clipboard; never writes code. Requires the Joyride extension.