1Password Cli For Agents
/install 1password-cli
1Password CLI for Agents
This skill allows agents to securely access and manage secrets using the 1Password CLI (op) and a Service Account. It provides commands for reading, writing, and managing items within a dedicated vault.
Prerequisites
- Install 1Password CLI:
- macOS:
brew install --cask 1password-cli - Linux/Windows: See official docs.
- macOS:
- Create a Service Account:
- Go to 1Password Developer Portal.
- Create a Service Account and grant it access to a specific vault (e.g., "Agent Vault").
- Copy the Service Account Token.
- Set Environment Variable:
- Set
OP_SERVICE_ACCOUNT_TOKENin your environment (e.g.,.envfile or export in shell). - For OpenClaw, you can add
OP_SERVICE_ACCOUNT_TOKEN=...to.env.
- Set
Usage
All commands require the OP_SERVICE_ACCOUNT_TOKEN to be set.
1. Check Authentication
Verify the service account is working:
op whoami
2. List Vaults
List vaults accessible to the service account:
op vault list
3. Read an Item
Get details of an item (JSON format is best for parsing):
op item get "Item Name" --vault "Vault Name" --format json
Or get a specific field (e.g., password):
op read "op://Vault Name/Item Name/password"
4. Create an Item
Create a login item:
op item create --category login --title "My Service" --url "https://example.com" --vault "Vault Name" username="myuser" password="mypassword"
Create a secure note:
op item create --category "Secure Note" --title "API Key" --vault "Vault Name" notes="my-secret-key"
5. Edit an Item
Update a password:
op item edit "Item Name" password="newpassword" --vault "Vault Name"
6. Delete an Item
op item delete "Item Name" --vault "Vault Name"
Tips for Agents
- Always use JSON output: Add
--format jsontoopcommands for structured data that is easier to parse. - Security: Never print the
OP_SERVICE_ACCOUNT_TOKENor retrieved secrets to the console unless explicitly asked. - Vaults: If multiple vaults are available, specify the
--vaultflag to avoid ambiguity. - Rate Limits: Service accounts have rate limits. Cache results if possible or retry with backoff.
Troubleshooting
- "You are not currently signed in": Ensure
OP_SERVICE_ACCOUNT_TOKENis set correctly. - "account is not authorized": Check that the service account has permission for the specific vault and operation (read/write).
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install 1password-cli - 安装完成后,直接呼叫该 Skill 的名称或使用
/1password-cli触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
1Password Cli For Agents 是什么?
Securely access and manage secrets with 1Password CLI using a Service Account token for vault operations like read, write, edit, and delete. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1394 次。
如何安装 1Password Cli For Agents?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install 1password-cli」即可一键安装,无需额外配置。
1Password Cli For Agents 是免费的吗?
是的,1Password Cli For Agents 完全免费(开源免费),可自由下载、安装和使用。
1Password Cli For Agents 支持哪些平台?
1Password Cli For Agents 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 1Password Cli For Agents?
由 sichengchen(@sichengchen)开发并维护,当前版本 v0.1.0。