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="${OPENCLAW_TMUX_SOCKET_DIR:-${CLAWDBOT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/openclaw-tmux-sockets}}"
mkdir -p "$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
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。为避免重复弹窗提示和运行失败,请始终在使用全新socket/会话名称的专用tmux会话中运行。
op示例(socket规范请参考 skill,请勿复用旧的会话名称):
tmuxbash
SOCKET_DIR="${OPENCLAW_TMUX_SOCKET_DIR:-${CLAWDBOT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/openclaw-tmux-sockets}}"
mkdir -p "$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
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 - 若命令返回「账号未登录」,请在tmux内重新运行并在桌面应用中完成授权。
op signin - 禁止在tmux外运行;如果无法使用tmux,请停止操作并咨询相关人员。
op