A Rust TUI to rediscover your custom shell aliases & functions.
cargo install alf_tui# Prebuilt binary from the GitHub releases
mise use -g github:metal-gabe/alf-cli
# Or build from the published crate
mise use -g cargo:alf_tuibrew tap metal-gabe/alf
brew install alfcargo install --git https://github.com/metal-gabe/alf-cli-
First-time setup: Run the initialization wizard
alf init
-
Launch the search interface:
alf
Tip
After installing, alf can be run right away. Using the init command creates a starting config file for you to be able to customize.
Configuration file location (created after alf init):
- Linux:
~/.config/alf/config.toml - macOS:
~/.config/alf/config.toml - Windows:
%USERPROFILE%\.config\alf\config.toml
alf- Launch interactive TUI (default, no subcommand)alf search <QUERY>- Launch TUI with an initial search query pre-filledalf init- First-run configuration wizardalf init --print-shell-hook <SHELL>- Print the shell wrapper and exit (non-interactive equivalent ofalf activate <SHELL>)alf activate <SHELL>- Print shell integration wrapper (zshorbash)alf config add <PATH>...- Add one or more shell source files toshell_files(e.g.alf config add ~/.work_aliases); paths must be absolute or start with~/$HOME, and must already existalf config show- Display current configurationalf config edit- Open config in editoralf config reset- Reset to defaults
Running alf init writes a config.toml like the one below.
The shell_files list is filled in with the shell files detected in your home directory (plus any you add during the wizard), and theme reflects your menu choice; every other value is the built-in default.
The comments are annotations for this README and are not written to the generated file.
[display]
show_type_badges = true # show Alias/Function badges
syntax_highlighting = true # syntax highlight in detail view
parse_comments = true # parse and display comments from shell files
[general]
shell_files = ["~/.bashrc", "~/.zshrc"] # detected at init; glob patterns supported
alias_expansion = "name" # "name" | "script" — what Tab/Enter feeds back to the shell
[search]
case_matching = "smart" # "ignore" | "smart" | "respect"
normalize = true # unicode normalization
enable_regex = true
substring_matching = true
[ui]
theme = "default" # see Available Themes below
keybind_mode = "vim" # currently only "vim" is supporteddefault- Classic terminal colorsgruvbox- Retro groovenord- Arctic bluedracula- Purple/pink dark themesolarized- Precision colorscatppuccin- Soothing pastels (Mocha)tokyonight- Tokyo-inspired dark theme (Storm)shades_of_purple- Purple-heavy theme
The full reference is always available in-app — press ? to toggle the help modal.
View all keybindings
Navigation
j/↓- Move down 1 line in the active panelk/↑- Move up 1 line in the active panelg/gg- Jump to topG- Jump to bottomCtrl-f/Ctrl-b- Scroll a full page (20 lines) down/upCtrl-j/Ctrl-k- Scroll a half page (10 lines) down/up
Panels & filters
n/p- Cycle panel focus forward/backward (List → Description → Script)h/l- Cycle filter backward/forward (Aliases ↔ Functions ↔ All)1/2/3- Select the Aliases / Functions / All filter directly
Grouping & sorting
og/Ctrl-g- Cycle group mode forward (None → Aliases → Functions)oG- Cycle group mode backwardos/Ctrl-s- Toggle sort order (Ascending ↔ Descending)
Search
/ori- Enter search modeEsc- Exit search mode (keep query)Ctrl-u- Clear search query (any mode)Shift-N/Shift-P- Cycle panels while in search modeShift-H/Shift-L- Cycle filters while in search modeCtrl-j/Ctrl-k- Scroll the list while in search mode
Themes
tj- Cycle to the next themetk- Cycle to the previous theme
Actions & quit
Tab- Populate the parent shell prompt with the selected entryEnter- Execute the selected entry in the parent shell?- Toggle the help modalq- Quit (normal mode only)Ctrl-c/Ctrl-d- Force quit (any mode)
Tab and Enter only affect the parent shell when the alf shell hook is sourced. Add this to your shell config:
# zsh (~/.zshrc)
eval "$(alf activate zsh)"
# bash (~/.bashrc)
eval "$(alf activate bash)"The hook installs an alf shell function that wraps the binary so selections feed back into the prompt.
Tab vs Enter semantics:
- Tab — populate the prompt with the selected entry; do not run it.
- Enter — run the selected entry immediately (and add it to history).
- Rust 1.74.0 or later
cargo build --releasecargo testcargo run| Target | Description |
|---|---|
make build |
Debug build |
make build-release |
Optimized release build |
make check |
Check without building |
make clean |
Remove build artifacts |
make clippy |
Lint check |
make fmt / make fmt-fix |
Check / auto-fix formatting |
make install |
Install locally |
make lint |
Run fmt + clippy |
make run |
Run TUI (debug build) |
make snap |
Review insta snapshot diffs |
make test |
Run tests via nextest |
make test-cov |
Generate HTML coverage report |
make test-fresh |
Run tests with no cache |
make watch |
Watch & rebuild on changes |
- Linux (x86_64, aarch64)
- macOS (Intel, Apple Silicon)
- Windows (x86_64)
Licensed under either of the following choices at your option.
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
