https://github.com/metaory/timelog
Lap-timed terminal notes, line by line
https://github.com/metaory/timelog
Last synced: 12 days ago
JSON representation
Lap-timed terminal notes, line by line
- Host: GitHub
- URL: https://github.com/metaory/timelog
- Owner: metaory
- License: mit
- Created: 2026-04-22T13:30:32.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-28T19:40:02.000Z (about 2 months ago)
- Last Synced: 2026-05-14T02:04:22.450Z (about 1 month ago)
- Language: Shell
- Size: 806 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
timelog
Minimal Bash TUI for timestamped terminal logs.
## Description
`timelog` is a single Bash script that logs lines as `index time :: text` in a full-screen terminal loop. Time column modes: `clock` (`HH:MM:SS`), `lap` (`+HH:MM:SS` since previous line), and `total` (`+HH:MM:SS` since first line).
Interactive mode (TTY) reads keys directly, supports **Ctrl+S** to save entries to `./.log`, and restores terminal state on exit/signals. Non-interactive mode (piped stdin) falls back to line reads and skips hotkey setup.
### Modes
- `clock`: records the current wall-clock time for each entry.
- `lap`: records the time passed since the previous entry.
- `total`: records total elapsed time since the first entry.
## Demos
### Clock (`--clock`)

- `1 09:00:02 :: Open project` - real clock when you wrote entry 1.
- `2 09:02:18 :: Run tests` - later clock time for entry 2.
- `3 09:05:41 :: Commit fix` - current clock time again for entry 3.
### Lap (`--lap`)

- `1 +00:00:00 :: Open project` - first entry always starts at zero.
- `2 +00:02:16 :: Run tests` - took 2m16s after previous entry.
- `3 +00:03:23 :: Commit fix` - took 3m23s since entry 2.
### Total (`--total`)

- `1 +00:00:00 :: Open project` - first entry starts elapsed timer.
- `2 +00:02:16 :: Run tests` - total elapsed since entry 1.
- `3 +00:05:39 :: Commit fix` - cumulative elapsed from the start.
## Usage
```bash
bash timelog
bash timelog --clock # same as no args (wall-clock hour:minute:second per line)
bash timelog --lap # delta since previous line (+HH:MM:SS), first line +00:00:00
bash timelog --total # elapsed since first line (+HH:MM:SS), first line +00:00:00
# shorts: -c (clock), -l (lap), -t (total)
```
Type a line and press **Enter**. Each entry is recorded as `index time :: text` and the screen refreshes. Empty lines are skipped. **Ctrl+S** saves committed entries to a new epoch-named `.log` in the current directory (status appears below the list). Exit with **Ctrl+C** or **Ctrl+D** (EOF).
To run it directly:
```bash
chmod +x timelog
cp timelog ~/.local/bin/timelog # or /usr/local/bin/timelog
```
Make sure the destination directory is in your `PATH`.
## Requirements
- Bash
## License
[MIT](LICENSE)