1.46.1 • Published 21 days ago

track-time-cli v1.46.1

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

track-time-cli -- A CLI Time Tracker

NPM Version Downloads Stats CI GitHub Workflow Status

track-time-cli is a Node.JS CLI utility for tracking tasks in time sheets, inspired by ruby's timetrap (sadly not maintained).

It supports natural language specification of entry start and end times, allowing you to check out of entries retroactively, or check in after already starting a task without leaving any time untracked. The database is a JSON file stored in your home folder, at ~/.track-time-cli/db.json.

Example Usage

Below are a few example commands to illustrate the usual workflow for managing and viewing time sheet entries.

tt sheet work
tt in --at '2 hours and 24 minutes ago' crafting something
tt out
tt list --since '4 hours ago'
tt today
tt week

Installation

track-time-cli is available as an NPM package; install it with your package manager of choice. For example, if you use npm, run npm i -g track-time-cli.

Once installed, it will be available as the tt command.

Commands

track-time-cli provides commands for both managing time sheet entries, and viewing historical activity in a variety of ways. To see a full list, run tt --help.

Managing Time Sheets and Entries

The examples listed below use the shorthand command aliases (i.e. e is the alias for the edit command). To view all command aliases, consult tt --help.

  • tt ss -- view a list of all time sheets.
  • tt s <sheet name> -- switch to a sheet by name. It will be automatically created if it does not already exist.

  • tt i <description> -- start a new entry with the given description.

  • tt i --at '<natural language time>' -- start a new entry at a custom time.

  • tt o --at '<natural language time>' -- check out of the current entry at a specified time.

  • tt e <description> -- edit the active entry's description.

  • tt e --entry 32 --delete -- delete an entry by ID (retrieve the ID with tt list).

  • tt e --sheet <sheet name> --name <new sheet name> -- change the name of a time sheet

  • tt r -- starts (resumes) an entry with the same description as the previous one.

View Historical Activity

Several commands are available to consult the database, either per-sheet or for all sheets together.

  • tt l -- list sheet entries for the previous 24 hours; provide --all-sheets to view entries for all sheets at once. Passing --since <natural language time> will set the start date from which to list entries, while passing --all will list sheets from the start of time. This command has many arguments, for a full list see tt l --help.
  • tt w -- view a breakdown of activity for the past week.
  • tt t -- view a list of entries from today.
  • tt y -- view a list of entries from yesterday.
  • tt b -- view a breakdown of activity by day, weekday and hour.

Useful Flags

Nearly all commands allow durations to be displayed in a human-readable format with the -h flag (for example, rendering 1:36:18 as 1 hour, 36 minutes), and dates and times to be shown as relative to the current time with the -r flag (converting 2/5/2024, 5:49:44 PM to 3 hours ago).

Help Reference

For reference, the full output of tt --help is reproduced below:

track-time-cli now

Display all active time sheet entries

Commands:
  track-time-cli in <description..>    Check in to a time sheet     [aliases: i]
  track-time-cli now                   Display all active time sheet entries
                                                                       [default]
  track-time-cli out                   Check out of the active time sheet entry
                                                                    [aliases: o]
  track-time-cli week [sheets..]       Display a summary of activity for the
                                       past week                    [aliases: w]
  track-time-cli list [sheets..]       List all time sheet entries  [aliases: l]
  track-time-cli edit [description..]  View, edit, or delete a time sheet entry
                                                                    [aliases: e]
  track-time-cli today [sheets..]      Display a summary of activity for today
                                                                    [aliases: t]
  track-time-cli sheet [name]          Switch to or delete a sheet by name
                                                                    [aliases: s]
  track-time-cli sheets                List all sheets             [aliases: ss]
  track-time-cli resume                Start a new entry with the same
                                       description as the previous one
                                                                    [aliases: r]
  track-time-cli yesterday [sheets..]  Display a summary of activity for
                                       yesterday                    [aliases: y]
  track-time-cli breakdown [sheets..]  Display total durations per day for one
                                       or more sheets               [aliases: b]

Options:
      --version   Show version number                                  [boolean]
  -h, --humanize  Print the total duration in human-readable format    [boolean]
      --help      Show help                                            [boolean]

Examples:
  tt in --at "20 minutes ago" fixing a bug  Check in at a custom time
  tt out --at "5 minutes ago"               Check out at a custom time
  tt list --today --all                     View all entries from today
  tt b                                      Show a breakdown of your activity
  tt today --all                            View activity for the current day

Release History

See CHANGELOG.md for more information.

License

Distributed under the MIT license. See LICENSE.md for more information.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
1.46.1

21 days ago

1.45.0

2 months ago

1.46.0

2 months ago

1.43.1

2 months ago

1.43.2

2 months ago

1.42.1

2 months ago

1.43.0

2 months ago

1.42.0

2 months ago

1.41.3

2 months ago

1.41.2

2 months ago

1.41.1

2 months ago

1.39.1

3 months ago

1.37.3

3 months ago

1.39.0

3 months ago

1.38.0

3 months ago

1.41.0

3 months ago

1.36.0

3 months ago

1.35.2

3 months ago

1.35.1

4 months ago

1.33.1

4 months ago

1.35.0

4 months ago

1.34.0

4 months ago

1.25.0

4 months ago

1.29.0

4 months ago

1.29.1

4 months ago

1.27.0

4 months ago

1.29.2

4 months ago

1.30.0

4 months ago

1.26.0

4 months ago

1.28.0

4 months ago

1.24.0

4 months ago

1.18.1

5 months ago

1.18.0

5 months ago

1.14.4

5 months ago

1.16.0

5 months ago

1.21.0

4 months ago

1.23.0

4 months ago

1.19.0

5 months ago

1.17.1

5 months ago

1.17.0

5 months ago

1.19.1

5 months ago

1.20.1

5 months ago

1.22.0

4 months ago

1.20.2

4 months ago

1.20.0

5 months ago

1.20.3

4 months ago

1.14.1

5 months ago

1.14.0

5 months ago

1.14.3

5 months ago

1.14.2

5 months ago

1.13.2

5 months ago

1.12.1

5 months ago

1.13.1

5 months ago

1.13.0

5 months ago

1.12.0

5 months ago

1.9.0

5 months ago

1.8.0

5 months ago

1.7.1

5 months ago

1.6.0

5 months ago

1.3.3

5 months ago

1.3.2

5 months ago

1.4.0

5 months ago

1.3.1

5 months ago

1.3.0

5 months ago

0.0.30

11 months ago

0.0.31

11 months ago

0.0.32

11 months ago

0.0.33

11 months ago

0.0.29

11 months ago

1.11.0

5 months ago

1.10.1

5 months ago

1.10.0

5 months ago

0.0.28

12 months ago

0.0.27

12 months ago

0.0.26

12 months ago

0.0.25

12 months ago

0.0.24

12 months ago

0.0.23

12 months ago

0.0.22

12 months ago

0.0.21

12 months ago

0.0.20

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago