Skip to main content
Built by Best ROI MediaMITWave 4 · LiveBestRoiMedia/bestroi-game-tools

keys-env

Zero-leak environment key loader for bash, zsh, and Python game pipelines.

Shared credential-loading utility for bash, zsh, and Python that loads environment variables and service-account paths from a central api.env file while guaranteeing secret values are never printed.

View on GitHub ↗
Quick clonegit clone https://github.com/BestRoiMedia/bestroi-game-tools.git
GitHub repositoryBestRoiMedia/bestroi-game-tools
Module path_tools/keys/
LicenseMIT
Release waveWave 4
LanguagesPython · Shell (bash/zsh)

Why we built it

Every game project used to copy-paste its own key-loading script, risking accidental secret echoes in agent logs or missing variables. keys-env centralizes secret loading with a strict never-print-values contract.

Architecture & how it works

load_keys.sh (for bash/zsh) and keyenv.py (for Python) locate the workspace api.env file relative to the repository root, optionally filter by LOAD_KEYS_ONLY or explicit key lists, export PLAY_SA_KEY and ASC_KEY_FILE paths when present (e.g. AuthKey_XXXXXXXXXX.p8), and log only key names or variable counts to stderr.

Key capabilities

  • Loads all or filtered variables from a central api.env in bash, zsh, and Python
  • Never prints, logs, or echoes secret values—reports only variable names and counts
  • Auto-exports PLAY_SA_KEY and ASC_KEY_FILE paths when credential files exist
  • Includes names, check, and selftest subcommands for safe CI/agent verification

Usage example

Load keys safely in shell or Python without printing valuesPython
LOAD_KEYS_ONLY="OPENAI_API_KEY" source ./keys/load_keys.sh
python3 ./keys/keyenv.py names
python3 ./keys/keyenv.py check OPENAI_API_KEY
Always keep api.env, *.p8, and service-account JSON files gitignored.