Diagnose and recover environments where `lark-cli` or its `node` runtime cannot be found even though they were installed previously. Use when Codex sees `lark-cli: command not found`, `env: node: No such file or directory`, shell-specific PATH drift between `zsh` and `bash`, project-local Node/npm bin setups, or broken AI agent sessions that fail to load the user's shell init files.
Recover a working lark-cli invocation when the tool exists on disk but the current shell or agent cannot resolve it.
Prefer using the bundled diagnostic script first, then apply the smallest fix that restores a working command.
scripts/check_lark_cli_env.py.bash and zsh resolution for node, npm, and lark-cli..zshrc vs .bashrc)lark-cli present but its node interpreter missing from PATHCheck the exact failure mode before changing anything:
bash -lc 'which lark-cli || true; which node || true'
zsh -lic 'which lark-cli || true; which node || true'
Common signatures:
lark-cli: command not foundenv: node: No such file or directoryzsh can find the command but bash cannotUse:
python3 scripts/check_lark_cli_env.py
The script reports:
bash can resolve node, npm, and lark-clizsh -i can resolve themIf zsh -i works but the current shell does not, prefer one of these short-term fixes:
zsh -lic 'lark-cli ...'
or export the exact directories for the current command:
export PATH="/path/to/node/bin:/path/to/npm/bin:$PATH"
lark-cli ...
This is the safest option inside AI agent sessions because they often do not load the same init files as the user's interactive shell.
Typical persistent fix:
Example:
export PATH="/project/.local/node-v24.14.1-darwin-arm64/bin:/project/.local/npm/bin:$PATH"
Do not stop at which lark-cli. Verify the actual runtime chain:
zsh -lic 'which node; node -v; which lark-cli; lark-cli --version'
If the user's task depends on a Lark operation, verify one real command too, such as:
zsh -lic 'lark-cli auth status'
zsh -i works and bash fails: treat it as shell init loading drift, not a missing install.lark-cli exists but node does not: fix node PATH first..local/ directories: export those directories explicitly.~/.zshrc, prefer invoking zsh -lic over rewriting unrelated shell files.