Loading...
Loading...
Manages API keys, credentials, and sensitive configuration using secrets.json patterns with environment variable fallbacks. Use when working with API keys, credentials, .env files, or any sensitive configuration.
npx skill4agent add autumnsgrove/groveengine secrets-managementproject/
├── secrets.json # Actual secrets (NEVER commit)
├── secrets_template.json # Template with placeholder values (commit this)
├── .gitignore # Must include secrets.json
└── .env # Alternative for env vars (also gitignored){
"anthropic_api_key": "sk-ant-api03-...",
"openrouter_api_key": "sk-or-v1-...",
"openai_api_key": "sk-...",
"database_url": "postgresql://user:pass@localhost/db",
"comment": "Add your API keys here. Keep this file private."
}import os
import json
from pathlib import Path
def load_secrets():
"""Load secrets from secrets.json with env var fallback."""
secrets_path = Path(__file__).parent / "secrets.json"
try:
with open(secrets_path, 'r') as f:
return json.load(f)
except (FileNotFoundError, json.JSONDecodeError):
return {}
SECRETS = load_secrets()
# Use with environment variable fallback
API_KEY = SECRETS.get("anthropic_api_key", os.getenv("ANTHROPIC_API_KEY", ""))| Provider | Format |
|---|---|
| Anthropic | |
| OpenRouter | |
| OpenAI | |
| AWS Access | |
AgentUsage/secrets_management.md