Loading...
Loading...
Universal environment variable loader for AI agent environments. Loads secrets and config from Claude.ai, Claude Code, OpenAI Codex, Jules, and standard .env files.
npx skill4agent add oaustegard/claude-skills configuringimport sys
sys.path.insert(0, '/path/to/claude-skills') # or wherever skills are installed
from configuring import get_env, detect_environment
# Get a variable (searches all sources automatically)
token = get_env("TURSO_TOKEN", required=True)
# With default
port = get_env("PORT", default="8080")
# What environment are we in?
env = detect_environment() # "claude.ai", "claude-code-desktop", "codex", "jules", etc.| Environment | Config Sources |
|---|---|
| Claude.ai Projects | |
| Claude Code | |
| OpenAI Codex | |
| Jules | Environment settings UI, |
| Universal | |
# Core
get_env(key, default=None, *, required=False, validator=None) -> str | None
load_env(path) -> dict[str, str] # Load specific file
load_all(force_reload=False) -> dict # Load all sources
# Utilities
detect_environment() -> str # Current platform
mask_secret(value, show_chars=4) -> str # Safe logging
debug_info() -> dict # Troubleshooting
get_loaded_sources() -> list[str] # What was checked.envTURSO_TOKEN=eyJhbGciOiJFZERTQSI...
EMBEDDING_API_KEY=sk-svcacct-...*-token.txt*-key.txteyJhbGciOiJFZERTQSI...turso-token.txtTURSO_TOKEN{
"env": {
"TURSO_TOKEN": "eyJhbGciOiJFZERTQSI..."
}
}.envimport sys
sys.path.insert(0, '/path/to/claude-skills')
from configuring import debug_info
print(debug_info())
# {'environment': 'claude.ai', 'sources': ['os.environ', 'claude.ai:/mnt/project/'], ...}cd /path/to/claude-skills/configuring
python scripts/getting_env.py # Show debug info
python scripts/getting_env.py TURSO_TOKEN # Get specific key# Old (api-credentials)
from credentials import get_anthropic_api_key
key = get_anthropic_api_key()
# Old (getting-env)
from getting_env import get_env
key = get_env("ANTHROPIC_API_KEY")
# New (configuring)
import sys
sys.path.insert(0, '/path/to/claude-skills')
from configuring import get_env
key = get_env("ANTHROPIC_API_KEY", required=True)