home / skills / aidotnet / moyucode / env-manager

env-manager skill

/skills/tools/env-manager

This skill helps you manage environment variables and .env files with validation, encryption, and template generation for safer configurations.

npx playbooks add skill aidotnet/moyucode --skill env-manager

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.0 KB
---
name: env-manager
description: 管理环境变量和.env文件,支持验证、加密和模板生成。
metadata:
  short-description: 管理.env文件
source:
  repository: https://github.com/theskumar/python-dotenv
  license: BSD-3-Clause
---

# Environment Manager Tool

## Description
Manage environment variables and .env files with validation, encryption support, and template generation.

## Trigger
- `/env` command
- User needs to manage env vars
- User wants to work with .env files

## Usage

```bash
# List environment variables
python scripts/env_manager.py list

# Get specific variable
python scripts/env_manager.py get DATABASE_URL

# Set variable in .env
python scripts/env_manager.py set API_KEY "secret123" --file .env

# Generate .env.example
python scripts/env_manager.py template .env --output .env.example

# Validate .env file
python scripts/env_manager.py validate .env --required API_KEY,DB_URL
```

## Tags
`env`, `environment`, `dotenv`, `config`, `secrets`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill manages environment variables and .env files with validation, encryption support, and template generation. It provides command-style operations to list, get, set, validate, and generate example files so teams can standardize and secure configuration. The tool fits into CI/CD pipelines and local development workflows.

How this skill works

I inspect .env files and in-memory environment variables, supporting operations to read, write, and validate values against required keys and simple rules. The skill can encrypt and decrypt sensitive values, generate .env.example templates from an existing file, and run validation checks that report missing or malformed entries. Commands can target specific files or the current process environment.

When to use it

  • When you need to centralize and standardize project environment variables.
  • Before deployment to validate that required keys are present and formatted correctly.
  • When onboarding developers to provide a .env.example or template.
  • To encrypt secrets stored in .env files or to decrypt them at runtime.
  • When automating configuration management in CI/CD scripts.

Best practices

  • Keep secrets encrypted at rest and decrypt only at runtime or in trusted environments.
  • Commit only .env.example templates to version control, never actual .env with secrets.
  • Define a clear list of required keys and validation rules for each environment.
  • Integrate validation step into CI to fail builds when critical variables are missing.
  • Use consistent naming conventions and document default values in templates.

Example use cases

  • Generate a .env.example from an existing .env to share required keys with new contributors.
  • Validate a production .env file in CI to ensure API keys and URLs are present before deploy.
  • Encrypt API keys in a shared repository so developers must decrypt locally with a key.
  • Query a specific variable from a project .env during scripting or debugging.
  • Set or update a variable across multiple .env files when rotating credentials.

FAQ

Can I validate specific required keys only?

Yes — you can specify a comma-separated list of required keys for targeted validation.

Does the tool modify files in place?

Set operations update the target .env file by default; template generation writes to a specified output file.

How does encryption work?

The skill supports encrypting and decrypting individual values using a provided key so secrets remain unreadable at rest.