BSH is a cutting-edge CLI middleware designed to enhance terminal usability by replacing traditional history files with a dynamic SQLite database. With context-aware suggestions based on Git branches and command success rates, it streamlines command retrieval and enables a smarter, faster workflow.
BSH (Better Shell History) is an innovative command-line interface (CLI) middleware that revolutionizes the terminal experience by transforming conventional flat history files (such as .zsh_history) into a structured local SQLite database. Built using C++20, BSH is optimized for performance and offers a unique "Live Predictive" Text User Interface (TUI) that provides contextual suggestions based on the current directory, active Git branch, and execution success rates.
Standard shells provide a global history list, which may often yield irrelevant search results. BSH enhances command retrieval with distinct scopes:
The BSH TUI integrates seamlessly with the Zsh Line Editor (ZLE), displaying a dynamically updated "Top 5" list of relevant command suggestions, eliminating the need for traditional search commands like Ctrl+R.
BSH records the exit code of each executed command, offering a "Success Filter" that hides failed commands, such as typos or compilation issues, ensuring that suggestions remain valid and executable.
BSH is designed with a client-daemon architecture that prioritizes data privacy. It operates entirely on the local machine, with no telemetry or command history sent to external servers, adhering to stringent data protection standards.
BSH employs a sophisticated Client-Daemon architecture that achieves sub-5ms latency:
The BSH TUI activates automatically upon command input:
| Key Binding | Action |
|---|---|
Enter | Executes the entered command. |
Alt/Option + 1-5 | Executes the corresponding suggestion from the Top 5 list. |
Alt/Option + Arrows | Cycles through search contexts: Global <-> Directory <-> Git Branch. |
Ctrl + F | Toggles the visibility of commands that failed execution. |
Designed for performance-critical environments, BSH provides a groundbreaking efficiency boost to terminal command history management, making shell interactions smarter and more intuitive.
No comments yet.
Sign in to be the first to comment.