| Crates.io | t_trace |
| lib.rs | t_trace |
| version | 0.1.3 |
| created_at | 2025-08-19 15:44:54.513257+00 |
| updated_at | 2025-10-30 19:41:43.358339+00 |
| description | High-performance, command-line statistics tracker for your shell |
| homepage | |
| repository | https://github.com/M-Komorek/t_trace |
| max_upload_size | |
| id | 1802117 |
| size | 80,528 |
The t_trace is a high-performance, command-line statistics tracker for your shell.
It silently observes your command-line usage and provides fast, insightful statistics on which commands you run, how often you run them, and how long they take, all with a negligible performance impact on your interactive shell.
The t_trace collects statistics in the background and lets you view them instantly with the stats command.
$ t_trace stats
┌─────────────┬───────────────┬────────────┬─────────────┬───────────┬───────────┐
│ Command ┆ Success Count ┆ Fail Count ┆ Total Time ┆ Mean Time ┆ Last Time │
╞═════════════╪═══════════════╪════════════╪═════════════╪═══════════╪═══════════╡
│ cargo build ┆ 12 ┆ 3 ┆ 13m 57.300s ┆ 55.820s ┆ 1m 2.100s │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ git log ┆ 3 ┆ 0 ┆ 16.575s ┆ 5.525s ┆ 3.116s │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ git status ┆ 58 ┆ 0 ┆ 4.937s ┆ 85.123ms ┆ 75.450ms │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ ls -l ┆ 112 ┆ 0 ┆ 504.112ms ┆ 4.501ms ┆ 3.987ms │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ cd src/ ┆ 1 ┆ 0 ┆ 3.414ms ┆ 3.414ms ┆ 3.414ms │
└─────────────┴───────────────┴────────────┴─────────────┴───────────┴───────────┘
Quickly find all your git related commands:
$ t_trace stats -g git
┌─────────────┬───────────────┬────────────┬─────────────┬───────────┬───────────┐
│ Command ┆ Success Count ┆ Fail Count ┆ Total Time ┆ Mean Time ┆ Last Time │
╞═════════════╪═══════════════╪════════════╪═════════════╪═══════════╪═══════════╡
│ cargo build ┆ 12 ┆ 3 ┆ 13m 57.300s ┆ 55.820s ┆ 1m 2.100s │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ git log ┆ 3 ┆ 0 ┆ 16.575s ┆ 5.525s ┆ 3.116s │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
│ git status ┆ 58 ┆ 0 ┆ 4.937s ┆ 85.123ms ┆ 75.450ms │
└─────────────┴───────────────┴────────────┴─────────────┴───────────┴───────────┘
t_trace into your shell. The daemon starts automatically and manages itself.You need the Rust toolchain installed on your system. If the toolchain is ready, you need to complete two steps: installation and one-time setup.
cargo install t_trace
git clone https://github.com/M-Komorek/t_trace.git
cd t_trace
cargo install --path .
To hook the t_trace into your shell, add the following line to the end of your ~/.bashrc:
eval "$(t_trace init bash)"
Then, either restart your shell or run source ~/.bashrc to apply the changes.
That's it! The t_trace will now start automatically with your shell session and begin tracking commands.
Once installed and set up, the t_trace works silently in the background. You can interact with it using these commands:
| Command | Description |
|---|---|
t_trace stats |
Display your aggregated command statistics in a formatted table. |
t_trace stats -g <phrase> |
Filter the stats to show only commands containing <phrase>. |
t_trace daemon health-check |
Check if the t_trace background daemon is running and responsive. |
t_trace daemon run |
Manually start the daemon (usually handled automatically by the shell script). |
t_trace daemon stop |
Stop the daemon gracefully, ensuring all collected data is saved to disk. |
The t_trace uses a performant client-daemon architecture to avoid slowing down your shell.
t_trace stats, the client fetches the entire dataset from the daemon. All filtering (for the --grep flag), sorting, and table formatting (using comfy-table) happen on the client side. This keeps the daemon's responsibility simple and focused: be a fast, dumb data store.