AgentEnv CLI
Use agentenv to check environment prerequisites before running a model, sync task, or automation step.
Invoke the Tool
Prefer the installed binary when it exists:
agentenv OPENAI_API_KEY HOME
If working inside this repository or the binary is not installed, run:
go run ./cmd/agentenv -- OPENAI_API_KEY HOME
Choose Flags
- Pass variable names as positional arguments for simple checks.
- Use
-file required-env.txtto load names from a file. - Use
-allow-emptyonly when blank values are acceptable. - Use
-show-valuesonly when exposing raw values is safe. - Use
-format jsonor-format yamlfor automation. - Use
-format textfor human review.
Apply Good Defaults
- Keep
-strict=truefor CI, startup checks, and agent preflight. - Avoid
-show-valuesunless the environment is trusted and the output will not be logged. - Prefer JSON output when a caller will branch on missing keys.
Examples
Validate a known set:
go run ./cmd/agentenv -- OPENAI_API_KEY AGENT_HOME MODEL_NAME
Load from file:
go run ./cmd/agentenv -- -file required-env.txt -format json