Touch ID for every op call. A macOS wrapper that prompts biometric authentication before each 1Password CLI invocation.
$ op-gate read "op://Personal/GitHub/token"
# → Touch ID prompt appears
# → authenticates, then runs: op read "op://Personal/GitHub/token"
The 1Password CLI (op) with desktop app integration authenticates once per terminal session (10-minute window, auto-refreshing). After that, any process in the same session can read any secret silently.
op-gate adds a Touch ID prompt before every op call. No secret is read without your fingerprint.
op-gate is a signed macOS .app bundle (required for biometric entitlements) that:
- Prompts Touch ID via
LocalAuthentication - On success, runs
opwith your arguments andOP_CACHE=false - Passes through stdin, stdout, stderr, and the exit code
It's a transparent wrapper — use it exactly like op.
- macOS 13+
- 1Password CLI (
op) installed - Swift toolchain (Xcode or Xcode Command Line Tools)
git clone https://github.com/youruser/op-gate.git
cd op-gate
scripts/install.shThis builds a release binary, packages it into a signed .app bundle, copies it to ~/Applications/op-gate.app, and symlinks the binary to ~/.local/bin/op-gate.
Make sure ~/.local/bin is in your PATH:
# Add to your .zshrc or .bashrc
export PATH="$HOME/.local/bin:$PATH"Same interface as op, just prefixed with op-gate:
# Read a secret
op-gate read "op://Personal/GitHub/token"
# Get a field from an item
op-gate item get MyServer --fields password
# Any op command works
op-gate item list --vault PersonalTo gate all op usage behind Touch ID:
alias op="op-gate"# Build + bundle only (no install)
scripts/bundle.sh
# Binary ends up at:
.build/op-gate.app/Contents/MacOS/op-gateA plain CLI binary can't access Touch ID — macOS requires an .app bundle with entitlements for biometric prompts via LocalAuthentication. op-gate uses ad-hoc signing (codesign --sign -) with hardened runtime, which works for personal use without an Apple Developer account.
For distribution to others, you'd need to sign with a Developer ID and notarize.
├── Package.swift # Swift Package Manager manifest
├── Sources/op-gate/
│ └── op_gate.swift # All the code (~100 lines)
├── Info.plist # App bundle metadata
├── entitlements.plist # Codesigning entitlements
└── scripts/
├── bundle.sh # Build + package + codesign
└── install.sh # bundle.sh + copy to ~/Applications + symlink
MIT