Skip to content

simple golang based tool it use TUI babble-tea lib, and print list dirs from history sorted by how often dir was used

License

Notifications You must be signed in to change notification settings

ntoskrnl256/dirjamper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Clone or download the files

cd /path/to/dirjumper

Download dependencies

go mod download

Build the binary

go build -o dirjumper main.go

Make the wrapper script executable

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):

Add frequently used directories

~/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

About

simple golang based tool it use TUI babble-tea lib, and print list dirs from history sorted by how often dir was used

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published