Install
openclaw skills install env-secrets-rotatorRotate and update secrets in environment files, generate Vault commands, and manage secret rotation workflows.
openclaw skills install env-secrets-rotatorA CLI tool to help rotate secrets in environment files and generate commands for secret managers like HashiCorp Vault. Securely generates new random values for secrets, updates .env files, and provides rotation workflows for development and production environments.
Key features:
./scripts/main.py rotate --file .env --keys API_KEY,DB_PASSWORD
./scripts/main.py rotate --file .env --keys API_KEY --algorithm base64 --length 32
./scripts/main.py rotate --file .env --keys "*" --dry-run
./scripts/main.py vault --keys API_KEY,DB_PASSWORD --path secret/data/myapp
./scripts/main.py help
rotate: Rotate secrets in environment files
--file: Path to .env file (required)--keys: Comma-separated keys to rotate, or "" for all (default: "")--algorithm: Random generation algorithm: hex, base64, uuid, alphanumeric (default: hex)--length: Length of generated secret (default: 32)--backup: Create backup before modifying (default: true)--dry-run: Preview changes without modifying files--output: Write to new file instead of modifying originalvault: Generate HashiCorp Vault commands
--keys: Comma-separated keys to generate commands for--path: Vault secret path (e.g., "secret/data/myapp")--engine: Vault secrets engine (default: "kv")--method: Vault method: patch, put (default: "patch")validate: Validate .env file
--file: Path to .env file--strict: Require all values to be non-emptyhistory: Show rotation history (if enabled)
--file: Path to .env file--key: Specific key to show history for{
"file": ".env",
"rotated": ["API_KEY", "DB_PASSWORD"],
"new_values": {
"API_KEY": "a1b2c3d4e5f6...",
"DB_PASSWORD": "x9y8z7w6v5u4..."
},
"backup": ".env.backup.20260311",
"vault_commands": [
"vault kv patch secret/data/myapp API_KEY=a1b2c3d4e5f6...",
"vault kv patch secret/data/myapp DB_PASSWORD=x9y8z7w6v5u4..."
]
}
# Generated Vault commands for secret rotation:
vault kv patch secret/data/myapp API_KEY=a1b2c3d4e5f6...
vault kv patch secret/data/myapp DB_PASSWORD=x9y8z7w6v5u4...
--dry-run to preview changesRotate all secrets in .env file:
./scripts/main.py rotate --file .env --keys "*" --backup true
Generate Vault commands for specific keys:
./scripts/main.py vault --keys API_KEY,DB_PASSWORD --path secret/data/production
Validate .env file before rotation:
./scripts/main.py validate --file .env --strict
Rotate with custom base64 secrets:
./scripts/main.py rotate --file .env --keys JWT_SECRET --algorithm base64 --length 64
Uses Python's built-in secrets module for cryptographically secure random generation. No external dependencies required.