A CLI tool to log daily work, categorize tasks, and generate reports.
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.
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.
To install the Worklog CLI tool, follow these steps:
-
Clone the repository:
git clone https://github.com/elmiomar/worklog-cli.git cd worklog-cli
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the tool in editable mode:
pip install -e .
-
Verify the installation:
worklog --help
worklog init [-d CUSTOM_DIRECTORY]
Initializes the logs directory. By default, it creates ~/worklog/
. You can specify a custom directory with the -d
option.
worklog add -m "Fixed bug" -c bug -i
Adds a new log entry.
-m, --message
: The log message (required).-c, --category
: The category of the log (bug
,feature
,fix
,meeting
,note
,refactor
). Default isnote
.-i, --important
: Marks the log as important.
worklog list [--date YYYY-MM-DD] [--category CATEGORY] [--important]
Lists logs with optional filters.
--date
: Filter logs by a specific date.--category
: Filter logs by category.--important
: Show only important logs.
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.
--format
: Report format (md
orpdf
). Default ismd
.
worklog edit LOG_ID -m "Updated message"
Edits an existing log entry by its unique ID.
-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.
worklog delete LOG_ID
Deletes a log entry by its unique ID.
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.
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
-
Initialize with default directory:
worklog init
-
Initialize with a custom directory:
worklog init -d /path/to/custom/worklog
-
Add a log entry:
worklog add -m "Implemented user authentication" -c feature -i
-
List logs for a specific date:
worklog list --date 2025-01-17
-
Generate a weekly report:
worklog report weekly --format md
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.