1pass-env
A focused CLI tool for importing environment variables from 1Password items. Quickly and securely import secrets from your 1Password vaults into environment files for your development workflow.
Features
- 🔐 Secure: Import secrets directly from 1Password using the official SDK
- 🚀 Simple: One command to import all your environment variables
- 🎯 Focused: Import exactly what you need with field filtering
- 📁 Smart: Automatically detects project names from folder structure
- 🔄 Safe: Confirms before overwriting existing files
Installation
pip install 1pass-envPrerequisites
- Python 3.8 or higher
- 1Password service account token
- Create one at: https://my.1password.com/developer-tools/infrastructure-secrets/serviceaccount
Quick Start
- Set up your 1Password service account token:
export OP_SERVICE_ACCOUNT_TOKEN="your-service-account-token"- Import all fields from a 1Password item:
1pass-env import --name my-app- Import specific fields only:
1pass-env import --name my-app --fields API_KEY,DATABASE_URL- Use with different vault and custom file:
1pass-env import --vault production-secrets --name my-app --file .env.prod