Skip to main content

tclock

A clock, timer, stopwatch and countdown for your terminal, drawn with big block digits. Built with Textual. A Python port of race604/clock-tui.

Works on Linux, macOS and Windows. Requires Python 3.14 or newer.

Install

uv tool install tclock
# or
pipx install tclock
# or
pip install tclock

Usage

tclock                 # clock (default mode)
tclock clock -z Asia/Tokyo -D      # another timezone, no date line
tclock timer -d 25m -d 5m -t Work -t Break -r
tclock stopwatch
tclock countdown -t 2027-01-01 -T "New year"
tclock -c '#e63946' -s 2           # colour and size apply to every mode

Keys while running:

Key Action
q, Ctrl+C quit
Space pause / resume (timer and stopwatch)
c switch to clock
w switch to stopwatch
t switch to timer (defaults from config)
? show / hide the key overlay

A key bar with the same bindings appears along the bottom whenever you touch the keyboard or mouse and fades out after a few seconds, so the clock stays clean at rest.

Run tclock --help or tclock <mode> --help for every flag.

Clock

tclock clock [-z TZ] [-D] [-S] [-m] shows the current time. -z takes an IANA zone such as Europe/Oslo. -D hides the date, -S hides seconds, -m shows tenths of a second.

Timer

tclock timer -d 5m counts down five minutes. Durations are a number plus s, m, h or d. Repeat -d to run several durations in sequence and -t to title each of them. -r repeats the sequence, -P starts paused, -Q quits when time is up, -M hides tenths.

-e runs a shell command when the timer ends and shows its result in the footer:

tclock timer -d 25m -e 'notify-send tclock "Time is up"'      # Linux
tclock timer -d 25m -e 'osascript -e "display notification \"Time is up\""'   # macOS
tclock timer -d 25m -e 'msg * Time is up'                       # Windows

When the timer runs out the screen flashes green until you quit or switch mode.

Stopwatch

tclock stopwatch counts up. Press Space to pause. The final time is printed to the terminal after you quit.

Countdown

tclock countdown -t WHEN [-T TITLE] [-c] [-r] [-m] shows the time until WHEN, which can be 20:00, 20:00:00 (today), 2027-01-01 (midnight), 2026-12-25 20:00:00 (local time) or RFC 3339 such as 2026-12-25T20:00:00-04:00. -c keeps counting (negative) after the moment has passed instead of blinking 0:00; -r counts up since the moment.

Configuration

tclock reads an optional TOML file:

OS Path
Linux ~/.config/tclock/config.toml (honours $XDG_CONFIG_HOME)
macOS ~/Library/Application Support/tclock/config.toml
Windows %APPDATA%\tclock\config.toml

Command-line flags override the file; the file overrides built-in defaults. Every key is optional. The full schema, with the built-in defaults:

[default]
mode = "clock"          # clock, timer, stopwatch or countdown when no mode is given
color = "green"
size = 1

[clock]
show_date = true
show_seconds = true
show_millis = false
# timezone = "Europe/Oslo"

[timer]
durations = ["25m", "5m"]
titles = []
repeat = false
show_millis = true
start_paused = false
auto_quit = false
execute = []            # joined with spaces into one shell command

[countdown]
# time = "2027-01-01"
# title = "New year"
show_millis = false
continue_on_zero = false
reverse = false

A broken file or a wrong value produces a warning on stderr and the default is used.

Differences from the Rust clock-tui

  • Flags that took several values now repeat instead: -d 25m -d 5m, -t Work -t Break.
  • --execute takes one quoted shell string instead of a list of words.
  • The config file lives in the platform-native location listed above rather than always in ~/.config/tclock/.
  • tclock timer without -d uses the [timer] durations from the config file (25m, 5m by default) instead of a fixed 5m.
  • tclock countdown without --time falls back to [countdown] time in the config file.
  • Ctrl+C quits. In the Rust binary it switches to clock mode, because its key matcher ignores the Ctrl modifier (so Ctrl+Q, Ctrl+W and Ctrl+T also act like the plain letters there).
  • Mode keys work from every mode. In the Rust binary a widget, once created, stays in a fixed priority order (clock > timer > stopwatch > countdown), so e.g. t from the clock has no visible effect and w from a timer keeps showing the timer.
  • The ? help overlay and the auto-hiding key bar are additions.

Development

uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check . && uv run mypy src
uv run tclock

Releasing

Releases are automated with GitHub Actions:

  1. Every pull request merged into main cuts a release. Release runs uv version --bump, commits chore: release vX.Y.Z to main and pushes the tag vX.Y.Z. The bump is patch unless the PR carries the label release:minor or release:major. A PR labelled skip-release is merged without a release. The workflow can also be run by hand from the Actions tab for rc and stable bumps.
  2. The tag triggers Publish, which builds the sdist and wheel and uploads them to PyPI with trusted publishing, and a GitHub release is created with notes grouped by PR label (see .github/release.yml).

One-time setup: on pypi.org add a trusted publisher for this repository with workflow publish.yml and environment pypi, and create a pypi environment in the GitHub repo settings. main is protected by a ruleset that requires a pull request and the CI passed check. The Release workflow pushes with a write-enabled deploy key (secret RELEASE_DEPLOY_KEY), which is exempt from the ruleset.

License

MIT. Original clock-tui by Race604, also MIT.

Release files for tclock 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tclock 0.1.4
File Size Uploaded
tclock-0.1.4.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tclock 0.1.4
File Interpreter ABI Platform
tclock-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 39.9 kB

Release files / tclock-0.1.4.tar.gz

Download URL tclock-0.1.4.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
984efe88a93f8e72d54db8a806a56c954e7aebab63695d7a54cc21e17bd62f9b
BLAKE2b-256 checksum
How to use checksums
26c827b85a8d8f5af2fc71a57fcb49df78ef527da1a0e4b28e2b62798ce9354d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tclock-0.1.4-py3-none-any.whl

Download URL tclock-0.1.4-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0457c70e30371a047c174a01420af535439590bcb97e2b64c901aef515317f44
BLAKE2b-256 checksum
How to use checksums
594ba98abc189bc1a7c56d6e4fd75ecf9a25c840f74cb35e05928e18bb1e4db2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page