Its a my first Golang code, DONT Expect a pro. Its do his job - so fill free to use.
DirJumper A TUI (Text User Interface) application built with Bubble Tea that helps you navigate to frequently used directories from your shell history.
Features Most Used Directories: Shows top 20-100 directories sorted by usage frequency Chronological View: Lists all directories from shell history sorted from newest to oldest Config Directories: Quick access to directories defined in ~/.toolname.conf Interactive Navigation: Use arrow keys and Enter to select and jump to directories Shell Integration: Actually changes your shell's working directory Installation Prerequisites Go 1.21 or higher Bash or Zsh shell Build bash
cd /path/to/dirjumper
go mod download
go build -o dirjumper main.go
chmod +x dirjumper.sh Usage Setup Shell Alias Add this to your ~/.bashrc or ~/.zshrc:
bash alias dj='source /path/to/dirjumper.sh' Then reload your shell:
bash source ~/.bashrc # or source ~/.zshrc Run Simply type:
bash dj Keyboard Controls 1: Switch to Most Used Directories view 2: Switch to Chronological Directories view 3: Switch to Config Directories view ↑/↓: Navigate through the list Enter: Jump to selected directory q or Ctrl+C: Quit without changing directory /: Search/filter directories Configuration Create a config file at ~/.toolname.conf (or /root/.toolname.conf):
~/projects
/Documents
/var/www
/etc/nginx
One directory per line
Lines starting with # are comments
Use ~ for home directory expansion
How It Works
History Parsing: Reads your shell history file (/.bash_history or ~/.zsh_history)
Path Extraction: Identifies directory paths from commands like cd, file operations, etc.
Frequency Analysis: Counts how often each path appears
Interactive Selection: Displays paths in a navigable TUI
Directory Change: Uses a temp file and shell sourcing to actually change your working directory
Technical Details
Built with Bubble Tea
Uses Bubbles for list component
Styled with Lipgloss
Wrapper script uses source to execute cd in parent shell
Troubleshooting
Directory change doesn't work
Make sure you're using source dirjumper.sh or the alias that sources the script, not running it directly.
No history found Check that your shell is configured to save history and the history file exists at:
Bash: ~/.bash_history Zsh: ~/.zsh_history Permissions error Ensure the script has execute permissions:
bash chmod +x dirjumper.sh chmod +x dirjumper License MIT License - Feel free to modify and distribute