Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

daylight

> 编程语言
Open source

a command-line program for tracking sunrise and sunset times

367 stars0 likes0 views
WebsiteGitHub

About

a command-line program for tracking sunrise and sunset times

daylight

a command-line program for tracking sunrise and sunset times (Mac / Linux / Windows)

It tells you the sunrise, sunset, solar noon times and day length. It also projects these changes over the next ten days.

daylight uses your IP-based location and timezone to tailor the results to your geometry. It works in (ant)arctic locations, and you can override the IP location if you're travelling / on a VPN.

I love the sunlight and dread the long, dark winter evenings of Northern Europe. I often look up sunrise / sunset times and count off the days until the dreary darkness is gone.

(IP lookup is powered by https://ipinfo.io. They provide a good service so please don't spam requests.)

Daylight is provided under the GPL license.

Installation

Homebrew (MacOS and Linux)

# Add my tap (formula repository)
brew tap jbreckmckye/formulae
# Install daylight
brew install daylight
# Check it
daylight --help

You might need to run brew trust --formula jbreckmckye/formulae/daylight

Manual installation (and Windows)

Pick up the executable for your system in the releases. Unzip the package and put the program in a folder that's within your system PATH.

Usage

# Today's data for your IP location
daylight

# Override the IP location and timezone (allows offline operation)
daylight --latitude="-33.92" --longitude="18.42" --timezone="Africa/Johannesburg"

# Short summary of the data
daylight --short

# JSON version of summary
daylight --json

# Data for another date
daylight --date="2025-12-31"

# Disable the colour output
NO_COLOR=true daylight

# Show help
daylight --help

Daylight will attempt to adapt to your terminal background colour (dark vs light) but this might not work well for your colour scheme. In this case you can use NO_COLOR to disable any colours

…

There is also a short summary mode

$ daylight --short
Rises:  05:41
Sets:   20:14
Length: 14 hrs, 32 mins
Change: +3m 39s

And a JSON mode

$ daylight --json
{
  "rises": "06:04",
  "noon": "13:06",
  "sets": "20:09",
  "length": "14 hrs, 4 mins",
  "change": "-3m 57s",
  "latitude": "52.953600",
  "longitude": "-1.150500",
  "timezone": "Europe/London"
}

Codebase

This project comes from pretty early in my journey to learn Go. It's always possible there are bugs. Feel free to raise issues.

The terminal UI library is lipgloss.

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠸⣷⣦⣀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣦⠀⠠⠾⠿⣿⣷⠀⠀⠀⠀⠀⣠⣤⣄⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠟⢉⣠⣤⣶⡆⠀⣠⣈⠀⢀⣠⣴⣿⣿⠋⠀⠀⠀⠀
⠀⢀⡀⢀⣀⣀⣠⣤⡄⢀⣀⡘⣿⣿⣿⣷⣼⣿⣿⣷⡄⠹⣿⡿⠁⠀⠀⠀⠀⠀
⠀⠀⠻⠿⢿⣿⣿⣿⠁⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣁⠀⠋⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠈⠻⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢰⣄⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣠⡀⠀⣴⣿⣿⣿⣿⣿⣿⣿⡿⢿⡿⠀⣾⣿⣿⣿⣿⣶⡄⠀
⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠻⣿⣿⡿⠻⣿⣿⣿⣿⠀⠀⠈⠉⠉⠉⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣠⣾⡿⠟⠉⠉⠀⢀⡉⠁⠀⠛⠛⢉⣠⣴⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⢸⣿⣿⡿⠉⠀⠙⠿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⠁⠀⠀⠀⠀⠀⠙⠿⣷⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀ ⠃⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gogolanglipglosssunrise-sunsetterminal

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言