1password env
Skill kylebrodeur/1password-ssh-setup/packages/pi-1password/skills/1password-env
Complete system for managing SSH keys and secrets using 1Password CLI with Pi coding agent integration. Features Service Account authentication, cascading environments, and SSH agent keychain.
npx -y skills add kylebrodeur/1password-ssh-setup --skill 1password-envAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
1Password environment management for AI agents and development. Load secrets as environment variables from 1Password, supporting .env and .env.1pass formats. Use when configuring API keys, tokens, or secrets for AI models, CI/CD, or local development.
SKILL.md
5.5 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
1Password Environment Skill
Setup
Prerequisites
-
1Password CLI (
op)# macOS brew install 1password-cli # Linux/WSL # Download from: https://1password.com/downloads/command-line/ -
1Password Service Account (required for non-interactive use)
- Create at https://op.serviceaccounts.1password.com
- Add to
~/.zshrc:export OP_SERVICE_ACCOUNT_TOKEN="your-token"
-
Reload shell
source ~/.zshrc -
Verify authentication
op account list
Install to Pi (if using Pi coding agent)
# Copy extension to Pi
mkdir -p ~/.pi/agent/extensions
cp extensions/1password.ts ~/.pi/agent/extensions/
# Reload Pi
reload
Environment File Formats
.env (Standard format)
# Non-sensitive variables
KEY=value
API_KEY=your-api-key
# Or with 1Password references
OPENAI_API_KEY=op://Private/API-Keys/openai
.env.1pass (1Password references)
# Format: VAR="op://vault/item/field"
OPENAI_API_KEY="op://Private/API-Keys/openai"
DATABASE_URL="op://Work/Database/prod"
Supported Formats for AI Agents
# Google AI
GOOGLE_GENERATIVE_AI_API_KEY=op://Private/API-Keys/google-ai
# Anthropic
ANTHROPIC_API_KEY=op://Private/API-Keys/anthropic
# OpenAI
OPENAI_API_KEY=op://Private/API-Keys/openai
# GitHub
GITHUB_TOKEN=op://Personal/GitHub/token
Pi .env Support
Supported Locations
~/.pi/.env- Pi-level config (loaded first)~/.config/op-ssh/.env.1pass- User-level./.env.1pass- Project-level (overrides user)
Pi Commands
/op-status
Check 1Password authentication and loaded environment variables.
/op-env
Load project environment from ./.env.1pass.
- Arguments: optional file name (default:
.env.1pass) - Autocomplete:
.env.1pass,.env.local.1pass, etc.
/op-env-user
Load user-level environment from ~/.config/op-ssh/.env.1pass.
/op-get op://...
Get a specific secret and copy to OP_LAST_SECRET env var.
/op-create-env [filename]
Create a new project-level environment file with template.
Default: .env.1pass (if no filename provided)
Example:
/op-create-env # Creates ./.env.1pass
/op-create-env .env.local # Creates ./.env.local.1pass
/op-create-env .env.test # Creates ./.env.test.1pass
Template includes common API keys:
GITHUB_TOKENOPENAI_API_KEYANTHROPIC_API_KEY
/op-add-item VAR_NAME op://... [--global]
Add or update a 1Password secret reference in project or global env.
Project (default):
/op-add-item OPENAI_API_KEY op://Private/API-Keys/openai
/op-add-item DATABASE_URL op://Work/Database/prod
Global:
/op-add-item OPENAI_API_KEY op://Private/API-Keys/openai --global
Features:
- Auto-updates existing items automatically (no need to manually edit file first)
- Autocomplete shows vaults and items from
op item list - Smart matching by vault name or item name
/op-add-global-item VAR_NAME op://...
Similar to /op-add-item but specifically for global user env.
Examples:
/op-add-global-item OPENAI_API_KEY op://Private/API-Keys/openai
/op-add-global-item ANTHROPIC_API_KEY op://Private/API-Keys/anthropic
/op-list
List all loaded environment variables with their sources.
/op-config
Open the config directory and show user env file.
Setup Flow for New Project
# Step 1: Create project environment (defaults to .env.1pass)
/op-create-env
# Step 2: Add API keys easily (autocomplete helps find items)
/op-add-item OPENAI_API_KEY op://Private/API-Keys/openai
/op-add-item ANTHROPIC_API_KEY op://Private/API-Keys/anthropic
# Step 3: Load the environment
/op-env
# Step 4: Verify loaded variables
/op-status
/op-list
Global vs Project Environment
| Location | Purpose | Command |
|---|---|---|
~/.config/op-ssh/.env.1pass | Global (all projects) | /op-env-user, /op-add-global-item |
./.env.1pass | Project-specific | /op-env, /op-add-item |
Cascade Order:
~/.pi/.env(Pi-level)~/.config/op-ssh/.env.1pass(global)./.env.1pass(project, overrides global)
Environment Format
Both formats work in .env.1pass files:
# With export
OPENAI_API_KEY="op://Private/API-Keys/openai"
# Without export
OPENAI_API_KEY="op://Private/API-Keys/openai"
Both formats work in project env files:
# With export
DATABASE_URL="op://Work/Database/prod"
# Without export
DATABASE_URL="op://Work/Database/prod"
Troubleshooting
"Not signed in to 1Password"
Set OP_SERVICE_ACCOUNT_TOKEN in ~/.zshrc and reload.
Secrets not resolving
Check reference format: op://vault/item/field
Pi not loading extension
Restart Pi or run /reload in Pi command.
Item already exists
The commands automatically update existing items - just run them again with the new reference.
Autocomplete not showing items
Make sure op item list works and returns valid JSON. Run op login if needed.
Original Article
Based on: "Combining Keychain and 1Password CLI for ssh-agent management" by Bas Nijholt.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.