8000 GitHub - guuzaa/hstats: A command-line tool written in Zig that analyzes shell history files to show command usage statistics.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ hstats Public

A command-line tool written in Zig that analyzes shell history files to show command usage statistics.

License

Notifications You must be signed in to change notification settings

guuzaa/hstats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hstats

A command-line tool written in Zig that analyzes shell history files to show command usage statistics. It supports multiple shell types including bash, zsh, and fish.

Features

  • Supports multiple shell types:
    • bash
    • zsh
    • fish
  • Shows command usage frequency
  • Displays top 10 most used commands
  • Handles different shell history file formats
  • Memory-safe implementation

Prerequisites

  • Zig compiler (version 0.14.0 or later)
  • A shell history file (.bash_history, .zsh_history, or fish_history)

Building

To build the project:

git clone https://github.com/guuzaa/hstats.git
cd hstats
zig build

The executable will be created in zig-out/bin/hstats.

Usage

Basic usage:

hstats --shell <shell_type>

Where <shell_type> can be:

  • bash (default)
  • zsh
  • fish

Examples:

# Analyze zsh history
hstats --shell zsh

# Analyze fish history
hstats --shell fish

# Show help
hstats --help

Output Format

The output shows the command usage statistics in the following format:

<count> <command>

For example:

50 zig build
47 zig build test
37 ls
36 git add .
29 exit

Development

To run tests:

zig build test

To run the program with debug output:

zig build run -- --shell zsh

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A command-line tool written in Zig that analyzes shell history files to show command usage statistics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

0