Files

Workspace Shared Env

Use scripts/env/workspace_env.py to parse and normalize the workspace-shared /root/codes/.env.

Standard Format

The recommended file format is standard dotenv:

ANTHROPIC_AUTH_TOKEN=...
ANTHROPIC_BASE_URL=https://apiproxy.example.com/api
ANTHROPIC_MODEL=claude-sonnet-4-6
FEISHU_APP_ID=...
FEISHU_APP_SECRET=...
HARBOR_USERNAME=...
HARBOR_PASSWORD=...

Legacy Compatibility

The parser still accepts legacy lines during migration:

  • export KEY=value
  • KEY: value
  • "KEY": "value",
  • model: claude-sonnet-4-6 (normalized to ANTHROPIC_MODEL)

Examples

Normalize /root/codes/.env in-place and keep a backup:

python3 scripts/env/workspace_env.py normalize \
  --env-file /root/codes/.env \
  --in-place \
  --backup-suffix .bak

Print one value:

python3 scripts/env/workspace_env.py get \
  --env-file /root/codes/.env \
  --key ANTHROPIC_MODEL

Print parsed JSON:

python3 scripts/env/workspace_env.py json \
  --env-file /root/codes/.env \
  --pretty