Add Basics — Incrementally Build Your Environment
Learn how to use evnx add to incrementally add environment variables from services, frameworks, blueprints, or custom input. Perfect for beginners.
Prerequisites
Add Basics — Incrementally Build Your Environment
What you'll learn
In this tutorial, you'll learn how to use evnx add to:
- ›Add variables from predefined services (PostgreSQL, Redis)
- ›Include framework-specific variables (Django, Next.js)
- ›Use blueprints for complete stack setups
- ›Add custom variables interactively
- ›Avoid overwriting existing configuration
Before you start
What is add and why use it?
After initializing your project with evnx init, you'll often need to add more environment variables as your project evolves.
The add command lets you incrementally append variables to your .env.example file without overwriting what's already there.
# Start with a blank slate
evnx init --mode blank
# Later, add what you need
evnx add service postgresql
evnx add framework --language python djangoKey benefit
Unlike manual editing, evnx add provides:
- ›✅ Schema-validated variable names and examples
- ›✅ Automatic conflict detection
- ›✅ Consistent formatting with section headers
- ›✅ TODO placeholders in your real
.envfile
The four ways to add variables
1. Add a service (infrastructure)
Use when: You're adding a database, cache, or external service.
# See available services
evnx add service --help
# Add PostgreSQL variables
evnx add service postgresql
? Add these 5 variables to .env.example?
❯ Yes
✓ Added 5 variables for PostgreSQL
✓ Updated .env with TODO placeholdersResult in .env.example:
# ── Service: postgresql ──
DATABASE_URL=postgres://user:pass@localhost:5432/db
DB_USER=your_username
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=54322. Add a framework (language + framework)
Use when: You're adopting a new framework or adding framework-specific config.
# See available frameworks for Python
evnx add framework --language python --help
# Add Django variables
evnx add framework --language python django
✓ Added 8 variables for DjangoFramework syntax
Always specify --language <lang> before the framework name. Supported languages: python, javascript, typescript, ruby, go.
3. Add a blueprint (pre-combined stack)
Use when: You want a complete, tested variable set for a known stack.
# See available blueprints
evnx add blueprint --help
# Add T3 stack (Next.js + tRPC + Prisma + PostgreSQL)
evnx add blueprint t3_modern
⚠️ 2 conflicts detected
• DATABASE_URL (existing: "old_value", new: "postgres://...")
• NEXTAUTH_SECRET (existing: "xxx", new: "your_secret")
ℹ️ Conflicting variables will be SKIPPED (not overwritten)
? Add 12 new variables (skipping 2 conflicts)?
❯ Yes
✓ Added 12 variables from blueprint 'T3 Modern'
ℹ️ Skipped 2 conflicting variables (preserved existing values)Blueprints are safe
Blueprints automatically skip variables that already exist with different values. Your existing config is never overwritten.
4. Add custom variables (interactive)
Use when: You need variables not covered by schemas.
evnx add custom
Variable name (or Enter to finish): STRIPE_SECRET_KEY
Example/placeholder value: sk_test_xxx
Add a description comment? Yes
Description: Stripe API key for payments
Assign to a category? Yes
Select category: ▸ Auth
Is this variable required? Yes
Add another variable? No
📋 Preview:
• 1 variables to add
• Categories: Auth
? Append these variables to .env.example?
❯ Yes
✓ Added 1 custom variablesResult:
# ── Custom Variables ──
# [Auth] Stripe API key for payments
STRIPE_SECRET_KEY=sk_test_xxx
# (required)
# Added by evnx add custom on 2026-03-05 14:30Your first add: Step-by-step
Scenario: You just initialized a blank project
Step 1: Verify your starting point
ls -la .env*
# Output:
# -rw-r--r-- .env.example (empty or minimal)
# -rw-r--r-- .env (may not exist yet)Step 2: Add your first service
evnx add service postgresql --verbose
[DEBUG] Resolving service: postgresql
[DEBUG] Found 5 variables in schema
📋 Preview:
DATABASE_URL=postgres://user:pass@localhost:5432/db
DB_USER=your_username
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432
? Add these 5 variables to .env.example?
❯ Yes
✓ Appended 5 variables to .env.example
✓ Updated .env with TODO placeholdersStep 3: Check the results
cat .env.example
# ── Service: postgresql ──
DATABASE_URL=postgres://user:pass@localhost:5432/db
# ... more vars
cat .env
# TODO: DATABASE_URL=postgres://user:pass@localhost:5432/db # <-- Fill in real value
# ... more TODOsStep 4: Replace placeholders with real values
nano .env
# Edit each TODO line with your actual credentials
# Keep .env.example unchanged (it's your team template)Step 5: Validate your setup
evnx validate
✓ All required variables present
✓ No secrets detected in .env.example✅ Done! Your environment is configured.
Preview before applying changes
Use --verbose to see resolution details, and remember that all subcommands show a preview before applying (unless you use --yes).
# See what would be added without committing
evnx add service redis --verbose
[DEBUG] Resolving service: redis
[DEBUG] Found 4 variables in schema
📋 Preview:
REDIS_URL=redis://localhost:6379
REDIS_PASSWORD=your_password
# ...
# Press Ctrl+C to abort, or confirm to proceedNon-interactive mode
Use --yes or -y to skip prompts in CI/CD:
evnx add service postgresql --yes --path ./backendAlways test with --verbose first to ensure the output is what you expect.
Common pitfalls to avoid
Assuming variables are overwritten
# ❌ Wrong expectation:
# If DATABASE_URL exists, it gets replaced
# ✅ Reality:
# Existing values are ALWAYS preserved
# New variables are appended with section headersAdding real values to .env.example
When using add custom, the tool asks for an "example/placeholder value". Never enter real credentials here.
# ❌ Bad:
Example/placeholder value: sk_live_abc123xyz
# ✅ Good:
Example/placeholder value: YOUR_STRIPE_KEY_HEREForgetting to update .env after adding to .env.example
# After running:
evnx add service postgresql
# Don't forget:
# 1. Open .env
# 2. Replace TODO placeholders with real values
# 3. Set secure file permissions: chmod 600 .envIgnoring conflict warnings
# If you see:
⚠️ 3 conflicts detected
• VAR_NAME (existing: "old", new: "new")
# Review carefully! Conflicts mean:
# - The variable already exists in .env.example
# - The existing value differs from the schema default
# - The existing value will be KEPT, new value skipped
# If you need the new value, manually edit .env.example after syncNext steps
Now that you can add variables confidently:
- ›Sync Basics — Keep
.envand.env.examplein sync - ›Validate Command — Check your environment for issues
- ›Team Collaboration — Share templates safely with your team
- ›Schema Reference — Learn to extend services and frameworks
You're ready!
You now know how to incrementally build your environment configuration. Use evnx add to grow your .env.example safely, one variable at a time.