Skip to content

vangie/you-should-use

you-should-use

A shell plugin that helps you work smarter by:

  1. Alias Reminders β€” When you type a full command that has an alias defined, it reminds you to use the alias
  2. Modern Command Suggestions β€” When you use legacy commands (cat, ls, find, grep, etc.), it suggests modern Rust/Go alternatives if they're installed
  3. AI-Powered Suggestions β€” Uses a local LLM (via Ollama) to suggest better ways to write your commands

Supports Zsh, Fish, Bash, and Nushell.

Demos

Alias Reminders

Forgot you had an alias? The plugin gently reminds you.

asciicast

Modern Tool Suggestions

Still using cat, find, or ls? Get suggestions for modern alternatives.

asciicast

AI-Powered Suggestions

With Ollama running locally, get intelligent command rewrites.

asciicast

Status Dashboard

See your full configuration at a glance with ysu status.

asciicast

Quick Start

# Homebrew (macOS β€” recommended)
brew install vangie/formula/you-should-use

# Or one-line install (auto-detects your shell)
curl -fsSL https://raw.githubusercontent.com/vangie/you-should-use/main/install.sh | sh

Then follow the post-install instructions to add the source line to your shell config.

Installation

Homebrew (macOS)

brew install vangie/formula/you-should-use

Then add to your shell config as shown in the post-install message:

# Zsh (~/.zshrc)
source $(brew --prefix)/Cellar/you-should-use/*/you-should-use.plugin.zsh

# Bash (~/.bashrc)
source $(brew --prefix)/Cellar/you-should-use/*/you-should-use.plugin.bash

# Fish
ln -sf $(brew --prefix)/Cellar/you-should-use/*/conf.d/you-should-use.fish ~/.config/fish/conf.d/

Install Script

curl -fsSL https://raw.githubusercontent.com/vangie/you-should-use/main/install.sh | sh

Auto-detects your shell (zsh/bash/fish), clones the repo, and adds the source line to your rc file.

oh-my-zsh

git clone https://github.com/vangie/you-should-use ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/you-should-use

Then add you-should-use to your plugins in ~/.zshrc:

plugins=(... you-should-use)

zinit

zinit light vangie/you-should-use

zplug

zplug "vangie/you-should-use"

Antidote

Add to your .zsh_plugins.txt:

vangie/you-should-use

Fisher (Fish)

fisher install vangie/you-should-use

Oh My Fish

omf install https://github.com/vangie/you-should-use

Manual (Zsh)

git clone https://github.com/vangie/you-should-use ~/.you-should-use
echo 'source ~/.you-should-use/you-should-use.plugin.zsh' >> ~/.zshrc

Manual (Fish)

git clone https://github.com/vangie/you-should-use ~/.you-should-use
ln -sf ~/.you-should-use/conf.d/you-should-use.fish ~/.config/fish/conf.d/

Bash

git clone https://github.com/vangie/you-should-use ~/.you-should-use
echo 'source ~/.you-should-use/you-should-use.plugin.bash' >> ~/.bashrc

Note: Requires Bash 3.2+. Uses DEBUG trap for pre-execution hooks and PROMPT_COMMAND for post-execution processing.

Nushell

git clone https://github.com/vangie/you-should-use ~/.you-should-use

Then add to your config.nu or env.nu:

source ~/.you-should-use/you-should-use.plugin.nu

Note: Requires Nushell >= 0.80. Uses pre_execution hooks. Nushell support is experimental.

Managing the Plugin

ysu update      # Update to the latest version
ysu uninstall   # Remove from your system

These commands auto-detect your install method (Homebrew, oh-my-zsh, zinit, zplug, antidote, Fisher, Oh My Fish, or git clone) and provide the appropriate instructions.

Configuration

All configuration is done via environment variables. Set them in your shell config before the plugin is loaded.

Feature Toggles

YSU_REMINDER_ENABLED=true    # Enable alias reminders (default: true)
YSU_SUGGEST_ENABLED=true     # Enable modern tool suggestions (default: true)
YSU_LLM_ENABLED=true         # Enable AI-powered suggestions (default: false, auto-detected with Ollama)

Display

YSU_PREFIX="πŸ’‘"               # Prefix for all messages
YSU_REMINDER_PREFIX=""        # Extra prefix for alias reminders
YSU_SUGGEST_PREFIX=""         # Extra prefix for tool suggestions
YSU_MESSAGE_FORMAT="{prefix} {arrow} {message}"  # Custom message template

The YSU_MESSAGE_FORMAT variable supports three placeholders:

  • {prefix} β€” The combined prefix (YSU_PREFIX + feature-specific prefix)
  • {arrow} β€” The colored arrow separator (➜)
  • {message} β€” The actual suggestion text

Examples:

YSU_MESSAGE_FORMAT="[{prefix}] {message}"      # No arrow
YSU_MESSAGE_FORMAT="{message}"                   # Message only
YSU_MESSAGE_FORMAT="{prefix}: {arrow} {message}" # Custom separator

Frequency Control

Avoid being too intrusive with these settings:

YSU_PROBABILITY=50           # Show tips 50% of the time (default: 100)
YSU_COOLDOWN=30              # Minimum 30 seconds between tips (default: 0)

Exclusions

YSU_IGNORE_ALIASES="g gc"    # Don't remind about these aliases
YSU_IGNORE_COMMANDS="cat ls" # Don't suggest alternatives for these

Install Hints

When a modern tool alternative is not installed, the plugin can show the install command:

YSU_INSTALL_HINT=true         # Show install commands (default: true)

The plugin auto-detects your package manager (brew, apt, pacman, dnf, zypper, apk, pkg) and generates appropriate install commands. WSL is also detected.

Example output:

πŸ’‘ ➜ Try bat instead of cat β€” Syntax highlighting, line numbers (install: brew install bat)
πŸ’‘ ➜ Try bat instead of cat β€” Syntax highlighting, line numbers (install: sudo apt install bat)

You can customize the install commands mapping:

typeset -gA YSU_INSTALL_COMMANDS
YSU_INSTALL_COMMANDS=(
  bat    "brew install bat"
  eza    "cargo install eza"    # Override default
  myutil "pip install myutil"   # Add custom
)

Custom Modern Command Mappings

Override or extend the default mappings. Use | to separate multiple alternatives β€” the first installed one is suggested.

typeset -gA YSU_MODERN_COMMANDS
YSU_MODERN_COMMANDS=(
  cat    "bat:Syntax highlighting, line numbers, git integration"
  ls     "eza:Modern file listing with icons|lsd:LSDeluxe - colorful ls with icons"
  find   "fd:Simpler syntax, faster, respects .gitignore"
  grep   "rg:Ripgrep - faster, respects .gitignore|ag:The Silver Searcher"
  vim    "nvim:Neovim - modernized Vim fork"
)

LLM Settings

Configure the AI-powered suggestion engine. Works with any OpenAI-compatible API (Ollama, OpenAI, etc.).

YSU_LLM_API_URL="http://localhost:11434/v1"  # API endpoint (default: Ollama)
YSU_LLM_MODEL="auto"                          # Model name or "auto" (picks first available)
YSU_LLM_API_KEY=""                             # API key (not needed for Ollama)
YSU_LLM_MODE="single"                         # single, multi, or both
YSU_LLM_WINDOW_SIZE=5                          # Commands for multi-command analysis

Multi-Command Mode

In multi or both mode, the plugin analyzes your recent command history as a sliding window and suggests workflow optimizations:

YSU_LLM_MODE="both"          # Enable both single-command and multi-command analysis
YSU_LLM_WINDOW_SIZE=5        # Analyze the last 5 commands
  • single β€” Analyze each command individually (default)
  • multi β€” Only analyze command sequences (sliding window)
  • both β€” Analyze both individual commands and sequences

Ollama Auto-Detection: If Ollama is running locally, the plugin automatically enables LLM suggestions β€” no configuration needed.

Commands

ysu status      # Show current configuration and statistics
ysu config      # Interactive configuration wizard
ysu cache       # Manage LLM suggestion cache (clear, size)
ysu doctor      # Run diagnostics and check for issues
ysu discover    # Analyze history and suggest aliases (optional: min count)
ysu update      # Update to the latest version
ysu uninstall   # Remove from your system

ysu doctor

Runs comprehensive diagnostics:

  • Shell version compatibility
  • Hook registration status
  • Plugin load time
  • Config conflict detection
  • Package manager detection
  • LLM connection status
  • Dependency checks

ysu discover

Scans your shell history for frequently typed multi-word commands and suggests creating aliases:

$ ysu discover
  git checkout -b  (used 47 times)
    alias gc='git checkout -b'

  docker compose up  (used 23 times)
    alias dcu='docker compose up'

Pass a threshold to customize: ysu discover 3 (default: 5).

Default Modern Command Mappings

Legacy Command Modern Alternatives Description
cat bat Syntax highlighting, line numbers, git integration
ls eza, lsd Modern file listing with icons, git status, tree view
find fd Simpler syntax, faster, respects .gitignore
grep rg, ag Ripgrep / Silver Searcher - faster, respects .gitignore
du dust, ncdu Intuitive disk usage with visual chart
top btop, htop Beautiful resource monitor with mouse support
ps procs Modern process viewer with tree display
diff delta, colordiff Syntax highlighting, side-by-side view
sed sd Simpler syntax, uses regex by default
curl httpie, curlie Human-friendly HTTP client
ping gping Ping with a graph
dig dog DNS client with colorful output
man tldr Simplified, community-driven man pages
cd zoxide Smarter cd that learns your habits

Note: Suggestions only appear when the modern alternative is actually installed on your system. When multiple alternatives are configured, the first installed one is suggested.

How It Works

The plugin hooks into the shell's pre-execution mechanism (preexec in Zsh, fish_preexec event in Fish, DEBUG trap in Bash, pre_execution hook in Nushell) to intercept commands before they run. It:

  1. Checks if you typed a command that matches an existing alias expansion (alias reminder)
  2. Checks if the command has a known modern alternative that is installed (tool suggestion)
  3. Sends complex commands to a local LLM for intelligent rewrite suggestions (async, cached)

All checks respect the probability and cooldown settings to avoid being annoying. LLM suggestions run asynchronously and display on the next prompt to avoid slowing down your workflow.

Roadmap

  • Zsh support
  • Fish support
  • AI-powered suggestions (Ollama / OpenAI)
  • Install command hints
  • Custom message templates
  • Multi-command workflow analysis
  • Bash support
  • Platform-aware install hints (auto-detect OS)
  • Diagnostic command (ysu doctor)
  • Alias discovery (ysu discover)
  • Nushell support (experimental)
  • Homebrew formula and install script
  • Plugin lifecycle management (ysu update, ysu uninstall)

License

MIT License β€” see LICENSE for details.

Contributing

Contributions are welcome! Feel free to:

  • Add new modern command mappings
  • Improve alias matching logic
  • Add support for more shells or plugin managers
  • Fix bugs or improve documentation

Please open an issue or pull request on GitHub.

About

Shell plugin: alias reminders & modern command suggestions

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors