Skip to content

Latest commit

Β 

History

History
113 lines (78 loc) Β· 1.9 KB

File metadata and controls

113 lines (78 loc) Β· 1.9 KB

t

CI

A quick and simple world clock for the command-line using IATA airport codes.

Installation

Homebrew

brew install cv/tap/t

From source

go install github.com/cv/t/cmd/t@latest

From releases

Download the latest binary from the releases page.

Usage

$ t sfo jfk
SFO: πŸ•“  16:06:21 (America/Los_Angeles)
JFK: πŸ•–  19:06:21 (America/New_York)

Any IATA airport code can be used, and will pick the timezone of that airport.

Version

$ t --version
t v1.0.0 (commit: abc1234, built: 2024-01-01T00:00:00Z)

Shell Prompt Mode

If PS1_FORMAT is set, the output will be compact with no decorations or newline, suitable for shell prompts:

$ echo $(PS1_FORMAT=1 t sfo lon)
SFO 17:47 LON 01:47

Development

Prerequisites

  • Go 1.21 or later

Building

go build -o t ./cmd/t

Testing

# Run all tests
make test

# Run with coverage
make test-cover

# Run with race detector
make test-race

Linting

make lint

Releasing

Releases are automated via GitHub Actions. To create a new release:

git tag v1.0.0
git push origin v1.0.0

Project Structure

t/
β”œβ”€β”€ .github/workflows/  # CI and release automation
β”‚   β”œβ”€β”€ ci.yml
β”‚   └── release.yml
β”œβ”€β”€ cmd/t/              # Main application entry point
β”‚   └── main.go
β”œβ”€β”€ codes/              # IATA airport code to timezone mapping
β”‚   └── iata.go
β”œβ”€β”€ internal/clock/     # Core clock display logic
β”‚   β”œβ”€β”€ clock.go
β”‚   └── clock_test.go
β”œβ”€β”€ .goreleaser.yml     # Release configuration
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
└── README.md

License

MIT License - see LICENSE for details.