gopass Skill
gopass is a CLI password manager for teams, built on GPG and Git.
Prerequisites
- -
gopass binary installed - GPG key available (gopass uses GPG for encryption)
- Store initialized (
gopass init or gopass setup)
Common Operations
List secrets
CODEBLOCK0
Show a secret
CODEBLOCK1
Create / Update
CODEBLOCK2
Add key-value metadata below the first line (password):
CODEBLOCK3
Generate passwords
CODEBLOCK4
Delete
CODEBLOCK5
Move / Copy
CODEBLOCK6
Search
CODEBLOCK7
Store Management
Initialize
CODEBLOCK8
Mount sub-stores
CODEBLOCK9
Sync (git push/pull)
CODEBLOCK10
Recipients (team access)
CODEBLOCK11
TOTP
gopass otp path/to/secret # show current TOTP code
Store TOTP URI as
totp: otpauth://totp/... in the entry body.
Non-interactive Tips
- - Use
echo "pw" | gopass insert -f path for scripted inserts - Use
gopass show -o path for machine-readable password-only output - Use
gopass show -f path to suppress warnings - Set
GOPASS_NO_NOTIFY=true to suppress desktop notifications - Use
gopass --yes to auto-confirm prompts
gopass 技能
gopass 是一款基于 GPG 和 Git 构建的团队 CLI 密码管理器。
前置条件
- - 已安装 gopass 二进制文件
- 拥有可用的 GPG 密钥(gopass 使用 GPG 进行加密)
- 已初始化存储库(gopass init 或 gopass setup)
常用操作
列出密钥
bash
gopass ls
gopass ls -f # 扁平列表
查看密钥
bash
gopass show path/to/secret # 完整条目(密码 + 元数据)
gopass show -o path/to/secret # 仅密码
gopass show -c path/to/secret # 复制到剪贴板
gopass show path/to/secret key # 显示特定字段
创建 / 更新
bash
gopass insert path/to/secret # 交互式
gopass edit path/to/secret # 在 $EDITOR 中打开
echo mypassword | gopass insert -f path/to/secret # 非交互式
在第一行(密码)下方添加键值对元数据:
mysecretpassword
username: erdGecrawl
url: https://github.com
notes: Created 2026-01-31
生成密码
bash
gopass generate path/to/secret 24 # 24 位密码
gopass generate -s path/to/secret 32 # 包含符号
gopass generate --xkcd path/to/secret 4 # 口令(4 个单词)
删除
bash
gopass rm path/to/secret
gopass rm -r path/to/folder # 递归删除
移动 / 复制
bash
gopass mv old/path new/path
gopass cp source/path dest/path
搜索
bash
gopass find github # 搜索条目名称
gopass grep username # 搜索条目内容
存储库管理
初始化
bash
gopass setup # 引导式首次设置
gopass init
# 使用特定 GPG 密钥初始化
挂载子存储库
bash
gopass mounts add work /path/to/work-store
gopass mounts remove work
gopass mounts # 列出挂载点
同步(git push/pull)
bash
gopass sync
接收者(团队访问)
bash
gopass recipients # 列出
gopass recipients add
gopass recipients remove
TOTP
bash
gopass otp path/to/secret # 显示当前 TOTP 验证码
在条目正文中将 TOTP URI 存储为 totp: otpauth://totp/...。
非交互式提示
- - 使用 echo pw | gopass insert -f path 进行脚本化插入
- 使用 gopass show -o path 获取机器可读的纯密码输出
- 使用 gopass show -f path 抑制警告
- 设置 GOPASSNONOTIFY=true 抑制桌面通知
- 使用 gopass --yes 自动确认提示