MCPcopy
hub / github.com/wuyoscar/GPT-Image2-Skill / _load_env_chain

Function _load_env_chain

src/gpt_image_cli/cli.py:61–68  ·  view source on GitHub ↗

Resolve OPENAI_API_KEY from the canonical config chain. Order: process env → ./.env → ~/.env (later wins for ~/.env so the user's canonical secret store beats stale shell exports).

()

Source from the content-addressed store, hash-verified

59
60
61def _load_env_chain() -> None:
62 """Resolve OPENAI_API_KEY from the canonical config chain.
63
64 Order: process env → ./.env → ~/.env (later wins for ~/.env so the user's
65 canonical secret store beats stale shell exports).
66 """
67 load_dotenv(Path.cwd() / ".env", override=False)
68 load_dotenv(Path.home() / ".env", override=True)
69
70
71SIZE_SHORTCUTS: dict[str, str] = {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected