Skip to content

SuaveIV/nu_script_wttr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wttr.in for Nushell

Nushell 0.110+

A weather fetcher for Nushell that pulls data from 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:

Current weather with Nerd Fonts

3-day forecast:

3-day forecast

Hourly breakdown:

Hourly forecast

Astronomy data:

Astronomy information

Emoji mode:

Emoji icons instead of Nerd Fonts

Plain text mode:

Plain text output

Oneline mode:

image

Installation

Nerd Font icons are enabled by default. Install a Nerd Font 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:
use scripts/weather.nu

Tips

Change the default city — edit the city parameter default in weather.nu:

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:

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
Clipboard support via fmotalleb/nu_plugin_clipboard

Usage

# 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)

About

Weather fetcher for Nushell using wttr.in

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published