termstat-0.1.1 is not a library.
💻 Termstat - A tracker for Commands !!!(Still in development)!!!
A complete local command tracker, no Cloud involved. Feel free to try it, but keep in mind, that some things may break in following updates.
How it works
- A Shell prehook logs all commands into a logfile
- If the sync command is called the logfile entries are inserted into a Sqlite database
Installation
- Nix
- Systemd
- Cargo
- From Source
Shell prehook
Add the following to your .zshrc
Nix
Install nix and configure terstat via Homemanager
# flake.nix
# add input
inputs = {
termstat = {
url = "github:marc55s/termstat";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
}
# add overlay to your outputs
outputs = inputs@{self, nixpkgs, termstat ... }:
pkgs = import nixpkgs {
inherit system;
overlays = [ inputs.termstat.overlays.default];
}
# home.nix
{termstat, ...}:
{
programs.termstat = {
enable = true;
enableZshIntegration = true;
systemd = {
enable = true;
onCalendar = "DayOfWeek Year-Month-Day Hour:Minute:Second"; # defaults to daily
}
# Not supported yet
# enableBashIntegration = true;
# enableFishIntegration = true;
# enableIonIntegration = true;
# enableNushellIntegration = true;
};
# add the modules to your imports
imports = [termstat.homeManagerModules.default];
}
Usage
After the initalization the following commands are available:
Help

Sync with database

Statistics

For the statistics these other commandflags are available:
Currently Supported Shells
- Zsh
- Bash
- Fish
- ...
Commands
- sync
- stats --daily, --weekly, --monthly
- init --shell-type [SHELL]
- clean
To Do
- Switch from flags to subcommands
- List available Commands
- Systemd service for syncing automatically
- Nix Packaging / Module
- Support multiple Shelltypes
- Display statistics in a fancy way with a TUI-Lib
- Write Installation Manual
- Publish to Crates.io
- Far future: Support for multiple databases / Syncing across devices
Queries
- Most used command of the day|week|month
- Commands sorted by length
- Common command pipes
- Top exectued binaries