env-sync

A command for checking and managing environment variables across development, staging, and production systems.

In plain words
What is it for?
Use it to check or compare .env files, create environment templates, encrypt sensitive values, and guide secret rotation.
Why use it?
It finds missing variables and configuration differences that can make software behave differently between environments.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alphaaiservice/cortex/env-sync
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,419 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00036 $0.04419
Opus 5 $0.00018 $0.02210
Sonnet 5 $0.00007 $0.00884
Haiku 4.5 $0.00004 $0.00442

Measured yesterday against content hash 5e8ad043e7ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

env-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/env-sync.md · 503 lines

How it starts

The opening of the file, as written. The whole thing — 503 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Environment Sync & Configuration Management

Action: $ARGUMENTS (default: check)

Parse $ARGUMENTS:

  • check — Audit all .env files for parity and missing variables
  • diff <env1> <env2> — Compare two environment files side by side
  • encrypt — Encrypt sensitive .env values using age/sops
  • rotate — Guide through secret rotation for all services
  • init — Generate .env.example and environment templates
  • No argument = check

Step 0: Discover Environment Files

echo "=== Environment Files ==="
find . -maxdepth 3 -name ".env*" -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/.venv/*" 2>/dev/null | sort

echo ""
echo "=== Git-tracked .env Files (DANGER) ==="
git ls-files | grep -i '\.env' 2>/dev/null || echo "None (good)"

echo ""
echo "=== .gitignore Coverage ==="
grep -n "env" .gitignore 2>/dev/null || echo "WARNING: No .env entries in .gitignore"

echo ""
echo "=== Docker Compose env_file References ==="
grep -rn "env_file" docker-compose*.yml docker/docker-compose*.yml 2>/dev/null | head -10

echo ""
echo "=== Kubernetes Secrets/ConfigMaps ==="
find . -maxdepth 4 -name "*.yaml" -o -name "*.yml" 2>/dev/null | xargs grep -l "kind: Secret\|kind: ConfigMap" 2>/dev/null | head -10

Build a map of all environment files and their purposes:

  • .env → Local development
  • .env.development → Development overrides
  • .env.staging → Staging environment
  • .env.production → Production environment
  • .env.test → Test environment
  • .env.example → Template (should be committed)

Step 1: Parse All Environment Files

For each .env* file found, parse into a structured map:

{
  "file": ".env",
  "variables": {
    "DATABASE_URL": { "value": "mysql://...", "has_value": true, "is_secret": true },
    "DEBUG": { "value": "true", "has_value": true, "is_secret": false },
    ...
  }
}

Secret detection heuristics — mark as is_secret: true if the variable name contains:

  • PASSWORD, PASSWD, PWD
  • SECRET, KEY (but not PUBLIC_KEY)
  • TOKEN (but not TOKEN_EXPIRY)
  • API_KEY, APIKEY
  • PRIVATE
  • CREDENTIALS, CRED
  • CONNECTION_STRING, DATABASE_URL, MONGO_URI, REDIS_URL

Read the full file on GitHub · 503 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 503 lines · 36 tokens per session scan A 5e8ad043e7ca

Subscribe to this mod's changes

env-sync is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 26d ago), licensed MIT. It adds 36 tokens to every session and 4,419 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.