This script calculates the current moon phase based on the Gregorian date. It
uses Lua’s built-in date and time functions.
lua main2.lua).--date YYYY-MM-DD : specify a date--json : output JSON--verbose : print extra infoExamples:
lua main2.lua --date 2026-07-27
lua main2.lua 2000 1 6 --json
lua main2.lua --verbose
Running tests:
lua tests/test_moon.lua