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) Output format: YYYY-MM-DD HH:MM:SS [HH:MM]> MARKER_AND_DESCRIPTION The total excludes entries that begin with "".
  • klogg month [WHEN] (alias: m) Show parsed entries for a month and a total. WHEN accepted:

    • YYYY-MM
    • MM (assumes current year)
  • 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.5.tar.gz (9.4 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.5-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: klogg-0.1.5.tar.gz
  • Upload date:
  • Size: 9.4 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.5.tar.gz
Algorithm Hash digest
SHA256 ea6d11504af47940d73fad2b358ede25d16f85474e990a0f057127ab562f6147
MD5 2811244d4a5c1dad4139e6c065fb10b6
BLAKE2b-256 0e398435674ee945b08c797d1991c4cc863f67ba68baef3cb6c4ce5b226373ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: klogg-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f543c8c13931146c13ed323d9c319c011b14093c025f3e113e8694ed7efd3e43
MD5 6c4f4c7d81476eba7aa45b7f5608728f
BLAKE2b-256 fb890b3b37fdd8624b52ab4b221001c7785de51fae4fa5003bfa705f8a091992

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