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
PATH
variable. - Remove a directory from the
PATH
variable. - Automatically update your shell configuration file.
- Supports
bash
,zsh
, andfish
shells. - 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 --release
You can then run the binary:
./target/release/pather
Pather 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/directory
This will add /path/to/directory
to the beginning of your PATH
variable.
pather /path/to/directory
This will remove /path/to/directory
from your PATH
variable if it exists.
pather
Running 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 used
pather --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.