Skip to content

A CLI tool to log daily work, categorize tasks, and generate reports.

Notifications You must be signed in to change notification settings

elmiomar/worklog-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Worklog CLI

A CLI tool to log daily work, categorize tasks, and generate reports.

Why This Tool Was Made

While reading the book The Software Engineer's Guidebook by Gergely Orosz, I came across the concept of a work log (or brag document). This idea inspired me to create a tool that helps implement and maintain this work log approach in a structured and efficient manner.

Current Status

This tool is functional but not fully tested yet. It is still missing a few features (e.g., PDF report generation) and may require further enhancements for optimal use.

How to Install

To install the Worklog CLI tool, follow these steps:

  1. Clone the repository:

    git clone https://github.com/elmiomar/worklog-cli.git
    cd worklog-cli
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate   # On Windows: venv\Scripts\activate
  3. Install the tool in editable mode:

    pip install -e .
  4. Verify the installation:

    worklog --help

Commands

Initialize Logs

worklog init [-d CUSTOM_DIRECTORY]

Initializes the logs directory. By default, it creates ~/worklog/. You can specify a custom directory with the -d option.

Add Log

worklog add -m "Fixed bug" -c bug -i

Adds a new log entry.

Options:

  • -m, --message: The log message (required).
  • -c, --category: The category of the log (bug, feature, fix, meeting, note, refactor). Default is note.
  • -i, --important: Marks the log as important.

List Logs

worklog list [--date YYYY-MM-DD] [--category CATEGORY] [--important]

Lists logs with optional filters.

Options:

  • --date: Filter logs by a specific date.
  • --category: Filter logs by category.
  • --important: Show only important logs.

Generate Reports

worklog report weekly --format md

Generates a report for a specific timeframe (weekly, monthly, or yearly) and saves it in Markdown (md) or PDF format.

Options:

  • --format: Report format (md or pdf). Default is md.

Edit Log

worklog edit LOG_ID -m "Updated message"

Edits an existing log entry by its unique ID.

Options:

  • -m, --message: Updates the log message.
  • -c, --category: Updates the log category.
  • -i, --important: Marks the log as important.
  • --unimportant: Removes the important flag from the log.

Delete Log

worklog delete LOG_ID

Deletes a log entry by its unique ID.

Configuration

The tool uses a configuration file (config.json) stored in the root of the logs directory. It contains the path to the logs directory and other settings.

Directory Structure

The logs and reports are stored in a structured format:

~/.worklog/
    config.json           # Configuration file
    data/
        logs/            # JSON log files (organized by date)
    reports/             # Generated reports

Examples

  1. Initialize with default directory:

    worklog init
  2. Initialize with a custom directory:

    worklog init -d /path/to/custom/worklog
  3. Add a log entry:

    worklog add -m "Implemented user authentication" -c feature -i
  4. List logs for a specific date:

    worklog list --date 2025-01-17
  5. Generate a weekly report:

    worklog report weekly --format md

License

MIT License

Copyright (c) 2025

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.

About

A CLI tool to log daily work, categorize tasks, and generate reports.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages