Solunatus
High-precision astronomical calculations for sun and moon events, available as both:
- A Rust library (
solunatus) - A CLI app (
solunatus)
Solunatus runs offline for core calculations and supports historical/future dates (from astronomical year -0999 through 3000).
What You Get
- Sunrise, sunset, and solar noon
- Civil, nautical, and astronomical twilight
- Moonrise, moonset, and transit
- Moon phase, illumination, altitude/azimuth, distance
- Built-in city database (570+ cities)
- Interactive terminal UI (watch mode)
- JSON output and calendar export (HTML/JSON)
- Optional USNO validation reports
- Optional AI insights via local Ollama
Install
Solunatus targets the latest stable Rust release for active development. The current release line supports stable Rust versions compatible with rust-version = "1.91", and that floor may rise in a minor release when security, dependency compatibility, or maintainability require it. If you need an older Rust toolchain, use an older Solunatus release that still supports it.
To upgrade an existing installation from crates.io:
From crates.io
From source
Quick Start
# Use a city from the built-in database
# Or specify coordinates + timezone
By default, Solunatus starts in interactive watch mode.
Press q to quit, s for settings, and r for reports.
Common CLI Usage
Single snapshot (non-interactive)
JSON output
Specific date
Calendar export
USNO validation report (feature-enabled builds)
AI insights with Ollama (feature-enabled builds)
Command Highlights
Core flags:
--city <CITY>--lat <LAT> --lon <LON> --tz <TIMEZONE>--date <YYYY-MM-DD>--json--calendar --calendar-start <DATE> --calendar-end <DATE>--calendar-format <html|json>--calendar-output <PATH>--watch--no-prompt--no-save--strict
Optional flags (feature gated):
--validate(usno-validation)--ai-insights,--ai-server,--ai-model,--ai-refresh-minutes(ai-insights)
For full CLI docs, see docs/features/cli-reference.md.
Optional Features
Default features:
cpu-portableusno-validationai-insights
Non-default feature:
parallel(Rayon-based parallel processing)
Examples:
# Minimal build (no USNO validation, no AI insights)
# USNO validation only
# AI insights only
# Add parallel processing
Library Usage
Add dependency:
[]
= "0.4.0"
= "0.4"
= "0.10"
Basic example:
use Local;
use New_York;
use *;
More examples: examples/
Accuracy and Scope
Solunatus uses NOAA-based solar methods and Meeus-based lunar methods, with validation tooling aligned to USNO-style conventions.
This project is intended for educational, planning, and general-purpose astronomical use.
It is not certified for safety-critical navigation or legal timing decisions.
Configuration
CLI settings are saved to:
~/.solunatus.json
Use --no-save to avoid writing configuration.
Releases
Crates.io is the supported distribution channel for published releases:
GitHub Releases are used for tags and release notes for each published version. They should not be treated as a guaranteed source of fresh binary artifacts unless a specific release explicitly says otherwise.
Development
# Build
# Test
# Safer local test runner
Project docs index: docs/README.md
Contributing
Issue reports and feature requests are welcome:
License
MIT (LICENSE)