secret-manager
通过 GNOME 密钥环安全地管理 API 密钥并将其注入 OpenClaw 配置中。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~jswortz-secret-managercURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~jswortz-secret-manager/file -o jswortz-secret-manager.md# Secret Manager A secure way to manage API keys for OpenClaw using the system keyring (GNOME Keyring / libsecret). This skill provides a `secret-manager` CLI that: 1. Stores API keys securely using `secret-tool`. 2. Injects them into your `auth-profiles.json`. 3. Propagates them to `systemd` user environment. 4. Restarts the OpenClaw Gateway service inside your Distrobox container. ## Installation Ensure you have the dependencies: - **Debian/Ubuntu:** `sudo apt install libsecret-tools` - **Fedora:** `sudo dnf install libsecret` - **Arch:** `sudo pacman -S libsecret` Copy the script to your path or run it directly. ## Configuration The script uses default paths that work for most OpenClaw installations, but you can override them with environment variables: | Variable | Description | Default | | :--- | :--- | :--- | | `OPENCLAW_CONTAINER` | Name of the Distrobox container | `clawdbot` | | `OPENCLAW_HOME` | Path to OpenClaw config directory | `~/.openclaw` | | `SECRETS_ENV_FILE` | Path to an optional .env file to source | `~/.config/openclaw/secrets.env` | ## Usage **List all configured keys:** ```bash secret-manager list ``` **Set a key (interactive prompt):** ```bash secret-manager OPENAI_API_KEY # (Paste key when prompted) ``` **Set a key (direct):** ```bash secret-manager DISCORD_BOT_TOKEN "my-token-value" ``` **Supported Keys:** - `OPENAI_API_KEY` - `GEMINI_API_KEY` - `DISCORD_BOT_TOKEN` - `GATEWAY_AUTH_TOKEN` - `OLLAMA_API_KEY` - `GIPHY_API_KEY` - `GOOGLE_PLACES_API_KEY` - `LINKEDIN_LI_AT` - `LINKEDIN_JSESSIONID` --- ## 中文说明 # Secret Manager 一种使用系统密钥环(GNOME Keyring / libsecret)为 OpenClaw 安全管理 API 密钥的方式。 此技能提供一个 `secret-manager` CLI,它可以: 1. 使用 `secret-tool` 安全地存储 API 密钥。 2. 将它们注入你的 `auth-profiles.json`。 3. 将它们传播到 `systemd` 用户环境。 4. 在你的 Distrobox 容器内重启 OpenClaw Gateway 服务。 ## 安装 确保你已安装依赖项: - **Debian/Ubuntu:** `sudo apt install libsecret-tools` - **Fedora:** `sudo dnf install libsecret` - **Arch:** `sudo pacman -S libsecret` 将脚本复制到你的 PATH,或直接运行它。 ## 配置 该脚本使用适用于大多数 OpenClaw 安装的默认路径,但你可以用环境变量覆盖它们: | 变量 | 说明 | 默认值 | | :--- | :--- | :--- | | `OPENCLAW_CONTAINER` | Distrobox 容器的名称 | `clawdbot` | | `OPENCLAW_HOME` | OpenClaw 配置目录的路径 | `~/.openclaw` | | `SECRETS_ENV_FILE` | 可选的、要载入的 .env 文件路径 | `~/.config/openclaw/secrets.env` | ## 用法 **列出所有已配置的密钥:** ```bash secret-manager list ``` **设置一个密钥(交互式提示):** ```bash secret-manager OPENAI_API_KEY # (Paste key when prompted) ``` **设置一个密钥(直接):** ```bash secret-manager DISCORD_BOT_TOKEN "my-token-value" ``` **支持的密钥:** - `OPENAI_API_KEY` - `GEMINI_API_KEY` - `DISCORD_BOT_TOKEN` - `GATEWAY_AUTH_TOKEN` - `OLLAMA_API_KEY` - `GIPHY_API_KEY` - `GOOGLE_PLACES_API_KEY` - `LINKEDIN_LI_AT` - `LINKEDIN_JSESSIONID`