A simple and beautiful Terminal User Interface (TUI) to show the current phase of the moon in ASCII art.
This project is heavily inspired by the beautiful website asciimoon.com.
- Real-time Moon Phase: Displays an ASCII art representation of the moon's phase for any given date.
- Interactive TUI:
- Use the Left and Right arrow keys to travel through time day-by-day.
- Toggle labels for major lunar features with the 'l' key.
- Cycle through multiple languages for labels (English, Chinese, French, Japanese, and Spanish) with the 'L' key.
- Toggle hiding the unlit (dark) part of the moon with the 'd' key.
- Toggle a Moon Poem panel (matching the current language) with the 'p' key, and pick a new random poem with 'P'.
- Toggle the information panel with the 'i' key.
- Cross-Platform: Works on Linux, macOS, and Windows.
- Lightweight: It's a single, small, native binary.
- Non-Interactive Mode: Print the moon to the console at a specified size for use in scripts or MOTD.
- Tap the repository:
brew tap rockydd/tap
- Install the formula:
brew install ascii_moon
You can download the latest pre-compiled binaries for Linux, macOS, and Windows from the GitHub Releases page.
If you have Rust installed, you can build it from source:
git clone https://github.com/rockydd/ascii_moon.git
cd ascii_moon
cargo build --release
./target/release/ascii_moonRun the application without arguments to launch the full-screen interactive TUI:
ascii_moonTo see the moon on a specific date in interactive mode:
ascii_moon --date YYYY-MM-DDBy default (when --date is not provided), the TUI follows the current time and auto-refreshes every 5 minutes.
You can change the refresh period (or disable it) with:
ascii_moon --refresh-minutes 5
ascii_moon --refresh-minutes 0For scripting or MOTD (Message of the Day) use, you can print the moon directly to the console. Use the --lines flag to specify the height of the output.
ascii_moon --lines 20To hide the unlit (dark) part in print mode:
ascii_moon --lines 20 --hide-dark- ←: Go back one day.
- →: Go forward one day.
- n: Switch back to Now (auto) mode (follows current time and auto-refreshes).
- l: Toggle labels for lunar features.
- L: Cycle through languages for the labels.
- d: Toggle hiding the unlit (dark) part of the moon.
- p: Toggle the Moon Poem panel (animated, language-matched).
- P: Pick a new random poem (current language).
- i: Toggle the information panel.
- q or : Quit the application.
- Note: Using ←/→ switches the app into Manual mode (stops following "Now").
If your terminal uses a light/white background, the default “soft pastel” poem colors may look too faint. Use:
--theme lightfor higher-contrast poem colors on white backgrounds--theme darkfor dark terminals--theme auto(default) tries to infer fromCOLORFGBGwhen available
ascii_moon can load moon poems from a folder on disk, so you can add your own poems easily.
- Default: looks for
./poems/(relative to where you run the command). If not found, it also tries:<prefix>/share/ascii_moon/poems(Homebrew-style install location)
- Override: pass
--poems-dir /path/to/poems
Create subfolders by language:
poems/en/poems/zh/poems/fr/poems/ja/poems/es/
Each poem file is simple:
- Line 1: Title
- Line 2: Author
- Line 3:
--- - Remaining lines: poem body
This project is licensed under the MIT License.