Simple command line work logger
Project description
klogg — simple command line work logger
klogg is a small command-line tool for keeping simple timestamped work logs. It's designed to be minimal and friction-free: append entries with a single command and view per-day or per-month summaries including durations.
Project
-
Name: klogg
-
Author: Predrag Mandic predrag@nul.one
-
License: MIT
Installation
From the project root you can install locally:
-
Editable install (for development): pip install -e .
-
Or build and install: pip install .
klogg exposes a console script named klogg (entry point: klogg.cli:main).
Log files and layout
- Default log directory: /home/peja/.config/klogg
- Monthly log files are named YYYY-MM.log (for example: /home/peja/.config/klogg/2025-12.log).
- There is also legacy support for
default.log.
Log line format
Each log line is written with a timestamp and the message:
YYYY-MM-DD HH:MM:SS>
Example: 2025-12-15 11:15:00> Fixed the widget
Special markers
- — marks the start of a session (the line itself is not shown in summaries; it acts as a starting timestamp for the next entry).
- — marks a short break. Break entries are excluded from total time calculations.
Commands
When you run klogg without a subcommand it behaves like klogg day and shows today's entries.
Common commands:
-
klogg --help Show usage and available commands and options.
-
klogg --version Print the installed klogg version.
-
klogg add (alias: klogg a ) Append a timestamped log line with the given message. Example: klogg add Fixed the widget
-
klogg break [message] (aliases: b, p) Append a break entry. If you pass a message it becomes: " " Example: klogg break grabbed coffee
-
klogg start (alias: s) Append the literal "" marker.
-
klogg ls [WHEN] Print raw log lines for a month. WHEN formats accepted:
- YYYY-MM (exact month)
- MM (assumes current year) If omitted, shows the current month's raw lines.
-
klogg day [WHEN] (alias: d) Show parsed entries for a day with durations and totals. WHEN accepted:
- YYYY-MM-DD
- MM-DD (assumes current year)
- DD (assumes current month & year)
- -N (negative integer, e.g. -1 for yesterday; when passed as a positional argument it must be prefixed with
--so the CLI doesn't treat it as an option:klogg day -- -1) Output format: YYYY-MM-DD HH:MM:SS [HH:MM]> MARKER_AND_DESCRIPTION The total excludes entries that begin with "". Options: --grep, -g Filter entries by a case-insensitive substring. Only matching entries are shown and included in the reported total.
-
klogg week [WHEN] (alias: w) Show parsed entries for an ISO week with durations and a total. WHEN accepted:
- WW (week number, assumes current year)
- YYYY-WW (year-week, e.g. 2025-52)
- -N (negative integer, e.g. -1 for previous week; when passed positionally use
--as inklogg week -- -1) Weeks follow ISO week numbering (date.isocalendar()), so week 1 is the first ISO week of the year. Options: --grep, -g Filter entries by a case-insensitive substring. Only matching entries are shown and included in the reported total.
-
klogg month [WHEN] (alias: m) Show parsed entries for a month and a total. WHEN accepted:
- YYYY-MM
- MM (assumes current year)
- -N (negative integer, e.g. -1 for previous month; when passed positionally use
--as inklogg month -- -1) Options: --grep, -g Filter entries by a case-insensitive substring. Only matching entries are shown and included in the reported total.
-
klogg rm Remove the last log entry from the most recent log file. The command prints the last entry and asks for confirmation before deleting.
Behavior notes
- Each appended entry uses the current timestamp as the "end time" for the task. Durations are computed as the difference between an entry's timestamp and the previous entry's timestamp.
- The "" line is not printed in day/month summaries; it only sets the "previous timestamp" for the next entry.
- Breaks ("") are printed but excluded from the totals.
Development notes
- Python: requires >=3.8
- Dependencies:
- click >= 8.0
- click-aliases >= 1.0
Relevant files
- CLI implementation: src/klogg/cli.py
- Package metadata: pyproject.toml
License
MIT
Contributing
Bug reports and pull requests are welcome. Keep changes small and focused.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file klogg-0.1.7.tar.gz.
File metadata
- Download URL: klogg-0.1.7.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b0e80fa987369acef747be5c8372a9581d2b21823ae61c830a982e8963b5f9
|
|
| MD5 |
5e5fa7a13c3db4ad7a34e2e568d9d05a
|
|
| BLAKE2b-256 |
db163cc2692199c047f606cee8880b7acc82932efe2325de65ffb01b69dcd78e
|
File details
Details for the file klogg-0.1.7-py3-none-any.whl.
File metadata
- Download URL: klogg-0.1.7-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ef20c2754334cd53206c47929ba5a9038ab21fcb12ac71f2bd4161d0b74463
|
|
| MD5 |
dd01c4b6f874589a0d21f4a93fc43bb5
|
|
| BLAKE2b-256 |
226b7a85f801410a92a14eaaa6e58ddbd6e3bcfffe4f0c91bd314c4d6729a1be
|