weather # Auto-detect from IP
weather "New York" # City name
weather "Paris, France" # City and country
weather "JFK" # Airport code
weather "~Eiffel Tower" # Approximate location
weather "@github.com" # Domain location- Auto-detect resolves to a plausible location
- City name returns correct location
- City + country returns correct location
- Airport code resolves correctly
-
~landmark resolves to nearest location -
@domain resolves to a location - Invalid location returns a helpful error message
weather "New York"- Location, Condition, Temperature, Feels, Clouds, Rain/Snow/Sleet/Hail, Humidity, Wind, Pressure, Visibility, UV, Astronomy, Updated all present
- Severe weather flag
[SEVERE]or⚠️appears for thunderstorm/blizzard conditions
weather -3 "New York"- 3 days rendered
- Each day shows Date, Condition, High, Low, Rain, Wind, Moon, Sunrise, Sunset
- No
first?error
weather -H "New York"- 8 time slots rendered (3-hour intervals)
- Each slot shows Time, Condition, Temp, Feels, Precip, Wind, Humidity
- Snow chance uses snow icon, rain chance uses rain icon
weather -a "New York"- Sunrise, Sunset, Moonrise, Moonset, Moon Phase, Illumination all present
weather -1 "New York"- Single line output:
Location: icon temp - condition - Works cleanly in a pipeline:
weather -1 "New York" | str length
weather "London" # Auto metric (non-US)
weather "New York" # Auto imperial (US)
weather -m "New York" # Force metric
weather -i "London" # Force imperial- London auto-detects metric (°C, km/h, mm, km, hPa)
- New York auto-detects imperial (°F, mph, in, mi, inHg)
-
-mforces metric on a US city -
-iforces imperial on a non-US city
weather "New York" # Nerd Font icons (default)
weather -e "New York" # Emoji icons
weather -t "New York" # Plain text, no icons or colors- Nerd Font mode shows icon glyphs
- Emoji mode shows emoji characters
- Text mode shows no icons and no ANSI color codes
- All three modes work across current, forecast, hourly, and astro views
weather -r "New York" # Raw record
weather -j "New York" # Full raw JSON
weather -r -t "New York" # Raw + text (clean serialization)
weather -r -t "New York" | to json
weather -3 -r -t "New York" | to json-
-rreturns a Nushell record -
-jreturns the full API response as a record -
-r -tproduces no ANSI control characters -
| to jsonsucceeds without errors -
-3 -r -t | to jsonsucceeds without errors
weather "New York" # Prime the cache
weather "New York" # Should use cache (check no network call in --debug)
weather -f "New York" # Force fresh fetch
weather --clear-cache # Clear all cached data
weather "New York" # Should recreate cache cleanly- Second call uses cache (fast, no network)
-
-fbypasses cache and fetches fresh data -
--clear-cacheprintsWeather cache cleared. - Cache directory is gone after
--clear-cache - Cache directory recreates on next normal run
- Cache expires after 15 minutes (verify via
--debug)
weather --lang fr "Paris"
weather --lang de "Berlin"
weather --lang zh "Tokyo"- Condition descriptions appear in the specified language
- Cache key includes language suffix (separate cache per language)
| UV Value | Expected Label |
|---|---|
| 0–2 | Low |
| 3–5 | Moderate |
| 6–7 | High |
| 8–10 | Very High |
| 11+ | Extreme |
weather --test # UV 6 → should show High- UV
6(test data) showsHigh - Label color matches: grey=Low, green=Moderate, yellow=High, red=Very High/Extreme
- Label appears in text mode too (no ANSI, just the word)
Applies to current weather only. To test Snow/Sleet/Hail, temporarily change weatherCode in current_condition in the test data block.
| Weather Code | Expected Label |
|---|---|
| 389 (Thunderstorm) | Rain |
| 338 (Heavy Snow) | Snow |
| 317 (Sleet) | Sleet |
| 350 (Hail) | Hail |
weather --test # code 389 → Rain:- Code
389→Rain: - Code
338→Snow:(edit test data to verify) - Code
317→Sleet:(edit test data to verify) - Code
350→Hail:(edit test data to verify)
weather --debug "New York" # Full diagnostic output
weather --test # Dummy data, no network
weather --test --debug # Both together
weather --test "imperial" # Imperial dummy data-
--debugprints URL, cache path, cache validity, unit mode, view mode -
--debugshows connectivity test result -
--testskips network request entirely -
--test "imperial"or--test "carrollton"triggers imperial dummy data -
--test --debugshows⚠ USING DUMMY TEST DATA
weather "asdfjkl;" # Invalid location
weather --debug "asdfjkl;" # Invalid location with debug- Invalid location returns a helpful error with suggestion to try airport code or
~landmark - Network failure returns a readable error (disconnect and test if possible)
- Debug mode shows extended failure diagnostics
weather -r "New York" | get Temperature
weather -3 -r -t "New York" | where High =~ "7"
weather -1 "New York" | str upcase
weather -r -t "New York" | to json | clipboard copy
weather -3 -r -t "New York" | to toon-
getextracts a single field cleanly -
wherefilters forecast rows - Oneline output pipes as a plain string
-
to json | clipboard copyworks without control character errors -
to toonproduces compact TOON output (requires nu_plugin_toon)
The colour gradient switches at exact thresholds:
- Imperial: hot ≥ 80°F (yellow→red), cold ≤ 40°F (white→cyan), mild between (green→yellow)
- Metric: hot ≥ 27°C, cold ≤ 4°C
# Verify gradient boundaries using test data + raw output
weather --test -r -t | get Temperature # should be 72°F (mild range → green→yellow)
weather --test -i -r -t | get Temperature # 72°F (mild)
# Negative temperature — from day 2 of test forecast (mintempF = 28, mintempC = -2)
weather --test -3 -r -t | get Low | first # 59°F / 15°C (day 1, mild)
weather --test -3 -r -t | get Low | last # 41°F / 5°C (day 3, near cold limit)- Temperature at exactly the hot limit renders with hot gradient (or hot colour in text mode)
- Temperature at exactly the cold limit renders with cold gradient
- Negative temperature string (
"-5") parses correctly without error -
--textmode never emits ANSI codes regardless of temperature value
| km/h input | Expected Bft |
|---|---|
| 0 | 0 (Calm) |
| 1 | 1 |
| 5 | 1 |
| 6 | 2 |
| 11 | 2 |
| 12 | 3 |
| 117 | 11 |
| 118 | 12 (Hurricane) |
# Fog test slot has windspeedKmph = 0 (Calm)
weather --test -H -r -t | last | get Wind # should contain [Bft 0] in emoji/text mode- Wind speed
"0"→ Bft 0 - Wind speed
"1"→ Bft 1 - Wind speed
"118"→ Bft 12 -
beaufort-iconin Nerd Font mode emits a non-empty glyph for every scale 0–12 -
beaufort-iconin--emojiand--textmodes emits[Bft N]for every scale 0–12
All 16 compass points and the unknown fallback should resolve without error.
# Spot-check a few in text mode (returns the raw string)
weather --test -H -r -t | get Wind # NW slot
weather --test -3 -r -t | get Wind # N, E slots across days| Input | Expected (Nerd Font) | Expected (emoji/text) |
|---|---|---|
| N | glyph | N |
| NNE | glyph | NNE |
| SSW | glyph | SSW |
| WNW | glyph | WNW |
| (unknown, e.g. "VAR") | fallback → raw string | VAR |
- All 16 standard compass points return a non-empty glyph in Nerd Font mode
- All 16 points return the raw direction string in
--emoji/--textmodes - Unrecognised direction string (e.g.
"VAR") is returned unchanged
| Illumination | Expected fallback icon |
|---|---|
| 0 | New Moon |
| 4 | New Moon (< 5) |
| 5 | Waxing Crescent (< 45) |
| 44 | Waxing Crescent |
| 45 | First Quarter (< 55) |
| 54 | First Quarter |
| 55 | Waxing Gibbous (< 95) |
| 94 | Waxing Gibbous |
| 95 | Full Moon (≥ 95) |
| 100 | Full Moon |
Test data covers Waxing Crescent (10%), First Quarter (50%), and Full Moon (100%) — the waning phases are not exercised by test data and must be checked against live data or by temporarily editing the test block.
# Full Moon is day 3 of test forecast — illumination 100%
weather --test -a -r -t | get "Moon Phase" # should show Full Moon glyph/emoji
weather --test -a -r -t --emoji | get "Moon Phase" # should show 🌕- Illumination
"0"→ New Moon icon - Illumination
"100"→ Full Moon icon - Phase string
"Waning Gibbous"→ correct waning icon (live data test) - Phase string
"Last Quarter"→ correct last-quarter icon (live data test) - Phase string
"Waning Crescent"→ correct icon (live data test) - Completely unrecognised phase string falls back to illumination-based icon
An unrecognised code (e.g. "999") should return the thermometer fallback glyph in Nerd Font mode and 🌡️ in emoji mode.
# No direct test command — verify by reading source match arms cover all listed codes
# and that the _ arm is present.- Nerd Font mode
_arm returns a non-empty fallback glyph - Emoji mode
_arm returns🌡️ -
--textmode always returns empty string regardless of code
URL encoding must handle non-ASCII input without corrupting the API URL or the cache filename.
weather "Zürich" # umlaut
weather "São Paulo" # tilde + cedilla
weather "東京" # full CJK
weather "Montréal" # accent-
Zürichresolves to Zurich, Switzerland -
São Pauloresolves correctly -
東京resolves to Tokyo - Cache file is created with a URL-encoded filename (no raw Unicode in the path)
-
--debugshows the URL-encoded form inURL encoded:line
weather --clear-cache # prime removal
weather --clear-cache # run again when directory is already gone- Second
--clear-cacheprintsWeather cache cleared.without error (or exits cleanly even if the dir is missing)
weather --lang "zzz" "London"- Command does not crash (wttr.in likely ignores the unknown lang and returns English)
- Cache key contains
_zzzsuffix, isolating it from the default cache
When both flags are passed, imperial takes priority (code checks $imperial first).
weather --metric --imperial "London"- Output shows imperial units (°F, mph) — imperial wins
-
--debugreportsUnit Override: Imperial
--json returns the raw API record immediately, before any view-mode branching.
weather -j "New York" | describe # should be "record"
weather -j -3 "New York" | describe # still returns full record, not a table
weather -j -H "New York" | describe # same
weather --test -j | get current_condition | length # should be 1-
-jalways returns a record regardless of-3,-H,-a, or-1 - The record contains
current_condition,weather, andnearest_areakeys
weather --test # Current, metric (Testland)
weather --test "imperial" # Current, imperial (United States)
weather --test --metric "imperial" # Force metric even though city triggers imperial
weather --test --imperial # Force imperial on metric test data
weather --test --forecast # 3-day forecast, metric
weather --test --forecast --imperial # 3-day forecast, imperial
weather --test --hourly # Hourly, metric
weather --test --hourly --imperial # Hourly, imperial
weather --test --astro # Astronomy
weather --test --oneline # Single line
weather --test --json # Raw API record
weather --test --raw # Raw record output
weather --test --emoji # Emoji icons
weather --test --text # Plain text- All combinations above complete without error
-
--test --metric "imperial"forces °C even though the city keyword contains "imperial" -
--test --imperialforces °F on the metric (Testland) test data -
--test --forecastshows 3 rows (Fri Oct 27, Sat Oct 28, Sun Oct 29) -
--test --hourlyshows exactly 1 row per day (test data only has onehourlyslot per day)
The time formatting pads "0" to "0000" and then slices to "00:00".
# There is no midnight slot in the current test data.
# To test, temporarily add an hourly entry with time: '0' to the first day's hourly list.
# Expected display: "00:00"- Time
"0"renders as"00:00"(not"0:"or":0") - Time
"300"renders as"03:00" - Time
"1200"renders as"12:00"(already covered by test data)
When no city is provided (auto-detect) and --lang is set, the cache file should be auto_<lang>.json, not auto.json.
weather --lang fr --debug # look for "Cache Path: .../auto_fr.json"
weather --lang fr # second call should hit cache
weather --debug # English auto-detect — separate "auto.json" cache-
--debugshowsCache Path: …/auto_fr.jsonwhen--lang frwith no city - English auto-detect uses
auto.json(no suffix) - French and English auto-detect caches are independent
weather --test --astro --raw # returns raw current_astro record
weather --test --hourly --raw # returns list<record>
weather --test --forecast --raw # returns list<record>
weather --test --raw # returns output record (current weather)-
--astro --rawreturns the astronomy sub-record (not a table) -
--hourly --rawreturns a list of records -
--forecast --rawreturns a list of records - All
--rawvariants produce no printed header line