env-from-1password
Copy environment variables from 1Password to .env.local. Use when user says "load env from 1password", "copy env from 1password", "get env from 1password", or "1password env".
What this skill does
# Load Environment Variables from 1Password
Fetches environment variables from a 1Password item and writes them to `.env.local` in the current project.
## Prerequisites
1. **1Password desktop app installed** (download from 1password.com)
2. **1Password CLI installed**:
```bash
brew install --cask 1password-cli
```
3. **Enable desktop app integration**:
- Open 1Password app → Settings → Developer
- Enable "Connect with 1Password CLI"
- **Restart the 1Password app** after enabling (important!)
- This allows the CLI to use your existing 1Password session
4. **Verify CLI access**:
```bash
op whoami
```
Should show your account details if integration is working.
**Troubleshooting**: If you see "couldn't connect to desktop app":
- Make sure 1Password app is running
- Restart the 1Password app
- Update to latest version if needed
5. **Environment variables stored in 1Password** as a Secure Note with the env vars in the notes field
## How It Works
1. **Check for multiple accounts** (if user has more than one):
```bash
op account list
```
If multiple accounts exist, you'll need to specify `--account` flag in subsequent commands.
2. **List available 1Password items** to help user identify the right one:
```bash
# Single account:
op item list | grep -i "env"
# Multiple accounts (specify which one):
op item list --account=my.1password.com | grep -i "env"
```
3. **Ask the user** which item contains their environment variables (by name or ID)
3. **Fetch the item** and extract fields:
```bash
op item get "$ITEM_NAME" --format=json
```
4. **Parse fields** and write to `.env.local`:
- For Secure Notes: Extract from `fields` array where `type` is not `CONCEALED` (skip password fields)
- For each field: `label=value` format
- Common patterns:
- Field with `label` and `value` properties
- Sections with multiple fields
- Handle notesPlain for multi-line env content
5. **Write to `.env.local`**:
```bash
# From notes field (recommended - simpler format)
op item get "$ITEM_NAME" --account=ACCOUNT_NAME --fields label=notesPlain | tr -d '"' > .env.local
```
Or for structured fields:
```bash
op item get "$ITEM_NAME" --account=ACCOUNT_NAME --format=json | jq -r '.fields[] | select(.value != null) | "\(.label)=\(.value)"' > .env.local
```
**Note**: The `tr -d '"'` removes surrounding quotes that `op` adds to field values.
## Example Workflow
```bash
# 1. Check if you have multiple accounts
op account list
# 2. List items to find the right one
op item list --account=my.1password.com | grep -i "env"
# 3. Get env vars from 1Password (from notes field - recommended)
op item get "Dev Environment" --account=my.1password.com --fields label=notesPlain | tr -d '"' > .env.local
# 4. Confirm
cat .env.local
```
## 1Password Item Format
### Option 1: Secure Note with plain text
Store all env vars in the notes field:
```
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/mydb
REDIS_URL=redis://localhost:6379
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_APP_URL=http://localhost:3000
```
### Option 2: Structured fields
Create fields for each env var:
- Field: DATABASE_URL, Value: postgresql://...
- Field: REDIS_URL, Value: redis://...
- Field: STRIPE_SECRET_KEY, Type: password/concealed, Value: sk_test_...
## What This Creates
- `.env.local` file with all environment variables from 1Password
- Preserves formatting and comments if using notes field
- Filters out non-value fields if using structured format
## Available Keys
The following environment variables are available in 1Password:
| Variable | Purpose |
|---|---|
| `FAL_KEY` | Fal.ai media generation API |
| `AI_GATEWAY_API_KEY` | AI Gateway routing |
| `EXA_API_KEY` | Exa search API |
| `BLOB_READ_WRITE_TOKEN` | Vercel Blob storage |
| `RESEND_API_KEY` | Resend email API |
| `NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY` | Liveblocks client-side key |
| `LIVEBLOCKS_SECRET_KEY` | Liveblocks server-side key |
| `REPLICATE_API_TOKEN` | Replicate AI models |
| `BETTER_AUTH_SECRET` | Better Auth session signing |
| `PAYLOAD_SECRET` | Payload CMS secret |
| `STRIPE_SECRET_KEY` | Stripe payments |
## Security Notes
- `.env.local` should be in `.gitignore` (Next.js does this by default)
- Never commit `.env.local` to version control
- Rotate secrets if accidentally committed
- Use separate 1Password items for different environments (dev/staging/prod)
## Next Steps
After loading env vars:
1. **Review the file**:
```bash
cat .env.local
```
2. **Add any project-specific overrides** manually
3. **Run the app**:
```bash
bun dev
```
## Tips
- **Multiple environments**: Create separate 1Password items for dev/staging/prod
- **Team sharing**: Share the 1Password vault with your team
- **Updates**: Re-run this skill to refresh `.env.local` when secrets change
- **Validation**: Use with `/env-config` skill for type-safe env validation
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.