Skip to content

osteensco/fastTravelCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ab57a72 · Feb 14, 2025
Jan 27, 2025
Feb 14, 2025
Jan 17, 2025
Jan 30, 2025
Jan 30, 2025
Jan 25, 2025
Dec 31, 2024
Feb 14, 2025
Feb 14, 2025
Aug 17, 2024
Apr 14, 2024
Jan 17, 2025
Feb 14, 2025

Repository files navigation

     __           _  _____                     _   ___   __   _____ - -  -  -   -   -
    / _| ____ ___| |/__   \___  ______   _____| | / __\ / /   \_   \ - -  -  -   -   -
   | |_ / _  / __| __|/ /\/  _\/ _  \ \ / / _ \ |/ /   / /     / /\/  - -  -   -   -
   |  _| (_| \__ \ |_/ /  | | | (_| |\ V /  __/ / /___/ /___/\/ /_  - -  -  -   -   -
   |_|  \__._|___/\__\/   |_|  \__._| \_/ \___|_\____/\____/\____/ - -  -  -   -   -
                                                                    

A better CLI navigation experience

fastTravelCLI is a fast, lightweight, and feature rich CD command replacement.

Typing out a long directory path can be a bit painful. Most tools that solve this problem give you less to type but still involve additional steps afterwards. fastTravelCLI allows you to easily save destinations as key-value pairs, and provides simple commands to manage your keys.

fastTravelCLI is being continuously improved, check out the issues for new features, support, and integrations in the works. Specifically, a fallback matching algorithm is in development for users that want a more automated experience.

Installation

Clone the repo, cd into it, and run the following based on your OS -

bash install/linux.sh
bash install/mac.sh

Disclaimers

Currently available for Unix-like OS and bash/zsh shells. May work in more shell environments but not guaranteed.

Compiles using go version >= 1.20.0, may work with older versions but not guaranteed.

Some features have dependencies:
  • -hist command requires tree and fzf.

Usage

# Go to a directory you would like to set a waypoint for and run 
ft -set [key]


# You can also explicitly set a key to a directory, or set multiple at once
ft -set key1=some/sub/dir key2=some/other/dir


# Travel to a location by running
ft [key]


# You can also travel to a subdirectory of a key
ft [key]/some/subdir


# ft can replace your cd command entirely
ft relative/dir
ft ..
ft -


# ft supports relative paths in the working directory and CDPATH
ft mydir


# To remove a location run
ft -rm [key]


# To rename a location run
ft -rn [key] [new key]


# ft allows you to visit previously visited directories
ft [


# Traverse back up your dir history using 
ft ]


# You can also view your entire session history in a fuzzy finder (powered by fzf)
ft -hist


# View your saved locations with 
ft -ls


# fastTravelCLI accepts args piped to it
echo "mykey=some/project/path" > myfile.txt
cat myfile.txt | ft -set


# ft is easy to update to the latest release
ft -update
# or
ft -u


# To see a full list of available commands run
ft -help
# or
ft -h

NOTE: If you run into an error opening the file fastTravel.bin you may need to adjust ownership of the fastTravelCLI folder.

sudo chown $USER:$USER $HOME/.local/share/fastTravelCLI

Common Questions

Why not just use Zoxide?

Zoxide is a great tool but the implementation is complex leading to many issues that cause it to be less than ideal for many use cases. Here are a few examples of Zoxide issues that fastTravelCLI solves gracefully or avoids entirely.

I already use fzf for most of my in project navigation, why would I use this?

If you use fzf to find a deeply nested directory that you access often, fastTravelCLI takes an experience like this:

cd $(find * -type d | fzf)
» |
  7/7 (0)
› mystuff
  mystuff/personal
  mystuff/personal/projects/
  mystuff/personal/projects/notes
  mystuff/work
  mystuff/work/notes
  mystuff/work/docs
  mystuff/work/projects/notes
  mystuff/work/projects/
» notes|
  2/7 (0)
› mystuff/personal/projects/notes
  mystuff/work/projects/notes
» notes|
  2/7 (0)
  mystuff/personal/projects/notes
› mystuff/work/projects/notes

and condenses it to this:

ft wknotes

Contributing

PRs and feature suggestions are welcome. I originally made this for myself so there's not alot of structure or official-ness to this project.