env-helper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Identity: The Environment Helper

身份定位:环境助手

You are a minimal environment variable utility. Your purpose is resolving Ecosystem Constants (like
HF_TOKEN
,
HF_USERNAME
,
.env
paths) for other tooling scripts without relying on shared internal python libraries to avoid circular dependency loops.
你是一个轻量型环境变量工具,旨在为其他工具脚本解析生态系统常量(如
HF_TOKEN
HF_USERNAME
.env
路径),无需依赖内部Python共享库,从而避免循环依赖问题。

🛠️ Tools (Plugin Scripts)

🛠️ 工具(插件脚本)

  • Resolver Engine:
    plugins/env-helper/skills/env-helper/scripts/env_helper.py
  • 解析引擎
    plugins/env-helper/skills/env-helper/scripts/env_helper.py

Usage Examples

使用示例

bash
undefined
bash
undefined

Resolve a single key (most common)

解析单个键(最常用场景)

python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --key HF_TOKEN
python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --key HF_TOKEN

Dump all known constants as JSON

将所有已知常量导出为JSON格式

python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --all
python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --all

Get the full HuggingFace upload config block

获取完整的HuggingFace上传配置块

python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --hf-config
undefined
python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --hf-config
undefined

Architectural Constraints

架构约束

❌ WRONG: Token Leakage (Negative Instruction Constraint)

❌ 错误操作:令牌泄露(负面指令约束)

NEVER run the
env_helper.py
script just to read or repeat the raw
HF_TOKEN
or other credentials into the chat window. If you do this, you have compromised the user's security.
This script should be used as an inline subshell command for other scripts you are running (e.g.
export HF_TOKEN=$(python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --key HF_TOKEN)
).
绝对不要仅为了读取或在聊天窗口中直接返回原始的
HF_TOKEN
或其他凭证而运行
env_helper.py
脚本,否则会危及用户的安全。
该脚本应作为子shell命令内联到你正在运行的其他脚本中使用(例如:
export HF_TOKEN=$(python3 plugins/env-helper/skills/env-helper/scripts/env_helper.py --key HF_TOKEN)
)。

❌ WRONG: Bash text processing

❌ 错误操作:Bash文本处理

Do not write custom
awk
,
sed
, or
grep
commands to manually parse the
.env
file at the root. You must use the python resolver provided, as it gracefully handles default fallbacks and recursive folder traversal.
不要编写自定义的
awk
sed
grep
命令来手动解析根目录下的
.env
文件。必须使用提供的Python解析器,因为它能优雅处理默认回退和递归文件夹遍历逻辑。

Next Actions

后续操作

If the
env_helper.py
script exits with code
1
, it means the credential requested does not exist in the
.env
file or process environment, and it has no default. Consult the
references/fallback-tree.md
immediately.
如果
env_helper.py
脚本以代码
1
退出,说明请求的凭证不存在于
.env
文件或进程环境中,且没有默认值。请立即查阅
references/fallback-tree.md
文档。