Safely inject API keys from 1Password into macOS LaunchAgent plists using PlistBuddy. Use when running OpenClaw on macOS and storing secrets in 1Password — avoids plaintext keys on disk while keeping LaunchAgent env vars populated. Requires 1Password CLI (op).
将 1Password 中的密钥注入到 macOS LaunchAgent plist 文件中,而无需在磁盘上保留明文密钥。使用 op read 获取密钥,并通过 /usr/libexec/PlistBuddy 将其直接注入到 plist 的 EnvironmentVariables 块中。
bash
bash scripts/inject-gateway-env.sh
从 1Password 读取每个密钥,注入到 gateway plist 中,然后重启服务。
可配置的 op://Vault/Item/field 引用列表,映射到环境变量名称。根据您的设置修改脚本的 KEYS 数组。
更改 Node 二进制路径(即使改为符号链接)可能会静默撤销 macOS TCC 权限。始终将 gateway plist 锁定到 Homebrew Cellar 路径,而不是 NVM 符号链接。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 gateway-env-injector-1776199021 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 gateway-env-injector-1776199021 技能
skillhub install gateway-env-injector-1776199021
文件大小: 2.86 KB | 发布时间: 2026-4-15 13:51