A shareable terminal assistant shell for Linux that adds:
- Autocorrect for common command typos
- Right-side short command explanation while typing
- Dropdown command suggestions (
Ctrl+Space) - Personalized ranking based on local usage frequency and recency
- Directory typo help for
cd(single-match auto-fix, multi-match list) - Command history suggestions
- Plain-English explanation when commands fail
- Confirmation prompt for risky commands
chmod +x install.sh
./install.sh
smartsh
lazyterminal- Typo map examples:
gti->git,pyhton->python,sl->ls - Fuzzy command correction for unknown command names
- Built-ins:
helpsmartsh configsmartsh reloadsmartsh learning statussmartsh learning reset
smartsh learns from successful commands and ranks suggestions to surface what you use most.
Learned data is stored only on your machine in:
~/.local/share/smartsh/learning.jsonCaptured fields per command:
- Full command string
- Base command (first token)
- Last-used timestamp
- Working directory frequency
- Previous-command context frequency
No network calls, cloud sync, or telemetry upload are used.
Sensitive command filtering is enabled via denylist patterns. Matching commands are not learned. Additionally, sensitive-looking commands are guarded at runtime:
- first attempt is blocked with an error message,
- running the exact same command again asks for confirmation.
Default ranking formula:
score = 0.55*match + 0.20*frequency + 0.20*recency + 0.05*context
where:
match: prefix/substring/fuzzy relevance to current inputfrequency: normalized usage countrecency: exponential decay bylearning_decay_dayscontext: same directory / previous base command bonus
Config file:
~/.config/smartsh/config.jsonUseful keys:
autocorrect_enabledautocorrect_thresholdcommand_explain_enablederror_explain_enabledconfirm_dangeroustypo_mapcustom_commandslearning_enabledlearning_top_nlearning_decay_dayslearning_denylist_patterns
After changing config run:
smartsh
# inside smartsh
smartsh reload
smartsh learning status
smartsh learning resetIf learning.json is corrupted or schema is unsupported, smartsh resets to safe defaults automatically.
chmod +x export_bundle.sh
./export_bundle.shOutput:
dist/smartsh_bundle_YYYYMMDD_HHMMSS.tar.gztar -xzf smartsh_bundle_*.tar.gz
cd smartsh_bundle_*
./install.sh
smartsh
lazyterminal./uninstall.sh- Tested on bash-compatible systems.
- Requires Python 3.10+.