intermediate2 minutesevnx v0.2.0+

evnx add

Reference documentation for the evnx add command: subcommands, options, and incremental environment variable management.

evnx add — Command Reference

Append environment variables to existing .env.example and .env files using predefined services, frameworks, blueprints, or custom interactive input.


Command signature

Bash
evnx add <SUBCOMMAND> [OPTIONS]

Options reference

FlagTypeDefaultDescription
--path, -pstring.Target directory for .env files
--yes, -yboolfalseSkip confirmation prompts (non-interactive)
--verbose, -vboolfalseEnable debug output for resolution steps
--help, -hboolfalseDisplay help information

Subcommands (<target>)

SubcommandSyntaxDescriptionConflict Handling
serviceevnx add service <id>Add variables for infrastructure services (postgresql, redis, etc.)⚠️ Warns on conflicts
frameworkevnx add framework --language <lang> <id>Add framework-specific variables (django, nextjs, etc.)⚠️ Warns on conflicts
blueprintevnx add blueprint <id>Add pre-combined stack variables (t3_modern, fastapi_full, etc.)✅ Auto-skips conflicts
customevnx add customInteractive mode for manual variable entry⚠️ Warns on conflicts

Exit codes

CodeMeaningUse case
0✅ Variables appended successfullySuccess in scripts/CI
1🚨 Add failed (unknown service, resolution error)Fail pipeline on invalid input
2+⚠️ Runtime errors (IO, file permissions, parsing)Debug tooling or environment issues

Basic usage examples

Add a service

Bash
# Add PostgreSQL variables with confirmation prompt
evnx add service postgresql

# Skip prompt for CI/CD
evnx add service redis --yes

Add a framework

Bash
# Add Django variables (Python language required)
evnx add framework --language python django

# Add Next.js variables silently
evnx add framework --language typescript nextjs --yes

Add a blueprint

Bash
# Add T3 stack variables (conflicts auto-skipped)
evnx add blueprint t3_modern

# Preview without applying (combine with manual abort)
evnx add blueprint fastapi_full --verbose

Interactive custom variables

Bash
# Launch guided prompt for manual entry
evnx add custom

# Add custom vars non-interactively (requires pre-seeded input)
evnx add custom --yes

Target custom directory

Bash
# Add variables to ./backend config
evnx add service postgresql --path ./backend --yes

File modification behavior

FileActionNotes
.env.example✅ Appends new variablesPreserves existing content; adds section header
.env✅ Appends # TODO: placeholdersOnly if file exists; never overwrites real values
.gitignore⚪ No changesManaged by evnx init only

Section formatting

Added variables are grouped with markdown-style headers:

.env
# ── Service: postgresql ──
DATABASE_URL=postgres://localhost/db
DB_USER=your_username

Conflict handling modes

ModeTriggerBehavior
Warnservice, framework, customShows conflicting keys + values; user confirms before appending
SkipblueprintAuto-excludes conflicting variables; reports skipped count
PreserveAll modesExisting values in .env.example are never overwritten

💡 Conflict detection: A variable conflicts only if the key exists and the existing value differs from the schema's example placeholder.


Environment variables

VariableValuesDefaultDescription
NO_COLOR1, truefalseDisable colored terminal output
CI1, truefalseAuto-enable non-interactive defaults

See also