Shapeshifter is a command-line tool written in Rust that allows you to quickly switch between saved directory paths, making navigation in the terminal more efficient.
shapeshifter.mp4
- Quick Navigation: Save directory paths as markers and switch between them with a single command.
- Simple CLI Interface: Easy-to-use commands for managing and navigating between saved paths.
Before installing Shapeshifter, ensure you have the following dependencies installed on your system:
- Rust
- fzf
- find command (typically available on Unix-like systems)
- install Rust from rustup.rs
sudo apt-get install fzf findutils
yay -S fzf findutils
brew install fzf findutils
To use Shapeshifter, you'll need Rust installed on your system. If you haven't already, you can install Rust from rustup.rs.
- Clone the repository:
git clone [email protected]:Marlon-Sbardelatti/shapeshifter.git
cd shapeshifter
- Build the project using Cargo (Rust's package manager):
cargo build --release
- Copy the Shapeshifter executable to /usr/local/bin:
sudo cp target/release/shapeshifter /usr/local/bin
- Copy the funcition to your .bashrc:
- OBS: We won't directly use the shapeshifter command; instead, we'll create a bash function that acts as an alias, and this function will call our Rust binary. That's why we need this function
shs(){
if [[ $1 =~ ^[0-9]+$ ]]; then
output=$(shapeshifter $1)
read -ra words <<< "$output"
last_word="${words[-1]}"
if [[ $last_word != "99" ]]; then
cd "$output"
else
echo "$output"
fi
else
if [ "$1" = "l" ]; then
shapeshifter l
elif [[ "$1" = "r" ]]; then
shapeshifter r
elif [[ "$1" = "c" ]]; then
shapeshifter c
elif [[ "$1" = "s" ]]; then
shapeshifter s
elif [[ "$1" = "h" ]]; then
shapeshifter h
else
cd $(shapeshifter change)
fi
fi
}
- Source .bashrc file:
source ~/.bashrc
To use Shapeshifter, you can use the following commands:
Command | Description |
---|---|
shs |
Display all saved paths using fzf for selection. Change to selected directory. |
shs "number" |
Change to the directory corresponding to the number provided. |
shs list or shs l |
List all saved paths. |
shs save or shs s |
Save the current directory path. |
shs remove or shs r |
Remove a saved path by selecting its number. |
shs clear or shs c |
Delete all saved paths. |
shs help or shs h |
Display help for all commands. |
We welcome contributions! Follow these steps to contribute:
- Fork the repository.
- Create a new branch (git checkout -b feature/awesome-feature).
- Commit your changes (git commit -m 'Add some awesome feature').
- Push to the branch (git push origin feature/awesome-feature).
- Open a pull request.
This project is licensed under the MIT License.
Feel free to reach out with any questions or feedback.
- Email: [email protected]
- GitHub: Marlon-Sbardelatti