Sessions track time in real-time with automatic updates, pause/resume support, and shared state between TUI and CLI.
A session is an active timer that tracks time spent on a task. Recorded data:
- Task name and optional description
- Optional project and customer metadata
- Start time
- Elapsed time (updated in real-time)
- Pause/resume history
- Final duration when stopped
Start a timer when you begin work, stop it when done. End time is automatically set to the current time.
In the TUI, you must select an existing work record, then press S to start a session:
- Updates that record's end time when stopped
- Use to extend existing entries
To create a new task with a session, use the CLI session start command.
| Key | Action |
|---|---|
S |
Start/Stop session on selected record |
P |
Pause/Resume active session |
Active session displays:
-
Timer Status Bar (top of screen):
⏱ Running: Task Name | 1h 23m 45s | Status: RunningShows task name, elapsed time (H:MM:SS), and status (Running/Paused)
-
Record Highlighting:
- Active session records show ⏱ icon
- Running: Time is actively being tracked
- Paused: Timer is paused, paused duration is tracked separately
- Stopped: Session has ended, time is saved to the work record
Control sessions from the command line without opening the TUI.
The CLI can create new tasks with sessions:
# Start a basic session
work-tuimer session start "My Task"
# Start with a description
work-tuimer session start "Bug Fix" -d "Fixing authentication issue"
# Start with project/customer metadata
work-tuimer session start "Bug Fix" --project "Platform" --customer "ACME"This creates a new work record and starts tracking immediately.
Output:
✓ Session started
Task: My Task
Project: Platform
Customer: ACME
Description: Optional description
Started at: 14:30:45
work-tuimer session statusOutput:
⏱ Session Status
Task: My Task
Status: Running
Elapsed: 1h 23m 45s
Started at: 14:30:45
Project: Platform
Customer: ACME
Description: Optional description
# Pause the active session
work-tuimer session pauseOutput:
⏸ Session paused
Task: My Task
Elapsed: 0m 45s
# Resume the paused session
work-tuimer session resumeOutput:
▶ Session resumed
Task: My Task
Total elapsed (before pause): 0m 45s
work-tuimer session stopOutput:
✓ Session stopped
Task: My Task
Duration: 1h 23m 45s
Started at: 14:30:45
Ended at: 15:54:30
If you try to control a session when none is running:
$ work-tuimer session stop
Error: No session is runningIf you try to start a session when one is already running:
$ work-tuimer session start "Another Task"
Error: A timer is already runningEnd time is automatically set to current time when stopped.
Pause and resume sessions:
- Elapsed time: Only counts active time (excludes paused duration)
- Paused duration: Tracked separately
- Multiple pauses: Pause/resume as needed
Sessions survive application restarts. State is saved in a SQLite database under the application data directory returned by dirs::data_local_dir(), for example:
- Linux:
~/.local/share/work-tuimer/work-tuimer.db - macOS:
~/Library/Application Support/work-tuimer/work-tuimer.db - Windows:
%LOCALAPPDATA%\work-tuimer\work-tuimer.db
Start a session on a record from any date:
- Navigate to any day in the TUI
- Start a session on that day's record
- End time updates correctly when stopped
Sessions share state across both interfaces:
- Start in CLI, pause in TUI
- Start in TUI, check status in CLI
- Changes sync automatically
TUI auto-reloads every 500ms to reflect external changes.
# Start working
work-tuimer session start "Write documentation"
# ... work on your task ...
# Stop when done
work-tuimer session stop# Start working
work-tuimer session start "Code review"
# ... work for a while ...
# Take a break
work-tuimer session pause
# ... break time ...
# Resume work
work-tuimer session resume
# ... finish up ...
# Stop when done
work-tuimer session stop# Start in CLI before opening TUI
work-tuimer session start "Morning standup prep"
# Open TUI to view full day
work-tuimer
# Continue working in TUI, see session status at top
# Press P to pause, S to stop, or let it run
# Later, check status from CLI
work-tuimer session status
# Stop from CLI when done
work-tuimer session stopIn the TUI:
- Navigate to a work record to extend
- Press
Sto start a session - Work continues...
- Press
Sagain to stop
Record's end time and duration update automatically.
# Quick check if anything is running
work-tuimer session status
# If nothing running, start new task
work-tuimer session start "New task"Active sessions are stored in SQLite table active_timer (single-row state):
- Linux:
~/.local/share/work-tuimer/work-tuimer.db - macOS:
~/Library/Application Support/work-tuimer/work-tuimer.db - Windows:
%LOCALAPPDATA%\work-tuimer\work-tuimer.db - Fallback:
./data/work-tuimer.db
The active_timer row stores:
task_name,descriptionstart_time,end_time,datestatus,paused_duration_secs,paused_atsource_record_id,source_record_date
When a session stops, it creates or updates a work record in SQLite (work_records table) for the target day.
Daily work records are saved to (checked in order):
<dirs::data_local_dir()>/work-tuimer/work-tuimer.db./data/work-tuimer.db(fallback)
- Use descriptive task names: Easier to identify work later
- Add descriptions for context: Useful when reviewing time logs
- Pause during interruptions: Accurate tracking excludes breaks
- Check status regularly:
work-tuimer session statusshows active sessions - Stop sessions promptly: Remember to stop when switching tasks
- Use CLI for quick starts: Start sessions without opening TUI
- Work in both interfaces: Auto-reload syncs changes every 500ms
- The TUI auto-reloads every 500ms, wait a moment
- If still not visible, restart the TUI
- Sessions are saved to
work-tuimer.db(tableactive_timer) - check if the DB file exists - If the DB file was deleted, the session cannot be recovered
- End time is set to when you stopped
- If stopped late, manually edit the end time in the TUI
- The TUI caches data and auto-reloads every 500ms
- Wait a moment or restart the TUI to see latest changes