GTM Terminal Plugin

Plugin for Bash or ZSH to be used with the Git Time Metric platform

15 stars
5 forks
GTM Logo
Git Time Metric

Terminal Git Time Metrics (GTM) plug-in

Simple, seamless, lightweight time tracking for all your git projects

Git Time Metrics (GTM) is a tool to automatically track time spent reading and working on code that you store in a Git repository. By installing GTM and using supported plug-ins for your favorite editors, you can immediately realize better insight into how you are spending your time and on what files.


Installing GTM is a two step process. First, it's recommended you install the GTM executable that the plug-in integrates with and then install the Terminal GTM plug-in. Please submit an issue if you have any problems and/or questions.

  1. Follow the Getting Started section to install the GTM executable for your operating system.
  2. To install the plugin download the shell script and source gtm-plugin.sh from either your .bashrc or .zshrc file. Also make sure the shell script is executable chmod +x gtm-plugin.sh.

Note - to enable time tracking for a Git repository, you need to initialize it with gtm init otherwise it will be ignored by GTM. This is done via the command line.

> cd /path/to/your/project
> gtm init

Consult the README and Wiki for more information.

Note - to use this plugin you must be on GTM version 1.1-beta.1 or higher. To enable terminal tracking on an existing GTM initialized Git repository reinitialize with gtm init. To disable terminal tracking for a git repostiory use gtm init --terminal=false.



The time spent in the terminal is included when using the gtm report command.

> gtm report

72b7917 Output golang info for appveyor build
Sat Sep 10 21:30:27 2016 -0500 Michael Schenk

       12m 50s  [r] Terminal
        6m  0s  [r] script/appveyor-build.sh
        2m 10s  [m] appveyor.yml
       21m  0s

Terminal Prompt

The total time spent for in-process work (uncommitted) is exported to GTM_STATUS environment variable. Your terminal prompt can be configured to display the current status.

Command Line Interface

Use the command line to report on time logged for your commits.

Here are some examples of insights GTM can provide you.

$ gtm report -today -author Schenk

7129f00 Remove post processing of status
Fri Sep 09 20:45:03 2016 -0500 gtm-vim-plugin Michael Schenk

       20m 40s  53% [m] plugin/gtm.vim
       18m  5s  46% [r] Terminal
           15s   1% [m] .gitignore
       39m  0s          gtm-vim-plugin 
$ gtm report -format timeline-hours -last-week -author Schenk

Sat Oct 08 |                                                          ▃▃▃             |       17m  0s
Sun Oct 09 |                      ▁▁▁   █████████▃▃▃██████▂▂▂   ▂▂▂                   |    5h 33m  0s
Tue Oct 11 |                                                       ▂▂▂         ▂▂▂    |       16m  0s
Fri Oct 14 |                                     ▂▂▂                                  |       13m  0s
Sat Oct 15 |                            ███▇▇▇███▇▇▇███▁▁▁▇▇▇▂▂▂▁▁▁▃▃▃▆▆▆███▇▇▇       |    8h 11m  0s
                                                                                          14h 30m  0s 

GTM is automatic, seamless and lightweight. There is no need to remember to start and stop timers. It runs on occasion to capture activity triggered by your editor. The time metrics are stored locally with the git repository as Git notes and can be pushed to the remote repository.


To report a bug, please submit an issue on the GitHub Page

Consult the README and Wiki for more information.