A Rust-based command-line tool for fetching weather data from an API and presenting it in a beautiful and readable format.
This is very much work in progress and the first project in my journey of learning Rust. It probably does not follow best-practice and still has a lot of things that can be improved in the future. When looking at this repository, please take that into consideration.
I only provide limited support for Windows. Linux is supported. MacOS is not supported because I do not own a copy of MacOS I can test on. (I hope "it just works™").
WeatherWand is a command-line tool built in Rust that allows you to retrieve weather data from an external API, deserialize the JSON response, and present it in a user-friendly and aesthetically pleasing format in the terminal.
This project was developed with the goal of providing a simple and elegant way to access weather information for any location and display it with clarity.
- Fetch geolocation & weather data from an API.
- Display weather information in the terminal.
- Support for various units (temperature, wind speed, 12h/24h clock).
- Automated install script for Linux systems.
- Set a Nerd Font as your terminal font to correctly display the icons. The font used in the demo image is JetBrainsMono Nerd Font. Other fonts may display the icons differently.
- Ensure a stable internet connection.
Linux:
There are 2 ways to install this program.
- Download the latest release manually and place it in a directory of your choosing (preferably somewhere in your $PATH).
- Run the automated installation script in the bin/ directory to install the program on your system. The script requires elevated privileges. As always, please check the content of any script for safety before running it.
sudo bin/install-linux.sh
Windows:
- Download the latest release manually and place it in a directory of your choosing.
The executable is supposed to be run from the terminal. Double-clicking the executable might not work, since it is a command-line application.
weather-wand --city <CITY> --temperature-unit <TEMPERATURE_UNIT> --windspeed-unit <WINDSPEED_UNIT> --display <CLOCK_FORMAT>
Example:
weather-wand -c "New York" -t fahrenheit -w mph -d 12h
Help:
weather-wand --help
- rust-clippy is used for linting. Please run it before every commit:
cargo clippy
- rustfmt is used for code formatting. Please run it before every commit:
cargo fmt
- (optional) cargo-modules can be used to display the module structure:
cargo modules generate tree
or
cargo modules generate tree --types
- Clone the project repository:
git clone https://github.com/tnickel-web/weather-wand.git
- Navigate to the project directory:
cd weather-wand
- Run the project:
cargo run
- Build for release:
- Linux:
cargo build --release
- Windows:
rustup target add x86_64-pc-windows-gnu
cargo build --release --target x86_64-pc-windows-gnu