Autoenv
Autoenv for zsh
Install / Use
/learn @zpm-zsh/AutoenvREADME
Autoenv
Until recently, the default file name used by this plugin was
.env, but now it is.in. This is done in order not to conflict with.envfiles from numerous projects.
Autoenv automatically sources (known/whitelisted) .in and .out files.
This plugin adds support for enter and leave events. By default .in files are used when entering a directory, and .out files when leaving a directory. And you can set variable CLICOLOR=1 for enabling colored output.
The environment variables $AUTOENV_IN_FILE & $AUTOENV_OUT_FILE can be used
to override the default values for the file names of .in & .out respectively.

Example of use
- If you are in the directory
/home/user/dir1and executecd /var/www/myprojectthis plugin will source the following files if they exist
/home/user/dir1/.out
/home/user/.out
/home/.out
/var/.in
/var/www/.in
/var/www/myproject/.in
- If you are in the directory
/and executecd /home/user/dir1this plugin will source the following files if they exist
/home/.in
/home/user/.in
/home/user/dir1/.in
- If you are in the directory
/home/user/dir1and executecd /this plugin will source the following files if they exist
/home/user/dir1/.out
/home/user/.out
/home/.out
Examples of .in and .out files
Please, don't use pwd or $PWD, instead of this use $(dirname $0). Additionally, the path of the directory being entered or exited is passed as the first argument to both .in and .out scripts, should using a symlink be preferred.
For node.js developing:
.in
nvm use node
OLDPATH=$PATH
export PATH="$(dirname $0)/node_modules/.bin":$PATH
.out
nvm use system
export PATH=$OLDPATH
For projects with .env or/and .env.local
source $(dirname $0)/.env*
Prerequisites
This plugin depends on zsh-colors.
If you don't use zpm, install it manually and activate it before this plugin. If you use zpm you don’t need to do anything
Installation
Using zpm
Add zpm load zpm-zsh/autoenv into .zshrc
Using oh-my-zsh
Execute git clone https://github.com/zpm-zsh/autoenv ~/.oh-my-zsh/custom/plugins/autoenv. Add autoenv into plugins array in .zshrc
Using Fig
Fig adds apps, shortcuts, and autocomplete to your existing terminal.
Install autoenv in just one click.
<a href="https://fig.io/plugins/other/autoenv_zpm-zsh" target="_blank"><img src="https://fig.io/badges/install-with-fig.svg" /></a>
Using antigen
Add antigen bundle zpm-zsh/autoenv into .zshrc
Using zgen
Add zgen load zpm-zsh/autoenv into .zshrc
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
