Agent Skills
› different-ai/openwork
› get-env-var
get-env-var
GitHub从 Infisical 工作区获取环境变量或密钥注入当前 Shell,支持单值导出和命令级注入。用于解决脚本缺少 Token、API Key 等敏感信息的问题,确保后续命令可安全使用这些凭据。
触发场景
需要未设置的环境变量如 BLOB_READ_WRITE_TOKEN
缺少 Token 或 API Key
请求从 Infisical 加载密钥
安装
npx skills add different-ai/openwork --skill get-env-var -g -y
SKILL.md
Frontmatter
{
"name": "get-env-var",
"description": "get an env var, fetch a secret, missing env var, missing token\/API key, load secrets from Infisical, infisical. Fetch secrets from the team's Infisical workspace into the shell environment so subsequent commands can use them."
}
Skill: get-env-var
Fetch a secret from the team's Infisical workspace into the current shell so the next command can use it.
When to use
- A command or script needs an env var that is not set, such as
BLOB_READ_WRITE_TOKEN. - A token, API key, or other secret is missing from the environment.
- The user asks to load secrets from Infisical.
Setup (once per machine)
- Install the CLI on macOS:
brew install infisical/get-cli/infisical. - Check auth with
infisical user get; if it fails, runinfisical loginand complete the browser flow. - For CI or other non-interactive runs, set
INFISICAL_TOKENfrom a machine identity; the CLI skips login when it is present. - This repo is already project-linked via tracked
.infisical.json(workspaceId: "e9f4542a-8714-46c3-a8fd-99d8cb370aeb", emptydefaultEnvironment). From the repo root,infisicaldefaults to thedevenvironment slug when--envis omitted.
Fetch one secret into the environment
Run from the repo root:
export NAME="$(infisical secrets get NAME --plain --silent)"
- Replace
NAMEwith the secret name. - Add
--env <slug>for a non-default environment; this repo defaults todev. - Add
--path /some/folderwhen secrets are organized in folders.
Inject everything into a command
Run the command through Infisical so all project secrets are available only to that process:
infisical run -- <command>
Rules
- Never echo, print, or otherwise log secret values.
- Never write secrets to files, logs, commit messages, PR bodies, or comments.
- Only use
--plaininside command substitution, as inexport NAME="$(...)". - If a secret does not exist, STOP and tell the user exactly which secret name and environment to add in Infisical; do not invent values.
版本历史
- ff5d298 当前 2026-08-20 11:35


