| name | configuring |
| description | Universal environment variable loader for AI agent environments. Loads secrets and config from Claude.ai, Claude Code, OpenAI Codex, Jules, and standard .env files. |
| metadata | {"version":"2.0.0","replaces":"api-credentials, getting-env"} |
Configuring
Unified configuration management across AI coding environments. Load environment variables, secrets, and other opinionated configuration setups from any AI coding platform.
Quick Start
import sys
sys.path.insert(0, '/path/to/claude-skills')
from configuring import get_env, detect_environment
token = get_env("TURSO_TOKEN", required=True)
port = get_env("PORT", default="8080")
env = detect_environment()
Supported Environments
| Environment | Config Sources |
|---|
| Claude.ai Projects | /mnt/project/*.env, /mnt/project/*-token.txt |
| Claude Code | ~/.claude/settings.json (env block), .claude/settings.json |
| OpenAI Codex | ~/.codex/config.toml, setup script → ~/.bashrc, shell_snapshots/*.sh |
| Jules | Environment settings UI, .env in repo |
| Universal | os.environ, .env, .env.local |
API Reference
get_env(key, default=None, *, required=False, validator=None) -> str | None
load_env(path) -> dict[str, str]
load_all(force_reload=False) -> dict
detect_environment() -> str
mask_secret(value, show_chars=4) -> str
debug_info() -> dict
get_loaded_sources() -> list[str]
Credential File Formats
.env files (KEY=value):
TURSO_TOKEN=eyJhbGciOiJFZERTQSI...
EMBEDDING_API_KEY=sk-svcacct-...
Single-value files (*-token.txt, *-key.txt):
eyJhbGciOiJFZERTQSI...
Filename becomes key: turso-token.txt → TURSO_TOKEN
Claude Code settings.json:
{
"env": {
"TURSO_TOKEN": "eyJhbGciOiJFZERTQSI..."
}
}
Priority Order
Later sources override earlier:
- OS environment variables
- Platform-specific sources (detected automatically)
.env files in cwd
- OS environment variables (again - explicit exports always win)
Debugging
import sys
sys.path.insert(0, '/path/to/claude-skills')
from configuring import debug_info
print(debug_info())
CLI:
cd /path/to/claude-skills/configuring
python scripts/getting_env.py
python scripts/getting_env.py TURSO_TOKEN
Migration from api-credentials / getting-env
Replace:
from credentials import get_anthropic_api_key
key = get_anthropic_api_key()
from getting_env import get_env
key = get_env("ANTHROPIC_API_KEY")
import sys
sys.path.insert(0, '/path/to/claude-skills')
from configuring import get_env
key = get_env("ANTHROPIC_API_KEY", required=True)