Your shell remembers.
memsh gives it back.
A local shell memory engine for macOS + zsh. It records the commands you actually run and returns them as ranked, directory-aware suggestions — right where you type.
$ curl -fsSL https://raw.githubusercontent.com/charandeep-motive/memsh/main/install.sh | bash
What it does
Small, fast, and local. No cloud, no telemetry — just a SQLite file on your machine.
Learns as you work
Every successful command is recorded automatically via a zsh hook — no manual bookmarking.
Frequency + recency ranking
Suggestions are scored by how often and how recently you've used them, so the useful ones rise.
Directory awareness
Opt in to surface commands you ran in the current directory first, with global as fallback.
Interactive picker
A styled fuzzy-search box inline in your prompt — Ctrl-Space or ↓ to open.
Local-first
Backed by SQLite in your XDG data dir. Your history never leaves your machine.
Clean history
Only exit-code 0 commands are stored, so typos and failures never pollute your suggestions.
Output capture & replay
Optionally record each command's output to a log file and browse it later with memsh logs — an interactive viewer with configurable retention.
Quick start
macOS + zsh. Three steps to a shell that remembers.
Install
Option A — curl (recommended). Installs the latest stable release — the prebuilt binary and zsh plugin for your architecture. No Go toolchain needed.
$ curl -fsSL https://raw.githubusercontent.com/charandeep-motive/memsh/main/install.sh | bash
Pin a specific release with --version:
$ curl -fsSL https://raw.githubusercontent.com/charandeep-motive/memsh/main/install.sh | bash -s -- --version v0.2.0
Option B — from source. Clone the repo and run the installer, which builds the binary with Go.
$ git clone https://github.com/charandeep-motive/memsh.git $ cd memsh $ ./install.sh
Reload your shell
Source your config so the plugin loads.
$ source ~/.zshrc
Just type
Start typing a command. Once you hit a couple of characters, memsh hints that suggestions
are ready — press Ctrl-Space or ↓ to open the picker, then Enter to accept.
Run memsh with no arguments any time to open the search box directly.
Settings
Tune behavior with memsh settings set KEY VALUE (persisted under
~/.config/memsh/settings.zsh), then source ~/.zshrc.
| Setting | Default | What it does |
|---|---|---|
MEMSH_AUTOSUGGEST |
1 | Enable automatic suggestions while typing. |
MEMSH_AUTOSUGGEST_MIN_CHARS |
2 | Minimum typed characters before autosuggest starts. |
MEMSH_MAX_SUGGESTIONS |
5 | Maximum suggestions returned by search and shell flows. |
MEMSH_UI_WIDTH |
100 | Preferred picker width in terminal columns. |
MEMSH_UI_MAX_ITEMS |
10 | Maximum visible commands in the picker. |
MEMSH_ENABLE_DIRECTORY_AWARENESS |
0 | Rank commands used in the current directory first. |
MEMSH_SAVE_LOGS |
0 | Capture command output to log files for later review with memsh logs. |
MEMSH_LOG_RETENTION_DAYS |
10 | Days to retain captured output logs (requires MEMSH_SAVE_LOGS=1). |