Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/dhth/hours

A no-frills time tracking toolkit for command line nerds
https://github.com/dhth/hours

time-tracker time-tracking tui

Last synced: 7 days ago
JSON representation

A no-frills time tracking toolkit for command line nerds

Lists

README

        

# hours

`hours` is a no-frills time tracking toolkit for the command line.

It's designed for users who want basic time tracking for their tasks/projects
right in the terminal. With a simple and minimalistic UI, almost everything in
`hours` can be achieved with one or two keypresses. It can also generate
plaintext reports, summary statistics, and logs based on time tracked.

![Usage](https://tools.dhruvs.space/images/hours/hours.gif)

[Link to Video][2]

🤔 Motivation
---

For a while, I've been wanting to keep track of time I spend on side projects
and other non-day-job activities. I also wanted to be able to generate plain
text reports to get an overview of time allocation. All of this needed to be
done via a fast command line tool that prioritised ease of use over
fancy-but-ultimately-not-so-useful features. I couldn't find a tool that
precisely fit these needs, so I decided to build one for myself.

💾 Install
---

**homebrew**:

```sh
brew install dhth/tap/hours
```

**go**:

```sh
go install github.com/dhth/hours@latest
```

⚡️ Usage
---

### TUI

Open the TUI by simply running `hours`. The TUI lets you do the following:

- create/update tasks
- start/stop tracking time on a task
- add manual task log entries
- deactivate/activate a task
- view historical task log entries

![Usage](https://tools.dhruvs.space/images/hours/tui-1.png)

![Usage](https://tools.dhruvs.space/images/hours/tui-2.png)

![Usage](https://tools.dhruvs.space/images/hours/tui-3.png)

Besides a TUI, `hours` also offers reports, statistics, and logs based on the
time tracking you do. These can be viewed using the subcommands `report`,
`stats`, and `log` respectively.

### Reports

```bash
hours report [flags] [arg]
```

Output a report based on task log entries.

Reports show time spent on tasks per day in the time period you specify. These
can also be aggregated (using `-a`) to consolidate all task entries and show the
cumulative time spent on each task per day.

Accepts an argument, which can be one of the following:

today: for today's report
yest: for yesterday's report
3d: for a report on the last 3 days (default)
week: for a report on the current week
date: for a report for a specific date (eg. "2024/06/08")
range: for a report for a date range (eg. "2024/06/08...2024/06/12")

*Note: If a task log continues past midnight in your local timezone, it will be
reported on the day it ends.*

![Usage](https://tools.dhruvs.space/images/hours/report-1.png)

Reports can be viewed via an interactive interface by using the
`-i`/`--interactive` flag.

### Logs

```bash
hours log [flags] [arg]
```

Output task log entries.

Accepts an argument, which can be one of the following:

today: for log entries from today
yest: for log entries from yesterday
3d: for log entries from the last 3 days (default)
week: for log entries from the current week
date: for log entries from a specific date (eg. "2024/06/08")
range: for log entries from a specific date range (eg. "2024/06/08...2024/06/12")

*Note: If a task log continues past midnight in your local timezone, it'll
appear in the log for the day it ends.*

![Usage](https://tools.dhruvs.space/images/hours/log-1.png)

Statistics
---

```bash
hours stats [flag] [arg]
```

Output statistics for tracked time.

Accepts an argument, which can be one of the following:

today: show stats for today
yest: show stats for yesterday
3d: show stats for the last 3 days (default)
week: show stats for the current week
month: show stats for the current month
date: show stats for a specific date (eg. "2024/06/08")
range: show stats for a specific date range (eg. "2024/06/08...2024/06/12")
all: show stats for all log entries

*Note: If a task log continues past midnight in your local timezone, it'll
be considered in the stats for the day it ends.*

![Usage](https://tools.dhruvs.space/images/hours/stats-1.png)

📋 TUI Reference Manual
---

```text
"hours" has 5 panes:
- Tasks List View Shows your tasks
- Task Management View Allows you to create/update tasks
- Task Log List View Shows your task log entries
- Inactive Tasks List View Shows inactive tasks
- Help View (this one)

Keyboard Shortcuts

General

1 Switch to Tasks List View
2 Switch to Task Log List View
3 Switch to Inactive Task Log List View
Go to next view/form entry
Go to previous view/form entry
? Show help view

General List Controls

h/ Move cursor up
k/ Move cursor down
h Go to previous page
l Go to next page
Refresh list

Task List View

a Add a task
u Update task details
s Toggle recording time on the currently selected task,
will open up a form to record a comment on the
second "s" keypress
Add a manual task log entry
Go to currently tracked item
Deactivate task

Task Log List View

Delete task log entry
Refresh list

Inactive Task List View

Activate task

Task Log Entry View

enter Save task log entry
```

Acknowledgements
---

`hours` is built using the TUI framework [bubbletea][1].

[1]: https://github.com/charmbracelet/bubbletea
[2]: https://www.youtube.com/watch?v=o244r1nyxac