A Rust CLI weather app. Uses WeatherAPI.com for data. Displays beautiful terminal output with true color and Nerd Font icons.
GitHub: codeptor (Bhanu)
cargo build # dev build
cargo build --release # release build
cargo clippy # lint
cargo fmt --check # format check
cargo test # tests (minimal currently)src/main.rs— CLI args (clap derive), async entry pointsrc/api.rs— WeatherAPI fetch + response parsingsrc/types.rs— All data structs (CurrentWeather, DailyWeather, HourlyWeather, etc.)src/display/mod.rs— Shared display utils (icons, colors, terminal width, formatters)src/display/compact.rs— Default view (7-day forecast, astronomy, hourly)src/display/hourly.rs— Hourly forecast (-H)src/display/aqi.rs— Air quality view (-a)src/display/json.rs— JSON output (-j)src/config.rs— TOML config (~/.config/mausam/config.toml)src/cache.rs— JSON response cache (~/.cache/mausam/)src/loading.rs— Spinner animation
- ANSI-aware alignment: pad plain text FIRST, then colorize
- Icon colors are context-aware (day=yellow, night=blue, rain=blue, snow=white, etc.)
- Terminal width: detected via
terminal_sizecrate (ioctl TIOCGWINSZ), COLUMNS env fallback - Two-phase rendering: pre-compute content widths, then set all panels to the widest
- Bordered panels: panel_top/panel_row/panel_bottom with dynamic width
- Day/night detection: uses actual sunrise/sunset times from API, not hardcoded hours
- reqwest uses rustls-tls (not native-tls) to avoid OpenSSL cross-compilation issues
- crates.io:
cargo install mausam - Homebrew:
brew tap codeptor/tap && brew install mausam(repo: codeptor/homebrew-tap) - AUR:
yay -S mausam(pushed to aur.archlinux.org/mausam.git) - GitHub Releases: automated via .github/workflows/release.yml
- No co-author lines in commits
- Keep output pretty
- Rust edition 2024