- Rust 100%
| src | ||
| .gitignore | ||
| bhu.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE.md | ||
| README.md | ||
Bash History Utils
Various utilities to help make your bash history more useful.
Features
- Bash History Filtering
- Remove duplicate commands from your bash history
- Remove commands that you use a lot and don't want cluttering your bash history (such as
ls,cd,clear, etc.; which commands you want to delete is configurable!)
Usage
Create a config file ./bhu.toml with the application configuration (there is an example in this repo). You can test
how this will affect your Bash history by running:
bash-history-utils clean /path/to/.bash_history
This will by default print the Bash history with your filters applied. If you want to apply this to your Bash history, you can run:
bash-history-utils clean /path/to/.bash_history > ~/.bash_history
Note that this will overwrite your bash history file.
Automatically Run
You can make this application run automatically when starting a shell by appending the following to your ~/.bashrc:
bash-history-utils clean /path/to/.bash_history > ~/.bash_history
This snippet makes the following assumptions:
- The
bash-history-utilsexecutable is on your$PATH. - The config file
~/bhu.tomlexists. You can change this path by adding the flag-f /path/to/bhu.toml.
Roadmap
Milestone 1
- history cleanup thing you can manually run / execute as a cronjob/systemd timer/bashrc command
- remove commands based on your filters
- command names such as
ls,clear - commands with specific flags (
ls -l) - duplicate commands
- command names such as
Milestone 2
- start working on rich history stuff
- keeping track of cwd
- integrate with bash somehow to grab command metadata (env vars, working directory, etc.)
- make a cli search tool for rich history or integrate into an existing one
Milestone 3
- more rich history metadata
- customized env vars
- nix shell params if available
- output files
- make search tool able to replicate environment,
- maybe integrate search tool into fzf?
Milestone 4
(this one is probably useless so maybe never)
- cross-host shell history
- sync history over SSH connections
- reconnect to remote hosts for reloading commands
License
This program is licensed under the GNU General Public License, Version 3.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see
https://www.gnu.org/licenses/.