Using working directories history to ease navigation

I’m a hardcore atuin lover since I installed it about a year ago (the last tool that had as much impact on my terminal workflow was fzf).

I think “atuin-as-a-history-search-replacement” is great, but I suspect the database can be used for a broader usage.

Some weeks ago I implemented a little zsh widget based on atuin db + sqlite + fzf + eza to display a searchable list of the most recently used working directories from the atuin db, along with a preview of the directory including last few commands and a colored eza preview.

The widget has 2 behaviors :

  • on an empty zsh line it will cd into the selected directory.
  • on a non-empty zsh line it will insert the selected directory into the command line

The oh-my-zsh plugin is here: GitHub - jerem-punk/atuin-cd · GitHub

I’ve tailored it to my needs to keep it simple (for example: no gentle fallback if the fzf version is not supported or if eza is not found). Since I use it I’ve almost stopped using the cd command directly, and insta-pasting a previously used directory into the cli is such a pleasure.

This “idea” post is not a feature request. It’s a description of an usage for the atuin database improving my workflow I wanted to share along with a POC implementation.

2 Likes

this is so cool! thank you for sharing!! is there anything we could have done to make building on top of atuin easier?

the only feedback I would give, is that using the atuin command (history list or history search) would be better for long term stability vs using the database. we might change the database schema at any time, but the command interface should remain stable.