README
¶
after
A predictable terminal timer for durations and times of day, with clean output and reliable scripting behavior.
after 10m # simple countdown
after 1pm # until next 1 PM
Why after?
after is a small, predictable terminal timer that behaves well both interactively and in scripts.
- Shows a live countdown when you're in a terminal
- Accepts both fixed durations and times of day (
after 1pm) - Keeps
stdoutclean and sends lifecycle events tostderr - Stays quiet and well-behaved when output is redirected or piped
- Plays an optional alert when the timer completes
It’s designed to feel natural at the command line, without surprises.
Quick Start
Install and run in under a minute (requires Homebrew):
brew install mtn-man/tools/after
after 10m
Once running, use q, esc, ctrl+c or ctrl+d to cancel.
If after is not found once installed, see Troubleshooting.
Installation
Note: Windows is not currently supported. If you want it, let us know!
Install With Go
Requires Go 1.23+ on macOS, Linux, or BSD. Get Go: https://go.dev/dl/
Install the latest version:
go install github.com/mtn-man/after@latest
Or install a specific release:
go install github.com/mtn-man/after@<version>
Or clone and build locally:
git clone https://github.com/mtn-man/after.git
cd after
go build -o after .
./after --version
Install Prebuilt Release Binary
Prefer a manual install? Download a prebuilt binary:
Binary installation steps (macOS and Linux)
-
Download your platform archive and
checksums.txtfrom the latest release. Replace<version>in the examples below with the release tag (for example,vX.Y.Z). Archive naming pattern:after_<version>_darwin_amd64.tar.gzafter_<version>_darwin_arm64.tar.gzafter_<version>_linux_amd64.tar.gzafter_<version>_linux_arm64.tar.gz
Note: release filenames use
darwinto refer to macOS. The examples below use macOS Apple Silicon filenames; swap in the archive and binary names for your OS/architecture. -
Verify checksum (optional but recommended): Example for macOS Apple Silicon:
grep "after_<version>_darwin_arm64.tar.gz$" checksums.txt | shasum -a 256 -c -Example for Linux:
grep "after_<version>_linux_amd64.tar.gz$" checksums.txt | sha256sum -c - -
Extract your archive (example shown for macOS Apple Silicon):
tar -xzf after_<version>_darwin_arm64.tar.gz -
Install the extracted binary into
/usr/local/bin(default):sudo install -m 0755 after_darwin_arm64 /usr/local/bin/afterIf you are on a different platform, replace the archive and binary filenames above with the matching release files for your OS/architecture.
-
Alternative (no
sudo): install to~/.local/bin:mkdir -p ~/.local/bin install -m 0755 after_darwin_arm64 ~/.local/bin/afterIf
~/.local/binis not in yourPATH, add it to your shell startup file (for example,~/.zshrcor~/.bashrc), then reload your shell:# zsh echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc # bash echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc -
Verify:
after --version
Usage
after [options] <duration|time>
Durations are relative. Times refer to the next occurrence — wrapping to tomorrow if already passed.
Examples
# durations
after 30 # bare number = seconds
after 5m # minutes
after 1h30m # hours and minutes
after 1.5h # decimal hours
# times of day
after 9am # next 9:00 AM
after 9p # next 9:00 PM
after 14:30 # 24-hour format
after 2:30 PM # 12-hour with AM/PM
after noon # 12:00 PM
after midnight # 12:00 AM
# flags
after -q 5m # suppress alarm and status output
after -qs 5m # quiet but keep alarm
after -qt 5m # quiet and no title bar updates
after -f ~/sounds/bell.mp3 5m # custom alert sound
# scripting
after 10m 2> /tmp/after.log # capture lifecycle output
after -s 10m 2> /dev/null & # background with alarm
Options may be placed before or after the time value. Short flags can
be combined: -qt, -qs, -qts.
Run after --help for all flags.
Behavior
Status output goes to stderr, leaving stdout clean for pipelines.
The countdown shows only significant fields (1:23 for 83 seconds,
1:02:03 for just over an hour).
When output is redirected (e.g. 2> /tmp/after.log), the countdown is
suppressed and only lifecycle lines are emitted: after: started (...),
after: complete, and after: cancelled. The alarm does not play in
this mode unless --sound is specified.
On macOS, after prevents the system from sleeping for its duration.
Use --caffeinate to force this when output is redirected.
Troubleshooting
afternot found after install (after: command not found): Ensure your install location is inPATH(/opt/homebrew/binor/usr/local/binfor Homebrew,$(go env GOPATH)/binorGOBINforgo install,/usr/local/binor~/.local/binfor manual install), then restart or reload your shell.Permission deniedwhile installing to/usr/local/bin: Usesudo install ...or install to~/.local/bininstead.- Homebrew command ambiguity with an existing
afterformula: usebrew install mtn-man/tools/afterandbrew info mtn-man/tools/after.
Contributing
Bug reports, suggestions, and pull requests are welcome. Open an issue to start a conversation.
License
MIT License. See LICENSE file for details.
Disclaimer
This tool has been made using LLM assistance for code review and bugfixes; All code is human reviewed and verified to work as intended.