Skip to main content

Terminal command tracker

Project description

terminal-tracker

Maintaining and organizing a history of terminal commands executed for a folder/project from any terminal.

Build Status codecov PyPI Documentation Status

Overview

This tools helps with analysing, filtering and segregrating your command history. It also provides functions to support storing of this history in a better format, that can be used share with people or used in future. It recommends commands (based of length of command and frequency of use) that should have an alias.

Main features

  • Recommends commands that should have an alias.
  • It provides support for both zsh and bash shells.
  • Nice format to store and share history

Installing

pip install terminal-tracker

Dependencies

  • pandas
  • pytz

Usage

from terminal_tracker import FrequencyFile
ff = FrequencyFile("zsh_history_file.txt", timeframe=False, shell="zsh")
most_frequent_command = ff.find_most_frequent()

Configurations

These congifurations will help you to better store your history:

zsh

These should be added to /.zshrc

export HISTFILE=~/.zsh_history
export HISTFILESIZE=1000000000      # big big history
export HISTSIZE=1000000000          # big big history
setopt INC_APPEND_HISTORY           # append to history, don't overwrite it
setopt EXTENDED_HISTORY
setopt HIST_FIND_NO_DUPS            # no duplicate entries
setopt HIST_IGNORE_ALL_DUPS         # no duplicate entries
setopt interactivecomments

bash

These should be added to /.bashrc

export HISTCONTROL=ignoredups:erasedups  # no duplicate entries
export HISTSIZE=100000                   # big big history
export HISTFILESIZE=100000               # big big history
shopt -s histappend                      # append to history, don't overwrite it

# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

Coverage and Tests

Tests and coverage can be run using these simple make commands

make coverage
make test

Contributing to terminal_tracker

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terminal_tracker-1.0.1.tar.gz (24.3 kB view details)

Uploaded Source

File details

Details for the file terminal_tracker-1.0.1.tar.gz.

File metadata

  • Download URL: terminal_tracker-1.0.1.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for terminal_tracker-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c2212c4124c8ecbe2fd6773035e3896773e7b5d6f30c79a9380afa6ace2972b6
MD5 1e7dc815d6834d3769fbfdf4bb21163c
BLAKE2b-256 39be8c7379f88e46ec45b7ab2bb9ddd2398b78f18d2f0a0a76dd79fde1bd45a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page