Skip to content

About

simple, easy to use, straightforward cli for a timer/stopwatch

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

35 Commits

Folders and files

Repository files navigation

CLI Timer

A dead simple and customizable, easy to setup/use timer, stopwatch and clock that runs in your terminal.

Install

Install globally (this is all you need):

npm i -g bash-timer
# or
bun add -g bash-timer

Then use commands anywhere:

timer 5 min
stopwatch
clock

Usage

Stopwatch

To use the stopwatch, simply run the following command:

stopwatch

Timer

To use the timer, run the following command with the desired duration:

timer <number> <hr/hrs/min/sec> [<number> <hr/hrs/min/sec> ...]

For example:

timer 5 min 2 sec

Clock

To show the current time, run the following command:

clock

The clock shows 24-hour time (HH:MM:SS) and updates every second. It uses the same font and display settings as the timer and stopwatch.

By default, timer, stopwatch and clock output is centered in the terminal.

Update CLI Timer

To update globally and verify you are on latest:

timer update

timer update auto-detects whether your current install came from Bun, npm, or pnpm, runs the matching global update command, then checks your installed version against npm latest.

Controls

  • p or Spacebar: Pause/Resume
  • r: Restart
  • f: Random font
  • q, e or Ctrl+C: Exit

The clock only uses f and the exit keys, since it cannot be paused or restarted.

Fonts

You can view and set the ASCII font used for the timer, stopwatch and clock display.

To list all available fonts:

timer font

This is instant and lists all figlet fonts. timer font --all is supported as an explicit alias.

To list only timer-compatible fonts (fonts that render 01:23:45 visibly):

timer font --compatible

To set a random font:

timer font random

To set your preferred font:

timer font <font>

Replace <font> with any font name from the list shown by timer font. If a font is missing native timer digits, CLI Timer now substitutes close glyphs so the display stays stylized instead of falling back to plain text.

Settings UI

Open interactive settings UI:

timer settings

timer settings ships with prebuilt Bubble Tea binaries for:

  • Linux x64 / arm64
  • macOS x64 / arm64
  • Windows x64 / arm64

If your platform is unsupported, it falls back to running the Go source (go run) when Go is installed.

This launches a Bubble Tea based screen where you can change:

  • Font
  • Center display
  • Show header
  • Show controls
  • Tick rate (50-1000 ms)
  • Completion message
  • System notification on completion (default On)
  • Completion sound/alarm on completion (default Off)
  • Pause key / pause alt key
  • Restart key
  • Font key
  • Exit key / exit alt key

When completion sound/alarm is enabled, it plays 5 terminal bell beeps.

Controls in settings UI:

  • Enter: select/toggle
  • Ctrl+S: save and exit
  • /: filter fonts in font picker
  • /: filter keys in key picker
  • Esc/q: back/cancel

Note for macOS: If system notifications are inconsistent with built-in AppleScript notifications, install terminal-notifier (brew install terminal-notifier) for improved reliability.

Notification notes by platform:

  • Windows: notifications depend on OS notification permissions and whether your desktop session allows toasts/balloons.
  • Linux: notifications require a running desktop notification daemon (notify-send talks to that daemon over D-Bus).

About

simple, easy to use, straightforward cli for a timer/stopwatch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages