Crates.io | worm_hole |
lib.rs | worm_hole |
version | 1.1.1 |
source | src |
created_at | 2025-03-21 16:00:23.537087+00 |
updated_at | 2025-03-21 16:20:51.956458+00 |
description | CLI tool to easily jump between directories |
homepage | |
repository | https://gitlab.com/Rignchen/worm_hole |
max_upload_size | |
id | 1600694 |
size | 47,216 |
Worm hole is a faster way to navigate through your file system.
It is a command line tool that allows you to jump to your favorite directories by using a simple alias.
The idea of worm hole came to me while I was using zoxide which is a great tool for navigating through your file system.
The problem I faced with zoxide was that because it's trying to guess the directory you want to jump to based on which one you use the most often, it often jumped to the wrong directory.
I also saw that I was always using the same words to jump to the same directories.
If you have Rust installed, you can install worm hole with cargo.
cargo install worm_hole --locked
If you want to compile worm hole from source, you can do so by following these steps:
git clone --depth 1 --branch 1.1.0 git@gitlab.com:Rignchen/worm_hole.git # https://gitlab.com/Rignchen/worm_hole.git
cd worm_hole
cargo build --release
cp target/release/worm_hole /usr/local/bin/
cd ..
rm -fr worm_hole # Remove the repository if you want
Worm hole needs to be set up before you can use it.
Worm hole has a command to generate the configuration it needs, you can then eval the output in your shell's configuration file.
eval "worm_hole init <shell>" # Replace <shell> with the shell you are using (bash, zsh, fish)
This command sets up 2 aliases:
You can change the aliases to whatever you want by adding these flags to the command:
You can also change the path to the database by adding the --db-path flag before the init
keyword.
For example if you add this to your shell's configuration file:
eval "worm_hole --db-path /path/to/db init bash --worm-hole wh2 --cd whcd2 --add wha --remove whrm --search whs --list whl --query whq --edit whe --rename whrn"
The sqlite database used by worm hole will be located at /path/to/db, then you will be able to use the following commands:
wh2 add toto /path/to/toto
)cd $(wh2 query toto)
)whs /home/user
will return all aliases from subdirectories of /home/user)Worm hole has not been created with the intention of having multiple instances connected to different databases on the same shell, however it is still possible to do so (I do it on one of my machines).
To do so
wh
and whcd
commands to avoid conflicts__worm_hole_cd
that is generated by the init command by piping the output into sedHere's my setup with 2 instances of worm hole (I know I was not very creative with the names):
eval "$(worm_hole init zsh --add wha)"
eval "$(worm_hole --db-path $HOME/.wormhole2.db init zsh --worm-hole wh2 --cd whcd2 --add wha2 | sed -e 's/__worm_hole_cd/__worm_hole_cd2/g')"
Worm hole is very simple to use.
If you have a custom setup, you can use the commands you set up in the configuration file (if you changed wh
or whcd
these will have to be replaced by the new commands you set up).
wh add toto /path/to/toto
wh add tata # if no path is given, the current directory is used
pwd # /home/user
whcd toto
pwd # /path/to/toto
wh query toto # /path/to/toto
wh list # toto -> /path/to/toto
wh search /path/to # toto -> /path/to/toto
wh list # toto -> /path/to/toto
wh edit toto /path/to/tata
wh list # toto -> /path/to/tata
wh rename toto tata
wh list # tata -> /path/to/tata
wh list # tata -> /path/to/tata
wh remove tata
wh list #
This project is licensed under the Creative Commons Attribution Non Commercial Share Alike 4.0 International license.
This is a human-readable summary of the license, it is not a legal document, do not rely on it for legal advice.
You are free to:
But you must follow these rules: