Skip to main content

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

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 "".
  • 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 in klogg week -- -1) Weeks follow ISO week numbering (date.isocalendar()), so week 1 is the first ISO week of the year.
  • 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 in klogg month -- -1)
  • 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

klogg-0.1.6.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klogg-0.1.6-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file klogg-0.1.6.tar.gz.

File metadata

  • Download URL: klogg-0.1.6.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for klogg-0.1.6.tar.gz
Algorithm Hash digest
SHA256 edb8ebe88048c1a939a197897674010d373b1771629c9d733dfcb87dbd6b6d69
MD5 3de8d3c7d9dae3a31477fd5d4d7cbed5
BLAKE2b-256 f451438cd1fe7bf95ba4e2519adaadc19a28923df94ee1f87d762b0993e2e4e4

See more details on using hashes here.

File details

Details for the file klogg-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: klogg-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for klogg-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d335cb1b32a9002cfe50172944a2211d6bed3b7bab24c057ffd24b9621ee9d9f
MD5 38c75f83bb90504318374fdaf7c377c7
BLAKE2b-256 b271ecb14ad4fa2e501db0ef649e89acf125e8e70934606c4fe1d103ccb4fa15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page