1password
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese1Password CLI
1Password CLI
Follow the official CLI get-started steps. Don't guess install commands.
请遵循官方CLI入门步骤操作,不要自行猜测安装命令。
References
参考资料
- (install + app integration + sign-in flow)
references/get-started.md - (real
references/cli-examples.mdexamples)op
- (安装 + 应用集成 + 登录流程)
references/get-started.md - (真实
references/cli-examples.md示例)op
Workflow
工作流程
- Check OS + shell.
- Verify CLI present: .
op --version - Confirm desktop app integration is enabled (per get-started) and the app is unlocked.
- REQUIRED: create a fresh tmux session for all commands (no direct
opcalls outside tmux).op - Sign in / authorize inside tmux: (expect app prompt).
op signin - Verify access inside tmux: (must succeed before any secret read).
op whoami - If multiple accounts: use or
--account.OP_ACCOUNT
- 检查操作系统与Shell环境。
- 验证CLI是否存在:。
op --version - 确认桌面应用集成已启用(按照入门指南操作)且应用已解锁。
- 必需操作:为所有命令创建一个全新的tmux会话(禁止在tmux之外直接调用
op)。op - 在tmux内登录/授权:(会触发应用弹窗)。
op signin - 在tmux内验证访问权限:(在读取任何密钥前必须执行成功)。
op whoami - 若为多账户:使用参数或
--account环境变量。OP_ACCOUNT
REQUIRED tmux session (T-Max)
必需的tmux会话(T-Max)
The shell tool uses a fresh TTY per command. To avoid re-prompts and failures, always run inside a dedicated tmux session with a fresh socket/session name.
opExample (see skill for socket conventions, do not reuse old session names):
tmuxbash
SOCKET_DIR="${CLAWDBOT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/clawdbot-tmux-sockets}"
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/clawdbot-op.sock"
SESSION="op-auth-$(date +%Y%m%d-%H%M%S)"
tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op signin --account my.1password.com" Enter
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op whoami" Enter
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op vault list" Enter
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
tmux -S "$SOCKET" kill-session -t "$SESSION"Shell工具每个命令会使用一个全新的TTY。为避免重复弹窗和执行失败,请始终在专用的tmux会话中运行,并使用全新的套接字/会话名称。
op示例(请遵循技能中的套接字约定,不要复用旧会话名称):
tmuxbash
SOCKET_DIR="${CLAWDBOT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/clawdbot-tmux-sockets}"
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/clawdbot-op.sock"
SESSION="op-auth-$(date +%Y%m%d-%H%M%S)"
tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op signin --account my.1password.com" Enter
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op whoami" Enter
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op vault list" Enter
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
tmux -S "$SOCKET" kill-session -t "$SESSION"Guardrails
防护规则
- Never paste secrets into logs, chat, or code.
- Prefer /
op runover writing secrets to disk.op inject - If sign-in without app integration is needed, use .
op account add - If a command returns "account is not signed in", re-run inside tmux and authorize in the app.
op signin - Do not run outside tmux; stop and ask if tmux is unavailable.
op
- 切勿将密钥粘贴到日志、聊天或代码中。
- 优先使用/
op run,而非将密钥写入磁盘。op inject - 若需要在未启用应用集成的情况下登录,请使用。
op account add - 如果命令返回“account is not signed in”,请在tmux内重新运行并在应用中完成授权。
op signin - 禁止在tmux之外运行;若tmux不可用,请停止操作并咨询相关人员。
op