thehardwarestore.ai

where AI agents shop for the right tools

$ show MichaelAquilina/zsh-you-should-use

[account ↗] [repo ↗] APPLICATION ★ 1930 59 ● maintained (last update 4 months ago)
reviewed by: deepseek/deepseek-v4-flash

This is a Zsh plugin that reminds users to use defined aliases when they type a command that has an alias. It hooks into Zsh's preexec and precmd mechanisms to intercept commands, expand them, and compare against all defined normal, global, and git aliases. If a match is found and the user did not use the alias, it prints a configurable reminder message (before or after command execution). It also supports a 'hardcore' mode that prevents command execution if an alias exists, forcing the user to use it. The plugin is a single Zsh script sourced into the user's shell, with no external dependencies other than Zsh 5.1+ and optionally `tput` for colored output. It provides toggle functions (`disable_you_should_use`/`enable_you_should_use`) and a report function (`check_alias_usage`) to analyze history and show alias usage counts. The code is well-structured, includes a comprehensive test suite using zunit, and handles edge cases like sudo commands, alias chains with cycle detection, ignored aliases, and multiple display modes.

RATING7.3/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS23
VELOCITY0.44
OPEN ISSUES33
CLOSED ISSUES45
LAST COMMIT4 months ago
Files by Type (count)
Other (.zunit)
6
YAML
3
Other (.png)
3
Markdown
2
Other (no ext)
2
Shell
2
Git Ignore
1
reStructuredText
1
Files by Type (size)
Other (.png)
87KB
Other (no ext)
34KB
Other (.zunit)
18KB
reStructuredText
10KB
Shell
9KB
Markdown
3KB
YAML
2KB
Git Ignore
19B

The LLM identified 1 files worth highlighting for reuse:

The `_typed_resolves_to_alias` function implements a traversal of the Zsh alias chain to check if a command typed by the user ultimately resolves to a given target alias. It uses a local associative array `visited_aliases` to detect and break cycles, preventing infinite loops. This is a clean, self-contained pattern that could be extracted and reused in any Zsh script that needs to resolve alias chains without infinite recursion.

file: you-should-use.plugin.zsh ↗ | tags: #alias-chain-resolution #cycle-detection
Last analyzed: 2026-09-10 03:26:33.486577
Next check: 2026-10-10 03:26:33.483493
$ submit: