#cd #cli-tool #cli #terminal

bin+lib leaper

A simple CLI tool to quickly leap to a directory

8 releases

0.3.1 Jun 2, 2024
0.3.0 Jun 2, 2024
0.2.2 Jun 1, 2024
0.2.1 May 31, 2024
0.1.3 May 30, 2024

#932 in Command line utilities

Download history 251/week @ 2024-05-25 332/week @ 2024-06-01 17/week @ 2024-06-08 1/week @ 2024-06-15

481 downloads per month

MIT license

7KB
115 lines

Leaper


A simple CLI tool to quickly leap to a directory.

Usage

You are home, switch to debug or to cathat.png's directory

.
└── home/
    ├── dev/
    │   └── ...
    │       └── ...
    └── etc/
        ├── misc/
        │   └── even_more_files/
        │       └── cathat.png
        └── more/
            └── test/
                ├── debug
                └── ...
$ leaper debug
$ leaper cathat.png
$ leaper --help

Setup

  1. Run cargo install leaper
  2. Create shell action
Zsh example
leap() {
    # Call tool and forward all args
    local dir_path=$(leaper "$@")

    # Check if a path was returned
    if ["$dir_path"]; then
        # 'cd' to the directory
        cd "$dir_path"
    else
        echo "'$1' not found"
    fi
}

Dependencies

~1MB
~15K SLoC