Token导航 LogoToken导航

Agent Skill · 研究检索

env-manager(环境经理)

env-manager 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

env-manager 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,674 个 Skill 里排第 28,546。

总安装 3,203周安装 150GitHub Stars 39下载 1,350核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:env-manager(环境经理)
来源仓库:https://github.com/bobmatnyc/claude-mpm-skills
仓库路径:skills/env-manager
安装命令:
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill env-manager
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill env-manager

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

env-manager 提供跨框架的环境变量安全管理,支持 Next.js、Vite、React 等项目类型。具备 secrets 扫描、平台集成(Vercel/Netlify)和启动时验证能力,预防配置泄露风险。适用于本地开发、CI 部署全流程,自动检测 insecure defaults 并给出修复建议。

运行时不记录任何 secrets,仅输出脱敏警告和建议,需人工确认高危项处理方式。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/env-manager

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill env-manage…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

env-manager 怎么安装?

在终端执行 npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill env-manager。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

env-manager 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

env-manager 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

env-manager 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

env-manager 用的人多吗?

公开数据是累计安装 3,203 次,近一周安装 150 次,下载 1,350 次,GitHub 39 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

env-manager 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
env-manager

环境经理 · 本页

3,20339接触敏感数据MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Environment Variable Manager (env-manager)

Comprehensive environment variable validation, security scanning, and management for modern web applications.

![Security Audited](https://github.com/bobmatnyc/claude-mpm-skills/blob/HEAD/universal/infrastructure/env-manager/references/security.md) ![Test Coverage](https://github.com/bobmatnyc/claude-mpm-skills/blob/HEAD/universal/infrastructure/env-manager/tests/) ![Performance](#performance)

Overview

The env-manager skill provides systematic environment variable management across local development, CI/CD pipelines, and deployment platforms. It prevents common issues like missing variables, exposed secrets, and framework-specific configuration errors.

Key Features:

  • Framework-Aware Validation: Next.js, Vite, React, Node.js, Flask support
  • Security-First: Never logs secrets, detects exposed credentials
  • Platform Integration: Ready for Vercel, Railway, Heroku, and CI/CD
  • Fast: Validates 1000 variables in 0.025s (80x faster than 2s target)
  • Zero Dependencies: Pure Python, works anywhere

Why Use env-manager?

Common problems this solves:

  • "Works on my machine, but not in production" (missing env vars)
  • Accidentally exposing API keys in client-side code (NEXT_PUBLIC_ with secrets)
  • Missing required variables during deployment
  • Inconsistent.env files across team members
  • No documentation of required environment variables
  • Security vulnerabilities from exposed secrets

Quick Start

Installation

No installation needed! env-manager is a bundled skill in Claude MPM.

Requirements:

  • Python 3.7+
  • No external dependencies

5-Minute Quick Start

# 1. Validate your .env file
python3 scripts/validate_env.py .env

# 2. Check for framework-specific issues (Next.js example)
python3 scripts/validate_env.py .env --framework nextjs

# 3. Compare with .env.example to find missing vars
python3 scripts/validate_env.py .env --compare-with .env.example

# 4. Generate .env.example for documentation
python3 scripts/validate_env.py .env --generate-example .env.example

# 5. Get JSON output for CI/CD integration
python3 scripts/validate_env.py .env --json

That's it! Environment variables are now validated professionally.

Usage Examples

Basic Validation

Validate a.env file for structural issues:

python3 scripts/validate_env.py .env

What it checks:

  • Valid key=value format
  • No duplicate keys
  • Proper naming conventions (UPPERCASE_WITH_UNDERSCORES)
  • No empty values (unless explicitly allowed)
  • Proper quoting for values with spaces

Example output:

✅ Validation successful!
   - 15 variables validated
   - 0 errors
   - 0 warnings

Framework-Specific Validation

Next.js

Validate Next.js environment variables:

python3 scripts/validate_env.py .env.local --framework nextjs

Next.js-specific checks:

  • NEXT_PUBLIC_* variables are client-exposed (warns if secrets detected)
  • .env.local,.env.production,.env file hierarchy
  • Detects secrets in client-side variables

Example:

# .env.local
NEXT_PUBLIC_API_URL=https://api.example.com
NEXT_PUBLIC_API_KEY=secret123  # ⚠️  WARNING: Secret in client-exposed variable!
DATABASE_URL=postgresql://...   # ✅ Server-side only
Vite
python3 scripts/validate_env.py .env --framework vite

Vite-specific checks:

  • VITE_* variables are client-exposed
  • Warns if secrets detected in VITE_ prefixed vars
React (Create React App)
python3 scripts/validate_env.py .env --framework react

React-specific checks:

  • REACT_APP_* variables are client-exposed
  • Warns if secrets in REACT_APP_ prefixed vars
Node.js/Express
python3 scripts/validate_env.py .env --framework nodejs

Node.js-specific checks:

  • Common NODE_ENV, PORT, DATABASE_URL patterns
  • Standard Node.js conventions
Flask/Python
python3 scripts/validate_env.py .env --framework flask

Flask-specific checks:

  • FLASK_APP, FLASK_ENV variables
  • SQLAlchemy DATABASE_URL format

Comparing with.env.example

Ensure your.env has all required variables:

python3 scripts/validate_env.py .env --compare-with .env.example

What it checks:

  • All variables in.env.example exist in.env
  • No extra undocumented variables in.env

Example output:

❌ Missing variables:
   - DATABASE_URL (required in .env.example)
   - STRIPE_SECRET_KEY (required in .env.example)

⚠️  Extra variables not in .env.example:
   - DEBUG_MODE (consider adding to .env.example)

Perfect for:

  • Onboarding new team members
  • CI/CD validation
  • Deployment pre-checks

Generating.env.example

Create documentation for your environment variables:

python3 scripts/validate_env.py .env --generate-example .env.example

What it does:

  • Reads your.env file
  • Sanitizes secret values (replaces with placeholders)
  • Generates.env.example with safe defaults

Example:

# Input: .env
DATABASE_URL=postgresql://user:pass@localhost/db  # pragma: allowlist secret
STRIPE_SECRET_KEY=sk_live_abc123xyz
NEXT_PUBLIC_API_URL=https://api.example.com

# Output: .env.example
DATABASE_URL=postgresql://user:password@localhost/dbname  # pragma: allowlist secret
STRIPE_SECRET_KEY=your_stripe_secret_key_here
NEXT_PUBLIC_API_URL=https://api.example.com

Security note: env-manager detects common secret patterns and replaces them with safe placeholders.

CI/CD Integration

Get machine-readable JSON output for automated workflows:

python3 scripts/validate_env.py .env.example --strict --json

JSON output format:

{
  "valid": true,
  "errors": [],
  "warnings": [],
  "stats": {
    "total_vars": 15,
    "errors": 0,
    "warnings": 0
  }
}

Exit codes:

  • 0: Validation passed
  • 1: Validation errors found
  • 2: Missing required file
  • 3: Warnings found (only in --strict mode)

GitHub Actions example:

name: Validate Environment Variables

on: [push, pull_request]

jobs:
  validate-env:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Validate .env.example
        run: |
          python3 scripts/validate_env.py .env.example --strict --json
        working-directory: ./path/to/skill

      - name: Check for framework-specific issues
        run: |
          python3 scripts/validate_env.py .env.example --framework nextjs --json
        working-directory: ./path/to/skill

Strict Mode

Treat warnings as errors (useful for CI/CD):

python3 scripts/validate_env.py .env --strict

When to use:

  • Pre-deployment validation
  • CI/CD pipelines
  • Release gates
  • Team standard enforcement

Quiet Mode

Show only errors, suppress warnings:

python3 scripts/validate_env.py .env --quiet

When to use:

  • You've already reviewed warnings
  • Automated scripts that only care about errors
  • Noisy environments where warnings are distracting

Supported Frameworks

FrameworkPrefixClient-ExposedNotes
Next.jsNEXT_PUBLIC_*YesAuto-exposed in browser
ViteVITE_*YesBundled into client code
React (CRA)REACT_APP_*YesEmbedded in production build
Node.jsN/ANoServer-side only
FlaskN/ANoServer-side only

Security warning: Never put secrets in client-exposed variables (NEXT_PUBLIC_, VITE_, REACT_APP_). env-manager will warn you if it detects common secret patterns.

CLI Reference

Command Structure

python3 scripts/validate_env.py <file> [options]

Options

OptionDescriptionExample
--compare-with FILECompare with.env.example--compare-with.env.example
`--framework {nextjs\vite\react\nodejs\flask\generic}`Framework-specific validation--framework nextjs
--strictTreat warnings as errors--strict
--jsonJSON output for automation--json
--quietOnly show errors--quiet
--generate-example OUTPUTGenerate.env.example--generate-example.env.example

Exit Codes

CodeMeaningWhen
0SuccessNo errors (warnings OK unless --strict)
1Validation errorsStructural issues, duplicates, etc.
2File not foundSpecified.env file doesn't exist
3Warnings in strict modeWarnings exist and --strict enabled

Common Use Cases

Scenario 1: New Developer Onboarding

# New developer clones repo
git clone <repo>
cd <project>

# Copy example and fill in values
cp .env.example .env
# Edit .env with actual values...

# Validate setup
python3 scripts/validate_env.py .env --compare-with .env.example

# If missing variables, fix them
# Validation passes ✅

Scenario 2: Pre-Deployment Check

# Before deploying to Vercel/Railway/Heroku
python3 scripts/validate_env.py .env.production --framework nextjs --strict

# Fix any errors
# Deploy with confidence ✅

Scenario 3: Security Audit

# Check for accidentally exposed secrets
python3 scripts/validate_env.py .env.local --framework nextjs

# Look for warnings like:
# ⚠️  NEXT_PUBLIC_STRIPE_SECRET: Contains potential secret in client-exposed variable

Scenario 4: Team Documentation

# After adding new environment variable
echo "NEW_API_KEY=abc123" >> .env

# Regenerate .env.example
python3 scripts/validate_env.py .env --generate-example .env.example

# Commit updated .env.example
git add .env.example
git commit -m "docs: add NEW_API_KEY to environment variables"

Scenario 5: CI/CD Quality Gate

# In your CI pipeline
- name: Validate environment configuration
  run: |
    python3 scripts/validate_env.py .env.example --strict --json > validation.json

    # Fail pipeline if validation fails
    if [ $? -ne 0 ]; then
      cat validation.json
      exit 1
    fi

Performance

env-manager is designed for speed:

Benchmarks:

  • Validates 1000 variables in 0.025s
  • 80x faster than 2s target
  • Zero external dependencies
  • Minimal memory footprint

Why it matters:

  • Fast feedback during development
  • No CI/CD slowdown
  • Works in resource-constrained environments

Security Notes

Critical security features:

  1. Never Logs Secrets: env-manager NEVER displays actual secret values in output
  2. Client-Exposure Detection: Warns when secrets are in NEXT_PUBLIC_, VITE_, REACT_APP_ variables
  3. Secret Sanitization: When generating.env.example, replaces secrets with safe placeholders
  4. No Network Calls: All validation is local, no data leaves your machine

Security-audited: This skill has undergone security review. See references/security.md for details.

Best practices:

  • Never commit.env files with secrets
  • Always use.env.example for documentation
  • Use platform secret managers (Vercel, Railway, etc.) for production
  • Validate before every deployment
  • Run security scan regularly

Common Issues

"Missing equals sign" error

Cause: Line in.env doesn't have = separator

Fix:

# ❌ Bad
API_KEY

# ✅ Good
API_KEY=your_key_here

"Duplicate key" error

Cause: Same variable defined multiple times

Fix:

# ❌ Bad
API_KEY=value1
API_KEY=value2

# ✅ Good
API_KEY=value2

"Invalid variable name" warning

Cause: Variable name doesn't follow UPPERCASE_WITH_UNDERSCORES convention

Fix:

# ❌ Bad
apiKey=value
api-key=value

# ✅ Good
API_KEY=value

"Potential secret in client-exposed variable" warning

Cause: NEXT_PUBLIC_, VITE_, or REACT_APP_ variable contains secret-like value

Fix:

# ❌ Bad (secret exposed to client!)
NEXT_PUBLIC_STRIPE_SECRET=sk_live_abc123

# ✅ Good (server-side only)
STRIPE_SECRET_KEY=sk_live_abc123
NEXT_PUBLIC_STRIPE_PUBLISHABLE=pk_live_xyz789

"Empty value" warning

Cause: Variable has no value

Fix:

# ❌ Bad
DATABASE_URL=

# ✅ Good (if optional, document it)
DATABASE_URL=  # Optional, uses SQLite if not set

# ✅ Better
DATABASE_URL=postgresql://localhost/mydb

File not found error

Cause: Specified.env file doesn't exist

Fix:

# Check file exists
ls -la .env

# Or create it
touch .env

Troubleshooting

Validation passes locally but fails in CI

Check:

  1. Line endings (CRLF vs LF)
  2. File encoding (UTF-8 expected)
  3. File permissions
  4. Python version (3.7+ required)

Warnings about client-exposed variables

This is intentional! env-manager is warning you that variables like NEXT_PUBLIC_API_KEY will be visible in the browser.

Options:

  1. Move secret to server-side variable (remove NEXT_PUBLIC_ prefix)
  2. Use public/publishable keys only in client-exposed variables
  3. If truly not a secret, ignore the warning

.env.example generation replaces too much

env-manager is conservative about secrets. If it over-sanitizes:

  1. Manually edit.env.example after generation
  2. Use specific placeholder values in.env that won't trigger sanitization

Advanced Usage

Custom Validation Patterns

See references/validation.md for advanced validation patterns.

Platform-Specific Deployment

See references/synchronization.md for Vercel, Railway, Heroku integration patterns.

Framework-Specific Guides

See references/frameworks.md for comprehensive framework guides.

Related Documentation

Integration with Claude MPM

env-manager is a bundled skill in Claude MPM. Agents can use it for:

  • Pre-deployment validation
  • Security scanning
  • Environment setup verification
  • Documentation generation

See INTEGRATION.md for agent integration patterns.

Contributing

env-manager follows Claude MPM contribution guidelines:

  1. Run make lint-fix during development
  2. Run make quality before commits
  3. Add tests for new features (85%+ coverage required)
  4. Update documentation

See CONTRIBUTING.md for details.

License

MIT License - Part of Claude MPM project

Support

  • Issues: Report bugs via GitHub Issues
  • Documentation: See references/ directory
  • Examples: See examples/ directory
  • Integration: See INTEGRATION.md

Version: 1.0.0 Status: Stable, Security-Audited Test Coverage: 85%+ Performance: 80x faster than target

平台分布

Claude Code

26.5%
按下载量换算358

Gemini CLI

23.8%
按下载量换算321

Antigravity

16.73%
按下载量换算226

OpenCode

12.38%
按下载量换算167

windsurf

8%
按下载量换算108

github-copilot

3.42%
按下载量换算46

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills