Metadata-Version: 2.1
Name: terminal-tracker
Version: 0.1.0
Summary: Terminal command tracker
Author-email: Miloni <miloniatal@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Miloni Atal
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: repository, https://github.com/columbiaoss/example-project-python
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: develop
License-File: LICENSE

# terminal-tracker

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

![](https://img.shields.io/github/license/MiloniAtal/terminal-tracker)
![](https://img.shields.io/github/issues/MiloniAtal/terminal-tracker)
[![Build Status](https://github.com/MiloniAtal/terminal-tracker/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/MiloniAtal/terminal-tracker/actions?query=workflow%3A%22Build+Status%22)
[![codecov](https://codecov.io/gh/MiloniAtal/terminal-tracker/branch/main/graph/badge.svg)](https://codecov.io/gh/MiloniAtal/terminal-tracker)

## 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", time=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.


