From 877b1ed99e9f02cd31ea9714678e226654ecc293 Mon Sep 17 00:00:00 2001 From: Matthew Daubney Date: Fri, 16 Oct 2026 11:42:13 +0100 Subject: [PATCH] README: document PATH-ordering caveat for shell integration Co-Authored-By: Claude Sonnet 5.5 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index d54c594..867623e 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,23 @@ Add to `~/.zshrc` or `~/.bashrc`: command -v envbao >/dev/null && eval "$(envbao)" ``` +> **Caveat: `PATH` must already include `envbao` where this line runs.** The guard +> `command -v envbao` is evaluated at that point in the file. If `~/.local/bin` (or wherever you +> installed the binary) is only added to `PATH` *later* in your `.zshrc` / `.bashrc` (a common +> case with Oh My Zsh, nvm or pyenv snippets), the guard fails and the line is **silently +> skipped**: no variables are loaded, yet running `eval "$(envbao)"` by hand later works. +> +> Either put the line *after* your last `PATH` change, or avoid the dependency by using the +> full path: +> +> ```sh +> [ -x "$HOME/.local/bin/envbao" ] && eval "$("$HOME/.local/bin/envbao")" +> ``` +> +> To debug, open a new shell and run `command -v envbao`; if it prints nothing, `PATH` is the +> problem. Remember that a failing `envbao` also prints nothing to stdout by design, so check +> stderr and `~/.envbao/envbao.log` for the reason. + ### Example `~/.envbao/config.toml` ```toml