1password

openclaw/openclaw/skills/1password

作者 openclawb0c330d27df4a528f65185cc3e509284d1b218d9无许可证394K 个星标收录于 2026年11月20日更新于 2026年11月20日仓库今天更新

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

AI 生成的概览

指导配置和使用 1Password CLI(op),用于登录、桌面应用集成以及读取或注入密钥。

功能
引导代理确认 op 命令是否存在,识别当前可用的认证方式(服务账号令牌、桌面应用集成或独立登录),并按对应方式执行 op 命令。涵盖读取密钥、列出保险库、在不落盘的情况下把密钥注入命令,以及在具备相应工具时通过浏览器自动填充凭据。还给出安全守则和登录失败时的排查步骤。
适用场景
当任务需要从 1Password 获取凭据或密钥、需要在主机上配置或排查 1Password CLI 认证,或需要通过 1Password 凭据工具登录网站时使用。
运行要求
需要安装 1Password CLI(op),例如通过 1password-cli 的 Homebrew 配方。需要以下之一:OP_SERVICE_ACCOUNT_TOKEN、已启用 CLI 集成的 1Password 桌面应用,或交互式登录;仅在 macOS/Linux 上使用独立登录流程时需要 tmux。不附带脚本,只有参考文档。

1Password CLI

Follow the official CLI get-started steps. Don't guess install commands.

References

  • references/get-started.md (install + app integration + sign-in flow)
  • references/cli-examples.md (real op examples)

Workflow

  1. Check OS + shell.
  2. Verify CLI present: op --version.
  3. Detect the auth mode the user has set up:
    • Service account: OP_SERVICE_ACCOUNT_TOKEN is set (typical for headless setups, CI, gateways).
    • Desktop app integration: the 1Password desktop app is running with CLI integration enabled (typical on macOS / Windows / Linux desktops).
    • Standalone signin: neither of the above — op signin will prompt for an account password every session.
  4. Run op according to the auth mode (see below).
  5. Verify access: op whoami should succeed before any secret read.
  6. If multiple accounts: use --account or OP_ACCOUNT.

Running op per auth mode

Service account (preferred for headless / gateway use)

Direct exec. No tmux, no signin step.

bash
export OP_SERVICE_ACCOUNT_TOKEN="ops_..."op vault listop read op://app-prod/db/password

Desktop app integration

Direct exec. Do not wrap in tmux — the desktop app integration uses a per-user IPC channel that is established for the gateway's exec environment but is not always reliably reachable from tmux subshells, which run with a different environment context. The transport differs per platform (XPC via the 1Password Browser Helper on macOS, a Unix domain socket on Linux, a named pipe on Windows); the practical rule for an agent is the same on all three: run op directly. On macOS, a useful symptom indicator is the 1Password integration group container at ~/Library/Group Containers/2BUA8C4S2C.com.1password/t/.

bash
op vault list      # may trigger Touch ID / Windows Hello / system auth on first callop whoami

If a call returns 1Password CLI couldn't connect to the 1Password desktop app, do not switch to tmux. Confirm the desktop app is running and unlocked, then retry direct exec.

Standalone signin (no app, interactive password)

This is the only mode where tmux helps. op signin prints an eval-style export setting an OP_SESSION_* token for POSIX shells; later commands in the same shell are authenticated by that env var. The gateway's per-command shells lose that state between calls, so a persistent tmux pane keeps the session token alive — but only if the export is actually applied with eval in a POSIX shell. Sending op signin as a plain command leaves stdout printed to the pane and op whoami will fail.

The tmux flow is only actionable on macOS/Linux hosts where the tmux skill is available. The example intentionally opens /bin/sh so the POSIX eval "$(op signin ...)" output is valid even when the user's normal shell is fish. On Windows, prefer desktop app integration or service account auth. If the user only has standalone interactive signin on Windows, stop and ask them to provide a persistent PowerShell session mechanism or switch to desktop integration/service account auth; do not translate the tmux commands directly.

bash
SOCKET_DIR="${OPENCLAW_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/openclaw-tmux-sockets}"mkdir -p "$SOCKET_DIR"chmod 700 "$SOCKET_DIR"SOCKET="$SOCKET_DIR/openclaw-op.sock"SESSION="op-auth-$(date +%Y%m%d-%H%M%S)"
tmux -S "$SOCKET" new -d -s "$SESSION" -n shell /bin/shtmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'eval "$(op signin --account my.1password.com)"' Entertmux -S "$SOCKET" capture-pane -t "$SESSION":0.0 -p -S - | tail -40

Do not queue follow-up commands while signin is prompting. Poll the pane with capture-pane until signin has either completed and the shell prompt has returned, or it is clearly waiting for human input. If the prompt requires a password, MFA, or account choice, pause and ask the user to complete signin in their own terminal; give them the socket and session values so they can attach locally. The agent should not run tmux attach from exec because attach consumes the current TTY and prevents scripted send-keys / capture-pane control.

After the shell prompt returns, verify by sending the checks into the same pane:

bash
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'op whoami' Entertmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'op vault list' Entertmux -S "$SOCKET" capture-pane -t "$SESSION":0.0 -p -S - | tail -80

Keep the tmux session running so later op read / op run commands reuse the same authenticated shell.

Use the same SOCKET and SESSION values for every follow-up command in this standalone signin flow. The -S "$SOCKET" flag selects the tmux server socket; keep it in a user-owned 0700 directory, do not share it between users, and choose a new session name for each new signin attempt.

Browser sign-in (1Password for Claude)

If the session exposes Claude in Chrome credential tools (request_credentials, autofill_credential, enter_verification_code), prefer them over op for signing in to websites: 1Password fills the page directly and the secret never enters context. Rules:

  • Request every credential the task needs in one request_credentials call before navigating.
  • Approval is a 1Password prompt on the gateway host. If it stays pending, tell the user which host to unlock ("1Password is waiting for approval on this Mac") instead of retrying.
  • Never ask the user to send passwords or one-time codes through chat; codes go through enter_verification_code only.
  • Do not fall back to op read for a website password just because the browser flow needs approval; that defeats the no-exposure design. Use op for secrets consumed by commands and config, not for web logins when the browser flow exists.

Guardrails

  • Never paste secrets into logs, chat, or code.
  • Prefer op run / op inject over writing secrets to disk.
  • If sign-in without app integration is needed, use op account add first.
  • If a command returns "account is not signed in":
    • service account: re-export OP_SERVICE_ACCOUNT_TOKEN
    • desktop app: confirm the app is running and integration is enabled
    • standalone: re-run op signin inside the same tmux session and authorize

来源与署名

来源:openclaw/openclaw位于skills/1password提交b0c330d

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

在 README 中添加徽章

向读者展示该技能已收录于 SourceWeft,徽章链接到本页。

“Listed on SourceWeft”徽章预览
[![Listed on SourceWeft](https://sourceweft.com/badge/skills/gh-openclaw-openclaw-1password-skills-1password-e07658e9af312515.svg)](https://sourceweft.com/skills/gh-openclaw-openclaw-1password-skills-1password-e07658e9af312515?utm_source=readme&utm_medium=badge)

举报或申请下架