https://github.com/andrewferrier/memy
Track and recall frequently and recently used files or directories
https://github.com/andrewferrier/memy
cli rust tracker
Last synced: 4 months ago
JSON representation
Track and recall frequently and recently used files or directories
- Host: GitHub
- URL: https://github.com/andrewferrier/memy
- Owner: andrewferrier
- License: mit
- Created: 2025-07-13T11:33:43.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-12-30T15:34:45.000Z (6 months ago)
- Last Synced: 2026-01-03T09:50:16.982Z (6 months ago)
- Topics: cli, rust, tracker
- Language: Rust
- Homepage:
- Size: 375 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# memy

**memy** is a modern, fast, and simple command-line tool to help you track and recall the files and directories you use most often. Many similar tools support only directories, **but memy supports files too**. Inspired by [fasd](https://github.com/whjvenyl/fasd), memy (with the aid of hooks into your favourite tools) remembers the paths you interact with, lists them back to you by a combination of frequency and recency ("frecency"), and makes it easy to build a workflow around them using standard Linux/Unix tools. memy is written using Rust and a SQLite backend for speed and scalability.
Unlike tools such as [zoxide](https://github.com/ajeetdsouza/zoxide), memy is less focused on providing a direct "jump" command for navigating directories. Instead, memy is designed to be a flexible backend for tracking your usage, which you can combine with tools like [`fzf`](https://github.com/junegunn/fzf) and `cd` to jump around directories if you wish. Crucially, memy also supports tracking files you use - not just directories - unlike most other tools in this space (except for `fasd`, which for a longer time was not maintained).
memy is ideal for developers, sysadmins, CLI power users, and anyone who works with many files and directories and wants a smarter way to recall them.
Currently, memy has been tested on Linux and MacOS (limited). It has not been tested on Windows, any testing or feedback would be appreciated. For transparency, `memy` is partially created using AI assistance - all code changes are overseen by a human maintainer!
## Quick Start
- Note a file or directory:
```sh
memy note
```
You are free to note a path whenever you wish, although typically this is done by the supplied hooks (see more information below).
- List all remembered paths (in frecency order):
```sh
memy list
```
(`ls` is an alias for `list`, so `memy ls` works too.)
- Open a recently used file in your editor, selecting it using `fzf` (assuming your editor is `vim`).
```sh
memy list -f | fzf | sed "s|^~|$HOME|" | xargs vim
```
- Change to a directory from your remembered paths using [fzf](https://github.com/junegunn/fzf) as a wrapper:
```sh
selected=$(memy list -d | fzf); [[ -n "$selected" ]] && cd "${selected/#\~/$HOME}"
# (or just 'memy-cd' if you have the bash/zsh/fish hook installed)
```
- Change to the most frecent directory containing the string 'download' (case-insensitive):
```sh
cd $(memy list -d | grep -i download | tail -1 | sed "s|^~|$HOME|")
```
- (On Linux) Open a recently used path in your GUI file manager:
```sh
memy list -f | fzf | sed "s|^~|$HOME|" | xargs xdg-open
```
Many of these more advanced tricks would work well configured as [shell aliases](https://linuxize.com/post/how-to-create-bash-aliases/).
`memy` will import your database from [fasd](https://github.com/whjvenyl/fasd), [autojump](https://github.com/wting/autojump) and/or [zoxide](https://github.com/ajeetdsouza/zoxide), if there is one, on first run (this behaviour can be disabled in the configuration file).
## Noting files automatically using hooks
Hooks in memy are scripts or other configuration files provided with memy that can be embedded into other tools' configurations. These hooks allow you to automatically note files as they are used, opened, or interacted with, integrating memy seamlessly into your workflow.
For example, you might use a hook to automatically note files opened in your text editor or accessed via the command line, or directories you change to in your shell. Hooks are designed to be a starting point only and can be customized to suit your specific needs and preferences. Over time, we plan to grow the list of hooks available. Any contributions to the predefined hooks available would be very welcome as issues or pull requests [on this repository](https://github.com/andrewferrier/memy).
### Using Hooks
To see the list of current hooks provided by memy, type `memy hook`.
To see the contents of a hook, type `memy hook `. In future, we'll provide an easier way to [automatically install some hooks](https://github.com/andrewferrier/memy/issues/53). For now, the provided hooks can be installed like this (please be careful to make sure you backup any configuration files etc. before running these commands to avoid mishaps):
| Tool | How to Install |
| ------ | ----------------------------------------------------------- |
| bash | Run `echo 'source <(memy hook bash)' >> ~/.bashrc` |
| fish | Run `memy hook fish.fish >> ~/.config/fish/config.fish` |
| lfrc | Run `memy hook lfrc >> ~/.config/lf/lfrc` |
| neovim | Run `memy hook neovim.lua > ~/.config/nvim/plugin/memy.lua` |
| ranger | Run `memy hook ranger.rc.conf >> ~/.config/ranger/rc.conf` |
| vim | Run `memy hook vim.vim > ~/.vim/plugin/memy.vim` |
| zsh | Run `echo 'eval $(memy hook zsh)' >> ~/.zshrc` |
## Installation
### Automated Install using Shell Script
Use single shell script to install:
```
curl -sSL https://raw.githubusercontent.com/andrewferrier/memy/main/install.sh | sh
```
### Download .deb-based package for Debian / Ubuntu
- [x86_64/amd64](https://github.com/andrewferrier/memy/releases/latest/download/memy_latest_amd64.deb)
- [ARM64](https://github.com/andrewferrier/memy/releases/latest/download/memy_latest_arm64.deb)
[Install using dpkg or apt](https://unix.stackexchange.com/a/159114/18985). Currently, Debian packages are not in a signed repository.
### Download .rpm-based package for RHEL / Fedora / CentOS / OpenSUSE / SLES
- [x86_64/amd64](https://github.com/andrewferrier/memy/releases/latest/download/memy_latest_amd64.rpm)
- [ARM64](https://github.com/andrewferrier/memy/releases/latest/download/memy_latest_arm64.rpm)
[How to install RPMs](https://phoenixnap.com/kb/how-to-install-rpm-file-centos-linux).
### Download Binaries for Linux or MacOS from GitHub
- [Linux (x86_64)](https://github.com/andrewferrier/memy/releases/latest/download/memy-linux-x86_64)
- [Linux (x86_64) - Static Binary using musl](https://github.com/andrewferrier/memy/releases/latest/download/memy-linux-x86_64-musl)
- [Linux (ARM64)](https://github.com/andrewferrier/memy/releases/latest/download/memy-linux-aarch64)
- [Linux (ARM64) - Static Binary using musl](https://github.com/andrewferrier/memy/releases/latest/download/memy-linux-aarch64-musl)
The binaries for MacOS are not currently signed, and so [you will have to work around this](https://www.macworld.com/article/672947/how-to-open-a-mac-app-from-an-unidentified-developer.html).
- [MacOS (Apple Silicon)](https://github.com/andrewferrier/memy/releases/latest/download/memy-macos-aarch64)
- [MacOS (Intel)](https://github.com/andrewferrier/memy/releases/latest/download/memy-macos-x86_64)
Download the appropriate binary for your platform, place it somewhere in your `$PATH`, and make it executable if necessary. For example:
```sh
chmod +x memy-
mv memy- /usr/local/bin/memy
```
### Install via Cargo (from Source)
If you have [Cargo](https://doc.rust-lang.org/cargo/) installed, you can install memy directly from the very latest source (main branch). This version may have more recent changes than the packaged versions linked above and so may be more unstable.
```sh
cargo install --git https://github.com/andrewferrier/memy
```
Don't have Cargo? It's Rust's package manager and build tool. The easiest way to get Cargo (and Rust) is to use [rustup](https://rustup.rs/), which works on Linux, macOS, and Windows. See [the official instructions](https://doc.rust-lang.org/cargo/getting-started/installation.html).
## Configuration & Under the Hood
By default, memy looks for its config file at `$XDG_CONFIG_HOME/memy/memy.toml` (typically `~/.config/memy/memy.toml`). You can override the config location by setting the `MEMY_CONFIG_DIR` environment variable to a directory of your choice.
If you don't already have a config file, you can create a default/template one in the default location like this (be careful not to overwrite one that already exists):
```sh
memy generate-config > ~/.config/memy/memy.toml
```
The config file will be annotated with comments explaining what each option does.
By default, memy stores its database in `$XDG_STATE_HOME/memy/memy.sqlite3` (typically `~/.local/state/memy/memy.sqlite3`). You can override the database location by setting the `MEMY_DB_DIR` environment variable to a directory of your choice.
## More Information
- For a full list of commands and flags, run `memy --help`. If you are using one of the `.deb`-packaged versions of memy, you can also bring up the manpage: `man memy`.
- For release notes, see [CHANGELOG.md](CHANGELOG.md)
- Issues and contributions welcome at [https://github.com/andrewferrier/memy](https://github.com/andrewferrier/memy)
## Comparison with Similar Tools
Here's how **memy** compares to other popular directory/file jump and tracking tools:
| Feature | [memy](https://github.com/andrewferrier/memy) | [zoxide](https://github.com/ajeetdsouza/zoxide) | [autojump](https://github.com/wting/autojump) | [z](https://github.com/rupa/z) | [fasd](https://github.com/whjvenyl/fasd) | [fasder](https://github.com/clarity20/fasder) |
| ----------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **Platforms supported** | ✅ (Linux, macOS) | ✅ (Linux, macOS, Windows) | ✅ (Linux, macOS, Windows) | ✅ (Linux, macOS, Windows) | ✅ (Linux, macOS, Windows) | ✅ (Linux, macOS, Windows) |
| **Tracks Files** | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ |
| **Tracks Directories** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Actively Maintained** |  |  |  |  |  |  |
| **Customizable** | ✅ (TOML config) | ✅ (config file & env vars) | ✅ (Some) | ❌ (Limited) | ❌ (Limited) | ✅ (config file & env vars) |
| **Database Format** | SQLite | SQLite | Text | Text | Text | Text |
| **Written in** | Rust | Rust | Python | Shell | Shell | Go |