Fast directory jumper. Resolves aliases from ~/.aliasrc and ~/.aliasrc.d/ and prints paths. A shell function wraps it with cd.
Zero dependencies. No runtime tools required.
fj <ALIAS> # resolve alias, print path
fj <ALIAS>/subpath # resolve alias + append subpath
fj -c <ALIAS> # interactive subdirectory chooser (built-in TUI)
fj -l # list all defined aliases
fj -f <FILE> <ALIAS> # use custom alias file
fj -h # helpWith the shell function sourced, fj will cd into the resolved path instead of printing it. The -l flag always prints without cd.
Opens a built-in TUI picker listing subdirectories of the resolved alias path. Navigate with arrow keys or j/k, select with Enter, cancel with Esc or Ctrl+C.
The TUI renders to the terminal (via /dev/tty), so path=$(fj -c myalias) works — the UI appears on screen while the selected path is captured in $path.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Usage error |
| 2 | Alias not found |
| 3 | Path does not exist |
| 4 | Cancelled (TUI) |
| 5 | Internal error |
Aliases are defined in ~/.aliasrc or any file under ~/.aliasrc.d/:
alias projects=$HOME/Projects
alias dotfiles=~/dotfiles
alias work="${HOME}/Work"Lines must start with alias . Quotes around values are stripped. ~ and $HOME/${HOME} are expanded.
git clone https://github.com/pders01/fj.git
cd fj
make
make install # installs to /usr/local/bin (override with PREFIX=...)Then add to your shell rc (.bashrc, .zshrc, etc.):
. /path/to/fj_function.shTab completion is installed automatically with make install. It supports:
fj <TAB>— complete alias names (with paths as descriptions)fj p/<TAB>— complete subdirectories under the resolved alias pathfj -<TAB>— complete flags (-c,-l,-f,-h)
To install manually, copy _fj to a directory in your $FPATH:
cp _fj /usr/local/share/zsh/site-functions/_fjThen reload completions:
rm -f ~/.zcompdump && exec zshmake uninstallRemove the . /path/to/fj_function.sh line from your shell rc.