Smart command history with inline auto-suggest and fuzzy search for your terminal.
- Auto-save — commands are recorded automatically after successful execution (exit code 0)
- Auto-suggest — inline dropdown appears as you type, no
Ctrl+Rneeded - Fuzzy search —
Ctrl+Ropens a full interactive search with real-time filtering - Smart ranking — frecency scoring (frequency x recency) for relevant results
- Common commands — suggests popular commands (git, npm, docker, etc.) even with empty history
- Daemon mode — persistent background process for sub-millisecond suggest latency (~1-3ms)
- Zero-fork — uses
zsh/net/tcppersistent connection, never spawns a process while typing
You type: git s
┌─────────────────────────────┐
│ › git status (history)
│ git stash (history)
│ git switch main (history)
│ git stash pop (common)
│ git stash list (common)
└─────────────────────────────┘
Tab/Shift+Tab to navigate, Enter to select, Esc to dismiss
Important: This is a CLI tool — install it globally.
# Homebrew
brew install kurovu146/tap/shellwise
# Bun
bun install -g shellwise
# npm
npm install -g shellwiseShell integration is auto-injected into your ~/.zshrc or ~/.bashrc on install. Restart your terminal to activate.
If auto-setup didn't work, add to your shell config:
# ~/.zshrc
eval "$(shellwise init zsh)"
# ~/.bashrc
eval "$(shellwise init bash)"shellwise version and shellwise stats will notify you when a new version is available.
brew upgrade shellwise
bun install -g shellwise@latest
npm install -g shellwise@latestJust start typing — suggestions appear automatically after 2+ characters.
| Key | Action |
|---|---|
Tab |
Next suggestion |
Shift+Tab |
Previous suggestion |
Enter |
Accept selected suggestion |
→ (Right arrow) |
Accept suggestion inline |
Esc |
Dismiss suggestions |
Press Ctrl+R to open full fuzzy search:
| Key | Action |
|---|---|
| Type | Filter results in real-time |
↑ / ↓ |
Navigate results |
Enter |
Accept and paste to command line |
Esc |
Cancel |
Both shellwise and sw work as the command name:
shellwise search [--query <text>] # Interactive fuzzy search (Ctrl+R)
shellwise suggest --query <text> # Get top suggestion (used by shell hook)
shellwise add <cmd> # Save a command to history
shellwise delete [query] # Interactive search & delete a command
shellwise init <zsh|bash> # Output shell integration script
shellwise import [zsh|bash] # Import existing shell history
shellwise stats # Show usage statistics
shellwise prune --days <n> # Remove entries older than n days
shellwise daemon start|stop|status # Manage background daemon
shellwise version # Show current versionOpens an interactive picker to search and delete a command from history:
shellwise delete # Browse all commands, pick one to delete
shellwise delete git # Pre-filter with "git", pick one to delete- Run the command and press
Enterto open the picker - Type to filter results
Tab/↑↓to navigate,Enterto confirm deletion,Escto cancel
shellwise import zsh # Import from ~/.zsh_history
shellwise import bash # Import from ~/.bash_history┌──────────────┐ TCP (persistent) ┌──────────────────┐
│ Zsh/Bash │◄────────────────────────►│ shellwise daemon │
│ (shell) │ ~1-3ms round-trip │ (Bun process) │
└──────────────┘ └────────┬─────────┘
│
┌────────▼─────────┐
│ SQLite (WAL) │
│ history.db │
└──────────────────┘
- Shell hooks (
preexec/precmd) capture commands after execution - Persistent TCP connection opened once at shell init, reused for all queries
- Prepared SQLite statements pre-warmed at daemon start for instant queries
- Frecency scoring = frequency × recency_weight — recent commands rank higher
- Auto-idle shutdown — daemon stops after 30 min of inactivity
~/.local/share/shellwise/history.db # SQLite database
~/.config/shellwise/ # Config (future use)
/tmp/shellwise-<uid>.sock # Unix socket
/tmp/shellwise-<uid>.pid # Daemon PID + port
- Bun >= 1.0.0
- Zsh or Bash
# Homebrew
brew uninstall shellwise
# Bun
bun remove -g shellwise
# npm
npm uninstall -g shellwiseShell integration is automatically removed on uninstall. If you still see errors after uninstalling, manually remove these lines from your ~/.zshrc (or ~/.bashrc):
# shellwise shell integration
eval "$(shellwise init zsh)"To fully clean up data:
rm -rf ~/.local/share/shellwiseMIT