Pather is a command-line utility written in Rust for managing the PATH environment variable. It allows you to easily add or remove directories from your PATH, with support for common shell configuration files such as .bashrc, .zshrc, and config.fish.
- Add a directory to the beginning of the
PATHvariable. - Remove a directory from the
PATHvariable. - Automatically update your shell configuration file.
- Supports
bash,zsh, andfishshells. - Command-line interface with options for displaying help and version information.
To build and run Pather, you'll need to have Rust installed on your machine. You can install Rust using rustup.
Clone the repository and build the project:
git clone https://github.com/ptreew/pather.git
cd pather
cargo build --releaseYou can then run the binary:
./target/release/patherPather can be used to add or remove directories from your PATH variable. If no arguments are provided, it will toggle the presence of the current directory in PATH.
pather /path/to/directoryThis will add /path/to/directory to the beginning of your PATH variable.
pather /path/to/directoryThis will remove /path/to/directory from your PATH variable if it exists.
patherRunning Pather with no arguments will add the current directory to PATH if it is not already present, or remove it if it is.
pather --help # -h can be usedpather --version # -v can be used# Add /usr/local/bin to PATH
pather /usr/local/bin
# Remove /usr/local/bin from PATH
pather /usr/local/bin
# Add or remove the current directory from PATH
pather
# Display help message
pather --help
# Display version
pather --version
Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Feel free to fork the repository.
This project is licensed under the MIT License - see the LICENSE file for details.