🐝 $PATH manager for bash, zsh & fish. Featuring shining TUI!
MIT License
Have you ever found yourself searching something like "Adding a new entry to the PATH variable in ZSH", "How to delete entry from PATH in bash", "How to change order of the PATH entries in fish"...? And then you forget how to do it and search it again, again and again... ughh, this is annoying
Try Pat! It's a $PATH
environment variable manager. It can reorder, delete and add new path entries with a fancy and easy TUI, so you don't have to remember any commands.
Note Pat is a work in progress, so bugs and missing features are expected. If you find any, please open an issue.
Okay, let's move on!
Let's assume you're a ZSH user and want to add ~/playground/scripts
to your $PATH
.
fish and bash are also supported, it's just an example
No need for any extra arguments or preconfiguration just run
pat
It will welcome you with this screen. Select zsh
(you can move up by pressing arrow up `` or h
and `/j` to move down)
You will see your paths.
You can preview each (check what executables it contains) by pressing p
(acronym for preview
)
Press esc
to go back.
Press a
(for add
) to add a new path. It will open a text input with smart hints and autocompletion so you won't be lost or misspell something while typing
See, pat is smart! It will provide you autocompletions while typing
Press tab
to accept completion
Press enter
to confirm
Almost there! Now you will need to save it. Simply press s
or enter
to save. Don't worry it will ask you to confirm your actions before applying anything
Press Y
(uppercase y) to confirm. This keybind is inconvenient on purpose so you won't do anything
accidentally
LAST STEP. You will need to do it only once and forget forever!
Basically, you will need to source file generated by pat as the last thing in your shell config file.
echo 'source $(pat where --zsh) &>/dev/null' >> ~/.zshenv
For any other shell steps are the same, except for the last one
For Fish
# If you know what you're doing, you can change config.fish to other file of course
echo 'source (pat where --fish) &>/dev/null' >> ~/.config/fish/config.fish
For Bash
echo 'source $(pat where --bash) &>/dev/null' >> ~/.bashrc
With curl
curl -sSL pat.metafates.one/install | sh
With wget
wget -qO- pat.metafates.one/install | sh
This will install
pat
to the~/.pat/bin
and automatically add it to your$PATH
If it finds that pat is already installed it will update it wherever it is installed
Compile from source with make
git clone https://github.com/metafates/pat.git
cd pat
make install
Keybind | Action |
---|---|
p |
Preview executables of the selected path |
d |
Move the selected path 1 position down |
u |
Move the selected path 1 position up |
a |
Add a new path |
enter |
Select, Confirm |
Y |
Confirm actions |
d |
Remove selected path from $PATH
|
s |
Save |
c |
Copy selected path |
backspace |
Undo unsaved changes |
See also pat help
to show available commands.
For example, pat config info