https://github.com/SuaveIV/nu_script_wttr
Weather fetcher for Nushell using wttr.in
https://github.com/SuaveIV/nu_script_wttr
forecast nushell nushell-script weather-cli wttrin
Last synced: 12 days ago
JSON representation
Weather fetcher for Nushell using wttr.in
- Host: GitHub
- URL: https://github.com/SuaveIV/nu_script_wttr
- Owner: SuaveIV
- License: mit
- Created: 2026-02-13T19:54:08.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-03-02T01:08:40.000Z (17 days ago)
- Last Synced: 2026-03-02T04:44:29.541Z (16 days ago)
- Topics: forecast, nushell, nushell-script, weather-cli, wttrin
- Language: Nushell
- Homepage:
- Size: 255 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nu - nu_script_wttr - Weather fetcher using wttr.in with formatted tables, color gradients, forecasts, hourly breakdowns, and astronomy data. (Scripts)
README
# wttr.in for Nushell

A weather fetcher for [Nushell](https://www.nushell.sh/) that pulls data from [wttr.in](https://wttr.in).
Turns wttr.in's weather data into formatted tables with color gradients, caching, and options for current conditions, forecasts, hourly breakdowns, and astronomy - all without leaving your terminal.
## What it does
Shows current weather, forecasts, and astronomy data in your terminal. Temperature gradients use ANSI colors. Works with Nerd Fonts by default, but you can switch to emojis or plain text if that's not your thing.
Caches results for 15 minutes so you don't hammer the API. Auto-detects your location from IP, or you can specify cities, airport codes, landmarks (with `~`), or domains (with `@`). Units switch between metric and imperial based on where you are, unless you override it.
Has a one-line mode for status bars, raw output for piping to other commands, and a debug mode when things aren't working.
## Screenshots
**Current weather:**

**3-day forecast:**

**Hourly breakdown:**

**Astronomy data:**

**Emoji mode:**

**Plain text mode:**

**Oneline mode:**

## Installation
> Nerd Font icons are enabled by default. Install a [Nerd Font](https://www.nerdfonts.com) and set it as your terminal font, or use `-e` for emojis or `-t` for plain text instead.
1. Download `weather.nu`
2. Put it in your Nushell scripts directory (`~/.config/nushell/scripts/` on Linux/Mac, `%APPDATA%\nushell\scripts\` on Windows)
3. Add this to your `config.nu`:
```nushell
use scripts/weather.nu
```
## Tips
**Set a default city** — add this to your `env.nu`:
```nushell
$env.WTTR_CITY = "New York"
```
This persists across sessions and takes priority over IP auto-detection, but can still be overridden per-call with an explicit argument.
**Change the default city in the script** — edit the `city` parameter default in `weather.nu`:
```nushell
city: string = "" # Change to your city, e.g. "New York"
```
**Pipe to other tools** — use `--raw` and `--text` together to strip formatting for clean serialization:
```nushell
weather -3 -r -t | to json
weather -3 -r -t | to toon # compact format for LLM input
weather -r -t | to json | clipboard copy # copy to clipboard as JSON
```
> TOON support via [fdncred/nu_plugin_toon](https://github.com/fdncred/nu_plugin_toon)
> Clipboard support via [fmotalleb/nu_plugin_clipboard](https://github.com/fmotalleb/nu_plugin_clipboard)
## Usage
```nushell
# Basic usage
weather # Current weather at your location
weather "New York" # Specific city
weather "Paris, France" # City and country
weather "JFK" # Airport code
weather "~Eiffel Tower" # Approximate location
weather "@github.com" # Domain location
# Display modes
weather -3, --forecast # 3-day forecast
weather -H, --hourly # Hourly breakdown (3-hour intervals)
weather -a, --astro # Sunrise, sunset, moon phase
weather -1, --oneline # One-line summary (for status bars)
# Unit and display options
weather -m, --metric # Force metric units (°C, km/h)
weather -i, --imperial # Force imperial units (°F, mph)
weather -e, --emoji # Use emojis instead of Nerd Fonts
weather -t, --text # Plain text, no icons or colors
weather --lang fr # Weather in French (or de, es, zh, etc.)
# Data output
weather -j, --json # Return full raw API response
weather -r, --raw # Return raw record data (for piping)
# Utility
weather -f, --force # Bypass cache and fetch fresh data
weather --clear-cache # Delete all cached weather data and exit
weather --debug # Show diagnostic info
weather --test # Use dummy data (no network request)
```