Commands

Complete reference for all 11 EnvMark CLI commands and options.

envmark init

Initialize EnvMark configuration. Sets up global config (remote, encryption) and local project config.

Examples
$ envmark init # Interactive setup
$ envmark init -y # Accept defaults
$ envmark init -r git@github.com:team/secrets.git # Specify remote
$ envmark init -g # Global config only
$ envmark init -l -p my-app # Local config only

Options

-g, --global Initialize global configuration only
-l, --local Initialize local project configuration only
-r, --remote <url> Git remote URL for secrets repository
-p, --project <name> Project name
-e, --env <env> Default environment (default: development)
-y, --yes Accept defaults without prompts
envmark push [env]

Push the local .env file to the repository. If no environment is specified, uses the default from config.

Examples
$ envmark push # Push to default environment
$ envmark push dev # Push to development
$ envmark push staging -m "Add API key" # Custom message
$ envmark push prod --force # Force push even if no changes

Options

-m, --message <msg> Custom commit message
-f, --force Force push even if no changes detected
envmark pull [env]

Pull the .env file from the repository. If no environment is specified, uses the default from config.

Examples
$ envmark pull # Pull from default environment
$ envmark pull dev # Pull from development
$ envmark pull prod -f # Force overwrite local
$ envmark pull staging -o .env.staging # Output to different file

Options

-f, --force Overwrite local .env without confirmation
-o, --output <path> Output to a different file
envmark create <env>

Create a new environment (Git branch) in the secrets repository.

Examples
$ envmark create qa # Create QA environment from main
$ envmark create feature-x -b dev # Create from development

Options

-b, --base <branch> Base branch to create from (default: main)
envmark list alias: envmark ls

List all available environments (branches) in the secrets repository.

Example Output
$ envmark list
📦 Environments
──────────────────────────────────────
Remote: git@github.com:team/secrets.git
production (branch: main)
development ★ default
staging
qa
4 environment(s)

Options

-v, --verbose Show more details
envmark status

Show current EnvMark configuration and status.

Example Output
$ envmark status
📦 EnvMark Status
──────────────────────────────────────
Configuration
ℹ Global:
Config file: ~/.envmark/config.json
Remote: git@github.com:team/secrets.git
Default env: development
Encryption: disabled
ℹ Project:
Config file: .envmark.json
Project name: my-app
Local .env: exists
envmark diff <env1> <env2>

Compare .env files between two environments. Shows keys only in one environment and keys with different values.

Examples
$ envmark diff dev prod # Compare dev vs production
$ envmark diff staging qa -k # Keys only, hide values
Example Output
$ envmark diff dev prod
✗ Only in dev:
- DEBUG_MODE=tr****ue
✓ Only in prod:
+ SENTRY_DSN=ht****om
~ Different values:
~ DATABASE_URL
dev: po****27
prod: po****01
Summary:
• Only in dev: 1
• Only in prod: 1
• Different values: 1
• Same: 15

Options

-k, --keys-only Only show key differences, not values
envmark history [env]

Show version history of the .env file for a specific environment.

Examples
$ envmark history # History for default environment
$ envmark history prod -n 20 # Show last 20 versions
Example Output
$ envmark history dev
Showing 3 most recent version(s):
a1b2c3d (latest)
• Jan 15, 2025 02:30 PM
• john@example.com
• Update my-app .env [2025-01-15 14:30:00]
e4f5g6h
• Jan 14, 2025 10:15 AM
• jane@example.com
• Add new API endpoint

Options

-n, --limit <number> Number of entries to show (default: 10)
envmark delete <target> alias: envmark rm

Delete an environment (branch) or a project's .env file from specific environments.

Examples
$ envmark delete qa # Delete QA environment
$ envmark delete qa --env # Explicitly delete environment
$ envmark delete project --project-env dev # Delete project .env from dev
$ envmark rm feature-x -f # Force delete without confirmation

Options

--env Delete the environment (branch)
--project-env <env> Delete project .env from specific environment
-f, --force Skip confirmation
envmark rollback [env]

Rollback the .env file to a previous version.

Examples
$ envmark rollback dev # Rollback 1 version
$ envmark rollback prod -n 3 # Rollback 3 versions
$ envmark rollback dev -v a1b2c3d # Rollback to specific commit
$ envmark rollback dev --local # Only update local, don't push

Options

-v, --version <hash> Commit hash to rollback to
-n, --steps <number> Number of versions to go back (default: 1)
--local Only update local .env, do not push
-f, --force Skip confirmation
envmark keygen

Generate or manage encryption keys for AES-256-GCM encryption.

Examples
$ envmark keygen # Generate new key
$ envmark keygen -s # Show current key
$ envmark keygen -d # Delete key
$ envmark keygen -p other-project # Key for different project

Options

-s, --show Show current key (if exists)
-d, --delete Delete the key
-f, --force Force regenerate without confirmation
-p, --project <name> Project name (defaults to current project)