claude-code-1password-skill
Health Warn
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Pass
- Code scan — Scanned 6 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Claude Code skill for 1Password secrets management — store, read, and inject API keys and credentials using the op CLI
Claude Code 1Password Skill
A Claude Code skill that integrates 1Password secrets management into AI-assisted developer workflows.
Stop hardcoding API keys. Stop copying secrets from browser to terminal. Let 1Password and Claude handle it.
What it does
- Store API keys, tokens, and credentials in 1Password from the Claude Code chat
- Read secrets via
op://references - secrets never touch disk or shell history - Generate
.env.tplfiles with secret references (safe to commit) from any 1Password item - Rotate credentials in one command, then re-inject everywhere
- Integrate with Claude Desktop, n8n, Docker, GitHub Actions, Python, Supabase, and Replit
Install
Clone into your Claude Code skills directory:
git clone https://github.com/kcmadden/claude-code-1password-skill.git \
~/.claude/skills/1password
Or if you already have it, pull the latest:
cd ~/.claude/skills/1password && git pull
Then restart Claude Code (or start a new session).
Requirements:
- Platform: macOS (the Terminal-launch secret-entry flow uses AppleScript; the
opcommands are cross-platform) - 1Password CLI v2+ (
op) - Signed in:
op signin
Want more? 1Password Pro adds leak-guard hooks that block commands which would print a secret and hide any key that shows up in Claude's output, a credential registry agent that maps each project's env vars to 1Password items, and one-command clipboard capture. Coming soon to Agensi.
Usage
Once installed, Claude Code automatically loads this skill when you ask about 1Password. Just talk to it:
"Store my Anthropic API key in 1Password"
"Generate a .env.tpl for my project from the 'Dev Credentials' item"
"Read my Supabase service key into this script"
"Set up my Claude Desktop MCP config to use 1Password for secrets"
"Rotate my n8n API key and update 1Password"
What's included
Scripts
| Script | Purpose |
|---|---|
check_setup.sh |
Verify op CLI is installed and authenticated |
store_secret.sh |
Create or update a secret, outputs the op:// reference |
env_from_op.sh |
Generate .env.tpl (references) or .env (resolved) from any 1Password item |
References (loaded on demand, no context bloat)
| File | Contents |
|---|---|
op_commands.md |
Full CLI command reference with accurate flags |
secret_references.md |
op:// syntax, safe injection patterns, what to avoid |
integrations.md |
Claude Desktop, n8n, Docker, GitHub Actions, Python, Supabase, Replit |
Core pattern
# 1. Store your secret
bash scripts/store_secret.sh --title "Anthropic" --field api_key --value "sk-..."
# -> op://Dev/Anthropic/api_key
# 2. Reference it in .env.tpl (commit this)
echo "ANTHROPIC_API_KEY=op://Dev/Anthropic/api_key" >> .env.tpl
echo ".env" >> .gitignore
# 3. Use it
op run --env-file=.env.tpl -- your-command
Security model
This skill follows a security-first approach:
Safe patterns (recommended):
op run --env-file=.env.tpl -- your-command # secrets stay in subprocess
export KEY=$(op read "op://vault/item/field") # single secret into variable
Patterns to avoid:
source <(op run --env-file=.env.tpl -- env) # unsafe - shell metacharacters in values execute as code
eval $(op run ... env) # same risk
Rules built into this skill:
- Never hardcode secrets - always use
op://references - Commit
.env.tpl(references only), never.env(real values) - Always add
.envto.gitignore - Use vaults to scope access by project or team
- Use service accounts for CI/CD - never personal tokens in automation
Example: Claude Desktop with 1Password
Keep your MCP server API keys in 1Password instead of plaintext in claude_desktop_config.json:
{
"mcpServers": {
"my-server": {
"command": "op",
"args": ["run", "--", "node", "/path/to/server.js"],
"env": {
"API_KEY": "op://Dev/My MCP Server/api_key"
}
}
}
}
Claude Desktop runs op run which resolves the reference at startup. Your actual key never appears in the config file.
Example: Your dev environment
# .env.tpl (commit this)
ANTHROPIC_API_KEY=op://Dev/Anthropic/api_key
SUPABASE_SERVICE_KEY=op://Dev/Supabase/service_key
N8N_API_KEY=op://Dev/n8n/api_key
# Start Claude Code with secrets injected
op run --env-file=.env.tpl -- claude
Contributing
Issues and PRs welcome. If you add integration patterns for other tools, open a PR against references/integrations.md.
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found