Crates.io | shi_history |
lib.rs | shi_history |
version | |
source | src |
created_at | 2023-04-23 02:16:53.814549 |
updated_at | 2024-12-30 22:44:57.22348 |
description | A tiny program to add the time and place to your shell history. This also enables you to copy a command to the clipboard. |
homepage | |
repository | https://github.com/kyoheiu/shi |
max_upload_size | |
id | 846295 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
shell history / 史
A tiny program to add the time and place to your shell history.
This also enables you to copy a command to the clipboard.
Sqlite required.
cargo install shi_history
, or
git clone https://git.sr.ht/~kyoheiu/shi
cd shi
cargo install --path .
And add the preexec hook to your shell config file.
(bash-preexec required. See https://github.com/rcaloras/bash-preexec)
source ~/.bash-preexec.sh
preexec() { shi --insert "$@"; }
For zsh or fish, you can use preexec hook.
If you'd like to copy a command to the clipboard, set any clipboard utility such
as xclip
or wl-copy
as $SHI_CLIP
.
At the first launch, shi
creates sqlite database in
$XDG_DATA_HOME/shi/.history
(on Linux, in most case it should be
~/.local/share/shi/.history
).
shi Print latest commands (50 rows)
shi <COMMAND> [ROWS] Show commands that match the query
Options:
-a, --all Print all the history with the directory path where the command was executed
-i, --insert <COMMAND> Insert the command to the history
-r, --remove <ID> Delete the command that matches the id
-p, --path <PATH> [ROWS] Show commands that were executed in directories that match the query
-o, --output Export all the history to `$XDG_DATA_HOME/shi/history.csv`
--drop Drop the database table, deleting all history