1Password CLI
Use 1Password CLI safely for sign-in, secret references, env injection, and script-driven secret access without exposing secret material.
Standards snapshot (March 2026)
- Follow current 1Password CLI docs for exact command behavior instead of guessing flags or install steps.
- Prefer secret references,
op run, and op inject over copying secrets into files or shell history.
- Treat app sign-in state, shell session state, and tmux session state as explicit prerequisites.
- Keep automation and human flows separate: use service accounts or Environments for unattended use, not ad hoc interactive login hacks.
When to use
- Setting up or validating 1Password CLI.
- Reading secrets through secret references.
- Injecting secrets into env files, templates, or scripts.
- Running commands with secrets via
op run.
When not to use
- Managing secrets by copying plaintext values into source-controlled files.
- Doing generic credential management with no 1Password CLI or secret-reference workflow.
- Running
op directly in unstable shell contexts when tmux-backed sign-in is required.
Required inputs
- The secret-loading goal: sign-in, read, run, inject, or environment provisioning.
- OS and shell context.
- Account or vault context when multiple accounts are present.
- Any target files, templates, scripts, or env workflows involved.
Deliverables
- A safe 1Password CLI path for the requested flow.
- Exact prerequisites and verification steps.
- Relevant reference-file pointers for the chosen command family.
- If requested, a structured status report with a
schema_version field.
Philosophy
- Secrets should flow through references and runtime injection, not through copied plaintext.
- The safest working path is better than the shortest-looking command.
- Verification matters: if sign-in or secret resolution is not proven, the workflow is not ready.
Constraints
- Redact secrets, tokens, secret references containing sensitive identifiers, and account details by default.
- Do not paste secret values into chat, logs, shell history, code, or committed files.
- Do not run
op outside the required tmux session pattern when interactive sign-in stability matters.
- Prefer 1Password Environments or service accounts for automation rather than reusing human interactive auth.
Workflow
- Verify OS, shell, and CLI availability with
op --version.
- Confirm the desktop app integration or service-account path that fits the request.
- Start a fresh tmux session for interactive
op work when sign-in persistence matters.
- Verify
op signin and op whoami before attempting any secret read.
- Choose the right command family:
op run for env-backed command execution
op read for a single secret
op inject for templates or config files
op plugin run for shell-plugin-assisted flows
- Return the exact next steps and the reference file for that lane.
tmux requirement
When interactive sign-in is required, use a fresh tmux-backed session and keep all op commands inside it. This avoids re-prompts and broken auth state across short-lived shells.
Tooling and references
- Core references:
references/get-started.md
references/cli-examples.md
references/cli-reference.md
references/secret-references.md
references/secrets-environment-variables.md
references/secrets-scripts.md
references/environment-variables.md
references/best-practices.md
references/commands-run.md
references/commands-read.md
references/commands-inject.md
references/commands-signin.md
references/commands-whoami.md
references/contract.yaml
references/evals.yaml
- Use assets only when the task needs bundled 1Password support material from
assets/.
Validation
- Verify CLI availability.
- Verify sign-in state with
op whoami before secret access.
- Verify the selected secret-loading pattern matches the requested outcome.
- Fail fast at the first missing auth, vault, or session prerequisite.
Anti-patterns
- Running
op commands in arbitrary short-lived shells after interactive sign-in.
- Writing resolved secrets to disk when
op run or op inject would avoid it.
- Mixing human interactive auth with unattended automation requirements.
- Treating missing sign-in or account context as a minor warning.
Examples
- Help me use
op run with this .env template.
- Verify my 1Password CLI setup and tell me why
op whoami fails.
- Show the safest way to inject secret references into this config file.
See Also
| Skill |
When to use together |
| [[security-best-practices]] |
Apply secret management best practices alongside 1Password |
| [[create-auth]] |
Inject credentials into authentication flows via 1Password |
| [[cloudflare-deploy]] |
Inject secrets into Cloudflare deployments via op run |
| [[workers-mcp]] |
Secure MCP server secrets with 1Password injection |
| [[bootstrap]] |
Provision dev environment secrets via 1Password during bootstrap |
Topic map: [[security-ops]]
Remember
If the workflow would expose a secret unnecessarily, it is the wrong workflow.
Gotchas
- None yet. Capture recurring failures here as symptom -> cause -> do instead -> check.
Failure mode
- If 1Password auth, vault access, or secret references cannot be verified, stop, report the failing check, and fall back to auth/session repair before attempting secret operations.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: 1password-113description: Plan, validate, and use 1Password CLI setup for secret injection and auth. Use when tasks need 1Password CLI usage, secret references, op run/read/inject, or provisioning secrets via env vars/.env files and scripts. Use when this capability is needed.4---56# 1Password CLI78Use 1Password CLI safely for sign-in, secret references, env injection, and script-driven secret access without exposing secret material.910## Standards snapshot (March 2026)11- Follow current 1Password CLI docs for exact command behavior instead of guessing flags or install steps.12- Prefer secret references, `op run`, and `op inject` over copying secrets into files or shell history.13- Treat app sign-in state, shell session state, and tmux session state as explicit prerequisites.14- Keep automation and human flows separate: use service accounts or Environments for unattended use, not ad hoc interactive login hacks.1516## When to use17- Setting up or validating 1Password CLI.18- Reading secrets through secret references.19- Injecting secrets into env files, templates, or scripts.20- Running commands with secrets via `op run`.2122## When not to use23- Managing secrets by copying plaintext values into source-controlled files.24- Doing generic credential management with no 1Password CLI or secret-reference workflow.25- Running `op` directly in unstable shell contexts when tmux-backed sign-in is required.2627## Required inputs28- The secret-loading goal: sign-in, read, run, inject, or environment provisioning.29- OS and shell context.30- Account or vault context when multiple accounts are present.31- Any target files, templates, scripts, or env workflows involved.3233## Deliverables34- A safe 1Password CLI path for the requested flow.35- Exact prerequisites and verification steps.36- Relevant reference-file pointers for the chosen command family.37- If requested, a structured status report with a `schema_version` field.3839## Philosophy40- Secrets should flow through references and runtime injection, not through copied plaintext.41- The safest working path is better than the shortest-looking command.42- Verification matters: if sign-in or secret resolution is not proven, the workflow is not ready.4344## Constraints45- Redact secrets, tokens, secret references containing sensitive identifiers, and account details by default.46- Do not paste secret values into chat, logs, shell history, code, or committed files.47- Do not run `op` outside the required tmux session pattern when interactive sign-in stability matters.48- Prefer 1Password Environments or service accounts for automation rather than reusing human interactive auth.4950## Workflow511. Verify OS, shell, and CLI availability with `op --version`.522. Confirm the desktop app integration or service-account path that fits the request.533. Start a fresh tmux session for interactive `op` work when sign-in persistence matters.544. Verify `op signin` and `op whoami` before attempting any secret read.555. Choose the right command family:56 - `op run` for env-backed command execution57 - `op read` for a single secret58 - `op inject` for templates or config files59 - `op plugin run` for shell-plugin-assisted flows606. Return the exact next steps and the reference file for that lane.6162## tmux requirement63When interactive sign-in is required, use a fresh tmux-backed session and keep all `op` commands inside it. This avoids re-prompts and broken auth state across short-lived shells.6465## Tooling and references66- Core references:67 - `references/get-started.md`68 - `references/cli-examples.md`69 - `references/cli-reference.md`70 - `references/secret-references.md`71 - `references/secrets-environment-variables.md`72 - `references/secrets-scripts.md`73 - `references/environment-variables.md`74 - `references/best-practices.md`75 - `references/commands-run.md`76 - `references/commands-read.md`77 - `references/commands-inject.md`78 - `references/commands-signin.md`79 - `references/commands-whoami.md`80 - `references/contract.yaml`81 - `references/evals.yaml`82- Use assets only when the task needs bundled 1Password support material from `assets/`.8384## Validation85- Verify CLI availability.86- Verify sign-in state with `op whoami` before secret access.87- Verify the selected secret-loading pattern matches the requested outcome.88- Fail fast at the first missing auth, vault, or session prerequisite.8990## Anti-patterns91- Running `op` commands in arbitrary short-lived shells after interactive sign-in.92- Writing resolved secrets to disk when `op run` or `op inject` would avoid it.93- Mixing human interactive auth with unattended automation requirements.94- Treating missing sign-in or account context as a minor warning.9596## Examples97- Help me use `op run` with this `.env` template.98- Verify my 1Password CLI setup and tell me why `op whoami` fails.99- Show the safest way to inject secret references into this config file.100101## See Also102103| Skill | When to use together |104|---|---|105| [[security-best-practices]] | Apply secret management best practices alongside 1Password |106| [[create-auth]] | Inject credentials into authentication flows via 1Password |107| [[cloudflare-deploy]] | Inject secrets into Cloudflare deployments via op run |108| [[workers-mcp]] | Secure MCP server secrets with 1Password injection |109| [[bootstrap]] | Provision dev environment secrets via 1Password during bootstrap |110111**Topic map:** [[security-ops]]112113## Remember114If the workflow would expose a secret unnecessarily, it is the wrong workflow.115116## Gotchas117- None yet. Capture recurring failures here as symptom -> cause -> do instead -> check.118119## Failure mode120- If 1Password auth, vault access, or secret references cannot be verified, stop, report the failing check, and fall back to auth/session repair before attempting secret operations.121122---123> Converted and distributed by [TomeVault](https://tomevault.io/claim/jscraik) — claim your Tome and manage your conversions.124<!-- tomevault:4.0:skill_md:2026-04-11 -->