# 1password

> Manages secrets with the 1Password CLI (op): sign-in, item CRUD, op:// references, secret injection, and running processes with loaded secrets. Use when working with secret management, secret injection, api or when the user mentions secret management, secret injection, api.

- Skill: `opknock/1password` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/1password`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/1password/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/1password

---


Manages secrets with the 1Password CLI (op): sign-in, item CRUD, op:// references, secret injection, and running processes with loaded secrets.

## Agentic Workflow: Read -> Reason -> Act (1password)

You are **1Password** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — api context for `1password`
- Domain: Manages secrets with the 1Password CLI (op): sign-in, item CRUD, op:// references, secret injection, and running processes with loaded secrets.
- **secret-management**: Create, read, and update 1Password items programmatically. — `op signin --account my.1password.com`
- **secret-injection**: Reference secrets by URI and inject into files or process environments without printing them. — `op read op://vault/MyLogin/password`
- Check `knowledge` and `prerequisites: op`

### 2. Reason — think for `1password`
- For `secret-management`: Create, read, and update 1Password items programmatically. — decide which checks to run
- For `secret-injection`: Reference secrets by URI and inject into files or process environments without printing them. — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `1password` tools
- Tools: `Glob`, `Grep`, `Read`, `Op` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `1password:0db33e7b`

# 1Password

## What this skill does

Manages credentials with the 1Password CLI (op): sign-in flows, item CRUD, reading secrets by op:// reference, injecting secrets into templates or process environments, and shell plugins for third-party CLIs.

## When to use

- Fetching a stored password or API key for a script or deploy
- Creating vault items during automation
- Injecting secrets into .env files or process environments without echoing them

## Real commands

```bash
# Authenticate the CLI
op signin --account my.1password.com

# Create a login item
op item create --category=login --title=prod-db username=admin password=secret --vault=Infra

# Read a single field by reference
op read op://Infra/prod-db/password

# Inject into a template file
op inject -i template.env -o .env

# Run a process with secrets loaded, never printed
op run -- ./deploy.sh
```

## Template example

```env
DB_URL=op://Infra/prod-db/url
API_KEY=op://Infra/stripe/live-key
```

## Testing

- Verify items with `op item get <title> --fields username` after creation
- Test injection by running the target script with `op run` and checking it authenticates

## Best practices

- Never pipe `op read` output into logs; use `op run` when secrets must reach a subprocess
- Scope with `--account` and `--vault` in scripts to avoid ambiguity
- Use `--reveal` only on demand; output masks hidden fields by default
- Grant access via vault permissions, not shared passwords

## Capabilities

### secret-management
Create, read, and update 1Password items programmatically.

**Parameters:**
- `vault` (string): Vault to search or write into
- `fields` (string): Comma-separated field names to return
- `reveal` (boolean): Print hidden fields in plaintext

**Commands:**
- `op signin --account my.1password.com`
- `op item create --category=login --title=MyLogin username=me password=secret`
- `op item get MyLogin --fields username,password`
- `op item edit MyLogin --vault=Personal`
- `op item delete MyLogin --archive`

**Examples:**
- op item get MyLogin --fields password --reveal
- op item create --category=login --title=prod-db --url db.internal username=admin password=$(openssl rand -base64 24)
- op item list --vault=Infra --format=json

### secret-injection
Reference secrets by URI and inject into files or process environments without printing them.

**Parameters:**
- `input` (string): Template file containing op:// references
- `output` (string): Destination file for injected output
- `account` (string): 1Password account shorthand, e.g. my.1password.com

**Commands:**
- `op read op://vault/MyLogin/password`
- `op inject -i template.env -o .env`
- `op run --no-masking -- env`
- `op run -- ./deploy.sh`
- `op vault list`

**Examples:**
- op read op://Prod/db-credentials/password
- op inject -i deploy.tpl -o deploy.env
- op run -- npm run start:prod

## References
- [1Password CLI Reference](https://developer.1password.com/docs/cli/reference)
- [Secret References](https://developer.1password.com/docs/cli/secret-references)
- [Shell Plugins](https://developer.1password.com/docs/cli/shell-plugins)

