| name | 1password |
| description | Read secrets, credentials, and metadata from 1Password via the `op` CLI. Use when the user asks about passwords, API keys, secrets, credentials, login details, or needs to look up items stored in 1Password. Also use when setting up integrations that require secrets from 1Password. |
1Password CLI
Read secrets and credentials from 1Password using the op CLI. Requires the 1Password desktop app to be running and unlocked with CLI integration enabled.
Prerequisites
- 1Password desktop app installed, running, and unlocked
- CLI integration enabled: 1Password → Settings → Developer → "Integrate with 1Password CLI"
op CLI installed (brew install 1password-cli)
Operating Rules
- Never log, print, or expose secrets in chat, code, or files. Use
op read or op run to inject secrets at runtime.
- Prefer
op run / op inject over writing secrets to disk.
- Verify access first: run
op whoami before attempting any secret reads.
- If sign-in fails: ask the user to unlock the 1Password desktop app, then retry.
- Use secret references (
op://vault/item/field) instead of raw values wherever possible.
Quick Start
op --version
op whoami
op vault list
op item list --vault Personal
op item list --tags api-key
op item list | grep -i "github"
Reading Secrets
op read "op://Personal/GitHub/password"
op read "op://Personal/AWS/access key id"
op read "op://Personal/GitHub/one-time password?attribute=otp"
op read "op://Personal/ssh key/private key?ssh-format=openssh"
op read --out-file ./key.pem "op://Personal/server/ssh/key.pem"
Running Commands with Secrets
export DB_PASSWORD="op://app-prod/db/password"
op run -- printenv DB_PASSWORD
op run --env-file="./.env" -- ./start-server.sh
Injecting Secrets into Templates
echo "api_key: {{ op://Personal/API/key }}" | op inject
op inject -i config.yml.tpl -o config.yml
Item Management
op item get "GitHub" --vault Personal --format json
op item get "GitHub" --vault Personal --fields password
op item list --vault Personal --format json
op item list --tags dev --format json
Account Management
op account list
op signin --account my.1password.com
op whoami
References
references/get-started.md — Installation and desktop app integration setup
references/cli-examples.md — Complete op CLI command examples