storemyapi
CLI Reference

Environment Variables

Export keys as .env files or inject them into running processes.

Environment Variables

The storemyapi env commands let you work with your keys as environment variables — the format your code actually consumes.

Pull to .env file

storemyapi env pull [flags]

Downloads all keys for a project/environment and outputs them in .env format.

FlagShortDescription
--project <name>-pTarget project
--env <environment>-eTarget environment
--output <path>-oWrite to file instead of stdout
--overwriteOverwrite existing file without prompt

Examples:

# Print to stdout
storemyapi env pull -p my-saas-app -e production

# Write to file
storemyapi env pull -p my-saas-app -e production -o .env

# Write to a specific env file
storemyapi env pull -p my-saas-app -e staging -o .env.staging

Output format:

# Generated by storemyapi CLI
# Project: my-saas-app | Environment: production
# Pulled at: 2026-02-17T10:30:00Z
#
# WARNING: This file contains secrets. Do not commit to version control.

STRIPE_SECRET_KEY=sk_live_abc123...
DATABASE_URL=postgres://user:pass@host:5432/mydb
RESEND_API_KEY=re_abc123...
NEXT_PUBLIC_APP_URL=https://myapp.com

Push from .env file

storemyapi env push <file> [flags]

Imports keys from a local .env file into your vault.

FlagShortDescription
--project <name>-pTarget project
--env <environment>-eTarget environment
--overwriteOverwrite existing keys
--dry-runPreview changes without applying
--skip-existingSkip keys that already exist
# Import from .env file
storemyapi env push .env.local -p my-saas-app -e development

# Preview what would be imported
storemyapi env push .env.local -p my-saas-app --dry-run

# Only import new keys, skip existing
storemyapi env push .env -p my-saas-app --skip-existing

Run with injected environment

storemyapi env run [flags] -- <command>

Executes a command with all project keys injected as environment variables. Keys are never written to disk.

FlagShortDescription
--project <name>-pTarget project
--env <environment>-eTarget environment

Examples:

# Run Next.js dev server with secrets
storemyapi env run -p my-saas-app -e development -- npm run dev

# Run a one-off script
storemyapi env run -p my-saas-app -e production -- node scripts/migrate.js

# Run Docker container with secrets
storemyapi env run -p my-saas-app -e staging -- docker compose up

# Chain with other tools
storemyapi env run -p my-saas-app -e test -- npx vitest run

The injected variables are only available to the child process and its descendants. They do not pollute your shell session.

Diff environments

storemyapi env diff --from <env> --to <env> [flags]

Compare keys between two environments to catch missing or divergent values.

$ storemyapi env diff --from staging --to production -p my-saas-app

KEY                  STAGING          PRODUCTION
STRIPE_SECRET_KEY    sk_test_...      sk_live_...
DATABASE_URL set set (different)
NEW_FEATURE_FLAG set missing
LEGACY_KEY missing set

On this page