Skip to main content

Crate shellist

Crate shellist 

Source
Expand description

Shell history analysis. Parses .bash_history, counts commands, and ranks by frequency.

let ranked = shellist::analyze("ls\ngit\nls\ncd\ngit\nls");
assert_eq!(ranked, vec![
    ("ls".to_string(), 3),
    ("git".to_string(), 2),
    ("cd".to_string(), 1),
]);

Re-exports§

pub use aggregators::count_commands;
pub use aggregators::filter_by_min_frequency;
pub use aggregators::filter_commands;
pub use aggregators::rank_commands;
pub use aggregators::top_n;
pub use io::default_history_path;
pub use io::load_history_file;
pub use models::HistoryEntry;
pub use parsers::DefaultHistoryParser;
pub use parsers::HistoryParser;
pub use parsers::parse_history;

Modules§

aggregators
Command aggregation: counting, ranking, and filtering.
io
File I/O for loading history files from disk.
models
Domain types for shell history entries.
parsers
Parsers turn raw history text into structured entries.

Functions§

analyze
Full pipeline: raw history text in, ranked commands out.