An open API service indexing awesome lists of open source software.

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

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`)

![timelog clock mode demo](.github/demos/clock.gif)

- `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`)

![timelog lap mode demo](.github/demos/lap.gif)

- `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`)

![timelog total mode demo](.github/demos/total.gif)

- `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)