# whi
`whi` is a smarter `which` that also lets you rearrange your current shell's `PATH` safely.
Whi is path-only again.
> **Deprecation notice for 0.7.0**
> `whi` is intentionally dropping `whifile` activation, environment-variable management, and virtual-environment support so the project can stay focused on PATH management.
> - If you still need those features, stay on `whi 0.6.x`.
> - Legacy profile and saved PATH files may still contain `!env.*`, `!whi.extra`, or `ENV!` sections; `whi` will keep reading them for compatibility, but those directives are ignored and never rewritten.
> - The follow-up project for the removed functionality will be `envy`.
- Managed features: `prefer`, `add`, `move`, `switch`, `clean`, `delete`, `undo`, `redo`, `reset`, `diff`, `apply`, `save`, `load`, `list`, `rmp`, `shorthands`
- Removed features: environment-variable management, `whifile` activation, and virtual environment management
## Install shell integration
```sh
eval "$(whi init bash)" # add to the end of ~/.bashrc
eval "$(whi init zsh)" # add to the end of ~/.zshrc
```sh
whi apply # save current PATH for this shell
whi apply fish # save for a specific shell
whi apply all # save for bash, zsh, and fish
whi save work # save current PATH as profile "work"
whi load work # load profile "work"
whi list # list saved profiles
whi rmp work # remove profile "work"
```
## File format
Saved PATH files and profiles use a path-only directive format:
```text
!path.replace
/usr/local/bin
/usr/bin
/bin
```
Supported directives:
- `!path.replace`
- `!path.prepend`
- `!path.append`
- legacy `PATH!`
- legacy colon-separated PATH strings
Deprecated directives are still parsed for compatibility and ignored:
- `!env.set`
- `!env.replace`
- `!env.unset`
- `!whi.extra`
- legacy `ENV!`
## Shorthands
```text
whip -> whi prefer
whim -> whi move
whis -> whi switch
whic -> whi clean
whid -> whi delete
whia -> whi --all
whiad -> whi add
whin -> whi -n
whiu -> whi undo
whir -> whi redo
whil -> whi load
whish -> whi shorthands
```
## Storage
- Saved PATH files: `~/.whi/saved_path_bash`, `~/.whi/saved_path_zsh`, `~/.whi/saved_path_fish`
- Profiles: `~/.whi/profiles/`
- Config: `~/.whi/config.toml`
- Protected paths: `~/.whi/protected_paths`
- Session history: `${XDG_RUNTIME_DIR:-/tmp}/whi-<uid>/session_<pid>.*`
## Notes
- Mutating commands require shell integration because they must update the current shell's `PATH`.
- `whi apply` preserves protected paths by default. Use `--no-protect` to skip that safety behavior.