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.
| Flag | Short | Description |
|---|---|---|
--project <name> | -p | Target project |
--env <environment> | -e | Target environment |
--output <path> | -o | Write to file instead of stdout |
--overwrite | Overwrite 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.stagingOutput 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.comPush from .env file
storemyapi env push <file> [flags]Imports keys from a local .env file into your vault.
| Flag | Short | Description |
|---|---|---|
--project <name> | -p | Target project |
--env <environment> | -e | Target environment |
--overwrite | Overwrite existing keys | |
--dry-run | Preview changes without applying | |
--skip-existing | Skip 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-existingRun 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.
| Flag | Short | Description |
|---|---|---|
--project <name> | -p | Target project |
--env <environment> | -e | Target 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 runThe 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