Skip to content

kithfoss/plainlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

plainlog

Appends a timestamped entry to a plain-text daily log file.


What it does

  • Appends timestamped entries to today's log file
  • Accepts piped input, so shell output can be logged without retyping
  • Shows today's entries when run with no arguments
  • Shows yesterday's log with --yesterday
  • Shows this week's entries with --week
  • Shows last N entries across all days with --tail N
  • Shows a specific day's log with --date YYYY-MM-DD
  • Appends to a specific day's log with --on YYYY-MM-DD "text"
  • Searches all logs with --search TERM
  • Prints today's file path with --file
  • Lets you override the log directory with --dir PATH or PLAINLOG_DIR

Files are plain text stored in ~/logs/ by default. One file per day, named YYYY-MM-DD.txt. No account, no database, no config required.


Install

./install.sh

That creates ~/bin/ if needed, symlinks plainlog.py there as plainlog, makes it executable, and warns if ~/bin is not on your PATH.

Manual install:

chmod +x plainlog.py
mkdir -p ~/bin
ln -sf "$(pwd)/plainlog.py" ~/bin/plainlog

Usage

# append an entry to today's log
plainlog "finished the config work"

# append from stdin or a pipe
printf 'captured deploy output' | plainlog
plainlog - <<'EOF'
wrapped up notes from stdin
EOF

# show today's log
plainlog

# show yesterday's log
plainlog --yesterday

# show this week's entries
plainlog --week

# show last 10 entries across all days
plainlog --tail 10

# show a specific day
plainlog --date 2026-04-07

# append to a past day
plainlog --on 2026-04-07 "wrote the incident notes"

# search all logs for a term
plainlog --search deploy

# print today's log file path
plainlog --file

# use a different log directory for one command
plainlog --dir ~/work-logs "captured meeting notes"

# set a custom default location
PLAINLOG_DIR=~/journal plainlog "wrote the draft"

File format

Each day gets one file:

~/logs/2026-04-07.txt

Each entry is one line:

[14:38] shipped v1 docs

Limitations

  • Timestamps use local machine time
  • Custom log directory support is local-only, via --dir or PLAINLOG_DIR
  • Entries are stored exactly as typed after trimming outer whitespace
  • Piped or stdin input is accepted, but multi-line input is stored as one raw block
  • --date is read-only; use --on to append to a past date
  • --tail scans back up to 90 days
  • Append locking uses POSIX file locks; concurrent-write protection is strongest on Unix-like systems

About

Timestamped daily log CLI. One plain-text file per day in ~/logs/. Pipe into it, tail it, search it. No database, no config.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors