FV's blog

Timet

Timet: A Powerful Command Line Tool for Tracking Your Time

Updated on: 2024-10-11

Gem Version

Timet is a Ruby-based command-line time tracking tool designed to help you effortlessly track your work hours and monitor your productivity directly from your terminal. With Timet, you can log the time spent on various tasks and projects using simple text commands, making it ideal for users who prefer a lightweight and efficient solution without the need for a graphical interface.

Utilizing SQLite for local data storage, Timet ensures that your time tracking data is stored securely on your device. This approach eliminates the need for external databases or cloud storage, offering a fast, lightweight, and privacy-focused solution. Whether you’re curious about how you allocate your time or need a reliable tool for managing your work hours, Timet provides a straightforward and effective way to keep track of your activities.

Why Timet?

Timet is designed to track the time you spend on various tasks locally, without relying on external databases or cloud storage. It uses SQLite to store the time tracking data, ensuring that your data remains secure and private. With Timet, you get:

Key Features:

  • Local Data Storage: Timet utilizes SQLite to store your time tracking data locally, ensuring privacy and security.
  • Lightweight and Fast: Its efficient design and local data storage make Timet a speedy and responsive tool.
  • Structured Data: SQLite ensures your data is organized and easily accessible.
  • Scalability: Timet can handle growing time tracking needs.
  • Data Integrity: SQLite maintains the accuracy and consistency of your data.
  • Querying and Reporting: Generate detailed reports for specific periods.
  • CSV Export: Easily export your time tracking data to CSV format for further analysis or sharing.
  • Pomodoro Integration: The pomodoro option in the start command enhances time tracking by integrating the Pomodoro Technique.
  • Block Time Plot: Visualizes the distribution of tracked time across a 24-hour period, with bars in each column representing the amount of time tracked during that specific hour.
  • Tag Distribution Plot: Illustrates the proportion of total tracked time allocated to each tag, showing the relative contribution of each tag to the overall time tracked.

Getting Started with Timet

Timet requires Ruby version 3.0.0 or greater and sqlite3 version 1.7 or above to function properly. There are alternative installations for older Ruby and Sqlite versions as well.

Installation

You can install Timet directly using the gem command:

gem install timet

Using Timet

Timet offers a straightforward command-line interface for tracking your time. Here’s a breakdown of some essential commands:

  • Start Tracking Time:

    Use the timet start command to begin tracking time for a specific task using with a note and “pomodoro time” in minutes (optional).

    For instance, to start tracking time for a task named “task1”, you would run:

timet start task1 --notes="My notes" --pomodoro=25

or 

timet start task1 "My notes" 25
  • Stop Tracking Time:

    To stop tracking the current task and record the elapsed time, use the timet stop command. This will also display a report summarizing the total time spent on all tasks.

  • Resume Tracking:

    If you need to pause your work and then pick up where you left off, the timet resume command allows you to resume tracking a previously stopped task.

  • Edit a task: To modify the details of a previously recorded task, use the timet edit [id] command. Replace [id] with the unique identifier of the task you wish to edit. This command allows you to update the task’s notes, tag, start time, or the end time.

    Example:

  timet edit 1 notes "New Meeting Notes"
  • View Time Reports:

    Timet offers various options for generating time reports:

    CommandDescription
    timet su tGet a report of tracked time for the current day.
    timet su yView a report of tracked time for yesterday.
    timet su wSee a report of tracked time for the entire week.
    timet su rResume tracking the last task you were working on.
    timet su mView a report for the previous month.
    timet su [date]Display a report of tracked time for a specific date.
    timet su [start_date]..[end_date]Display a report of tracked time for a date range.

Date Range in Summary

The timet summary command now supports specifying a date range for generating reports. This allows users to filter and summarize data within specific date intervals. The date format is in ISO 8601 format (YYYY-MM-DD).

Examples:

  • Single Date: Display a report for a specific date.

    timet su 2024-01-03
    
  • Date Range: Display a report for a date range.

    timet su 2024-01-02..2024-01-03
    
  • Export Time Reports to CSV:

    The summary command has the option to export your time data to a CSV file by specifying the —csv flag. For example:

timet su t --csv=file.csv

This will create a CSV file (summary_today.csv) containing all tracked tasks for the current day, making it easy to share or import into other tools. You can use this flag with any of the summary filters (t, y, w, m).

When exporting to CSV, timestamps for start and end times are converted to a readable date format (YYYY-MM-DD HH:MM:SS), ensuring compatibility with software like Excel or LibreOffice.

  • Delete Tasks:

    The timet d [id] command allows you to remove unwanted tasks. You can find the task ID from the time reports generated using the summary commands.

  • Cancel Tracking:

    Use timet c to stop any active time tracking.

Conclusion

Timet is a minimalistic tool for time tracking that offers all the necessary features without unnecessary complexity. It empowers developers and professionals to track their tasks with accuracy, all while keeping data secure and local. By leveraging SQLite, it ensures fast data queries, integrity, and a scalable structure, making it a robust solution for time tracking.

If you’re someone who values privacy, control, and ease of use in time tracking, Timet is the perfect companion for your workflow. Give it a try today and take back control of your time!

Profile
This work by Frank Vielma is licensed under a Creative Commons Attribution-NonCommercial 4.0 License.
© 2024 Frank Vielma