tuiweather 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +22 -5
  2. package/dist/index.js +6329 -3593
  3. package/package.json +9 -8
package/README.md CHANGED
@@ -5,12 +5,14 @@ Keyboard-driven terminal weather app: Dark Sky-style rain nowcasting, hourly and
5
5
  ## Features
6
6
 
7
7
  - **Rain nowcast** — minute-level "umbrella in N min" warnings derived from 15-minute precipitation buckets (Open-Meteo only; NWS has no minute-level precipitation feed — the nowcast panel hides and the watch bell stays inactive under `provider = "nws"`, nothing renders a false "Dry")
8
- - **Hourly + daily forecast** — sparkline temperature strip, emoji condition icons, precipitation probabilities, and (md+ widths) a UV/humidity/visibility summary row
8
+ - **Hourly + daily forecast** — sparkline temperature strip, emoji condition icons, precipitation probabilities, and a day-detail view with hourly temperature, precipitation, wind/gust, UV, and daylight context
9
+ - **Go out / heads up** — on medium and wide terminals, a "go out" line names the best dry, comfortable 2+ hour window in the next 24h, and a "heads up" line flags the worst hazardous (rainy or high-gust) one; either line is omitted when nothing in the forecast clears its bar
9
10
  - **Location search** — type `/`, search the Open-Meteo geocoder, enter to add; locations persist to config
10
11
  - **Guided first run** — choose units and find a location without editing a config file
11
12
  - **Units** — metric/imperial toggle persisted across runs
12
13
  - **Themes** — day/night accent palettes follow the forecast location's sunrise/sunset; text ink adapts to your terminal's background
13
14
  - **Air quality** — US AQI with category label in the details grid, from the Open-Meteo Air Quality API
15
+ - **Status rail** — on wide terminals (96+ columns) the sidebar carries the location list plus a live nowcast card and a bottom-anchored today summary (range, rain, sunrise/sunset, UV and AQI)
14
16
  - **Responsive layout** — four breakpoint tiers down to 32 columns; clamps gracefully below that
15
17
  - **One-line mode** — a single status line for tmux bars and prompts
16
18
 
@@ -68,6 +70,9 @@ Use `tuiweather --help` for command-line options and `tuiweather --version` to p
68
70
  | --- | --- |
69
71
  | `r` | Refresh current location (bypasses cache) |
70
72
  | `[` / `]` | Previous / next location |
73
+ | `←` / `→` | Select a day in the daily list |
74
+ | `v` | Inspect the selected day (defaults to today) |
75
+ | `,` / `.` | Page the daily list backward / forward through the fetched range |
71
76
  | `l` | Open the locations overlay: switch, set default, delete, reorder |
72
77
  | `1`–`9` | Jump to location N by sidebar order (1-based; no-op out of range) |
73
78
  | `u` | Toggle metric / imperial units |
@@ -80,13 +85,15 @@ Use `tuiweather --help` for command-line options and `tuiweather --version` to p
80
85
  | `↑` / `↓` | Scroll the main panel when content overflows |
81
86
  | `?` | Toggle help overlay |
82
87
  | `o` | Re-run setup (from help overlay) |
83
- | `esc` | Clear sidebar focus if set; otherwise close the help overlay |
88
+ | `esc` | Close day detail first; otherwise clear sidebar focus or close the help overlay |
84
89
  | `q` | Quit |
85
90
 
86
91
  While the search overlay is open it owns the keyboard: type to search, up/down to move the cursor, enter to add the highlighted result, esc to cancel. Number, focus, and reorder keys are ignored while the search input is focused (same as `d`/`r`).
87
92
 
88
93
  The locations overlay (`l`) also owns the keyboard while open: up/down (or `j`/`k`) to move the cursor, enter or `1`–`9` to switch, `s` to set the cursor row as default, `d` twice to delete it, `J`/`K` to reorder it, `/` to jump into search, esc to close.
89
94
 
95
+ Use left/right to move the daily-list cursor, then `v` to open that local day's hourly story. The day-detail overlay owns the keyboard while open; up/down scrolls compact views and esc returns to the unchanged main view.
96
+
90
97
  ### One-line mode
91
98
 
92
99
  `tuiweather --one-line` prints a single line and exits — designed for tmux status bars and shell prompts:
@@ -180,15 +187,15 @@ longitude = -122.6765
180
187
  | `theme` | `day` / `night` / `auto` | `"auto"` | Accent palette; `auto` follows the location's sunrise/sunset. Text ink adapts via `ink` |
181
188
  | `ink` | `auto` / `light` / `dark` | `"auto"` | Terminal ink override; `auto` detects the background via an OSC query (300ms timeout, fallback dark), `light`/`dark` skips detection and uses that ink directly |
182
189
  | `provider` | `openmeteo` / `nws` | `"openmeteo"` | Weather data source. Open-Meteo is the default full-feature experience; NWS is the official US source fallback — works: conditions, temperatures, precipitation probabilities; goes quiet: minute-level nowcast (panel hides, watch bell inactive), hourly/daily precip amounts (blank bars/chips), air quality |
183
- | `daily_days` | integer | `7` | `1`–`16` forecast days |
190
+ | `daily_days` | integer | `7` | `1`–`16` forecast days requested from NWS; Open-Meteo always requests 14 days and pages the daily list with `,`/`.` regardless of this setting |
184
191
  | `hourly_hours` | integer | `24` | `12`–`48` forecast hours |
185
192
  | `default_location` | string | none | Must match a `[[locations]]` slug |
186
193
  | `units.temp` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for temperatures |
187
194
  | `units.wind` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for wind speed and visibility |
188
195
  | `units.precip` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for precipitation amounts |
189
196
  | `units.pressure` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for pressure; `metric` → hPa (rounded), `imperial` → inHg to 2 decimals; falls back to `imperial` when unset |
190
- | `panels.nowcast` | boolean | `true` | Show/hide the nowcast banner |
191
- | `panels.details` | boolean | `true` | Show/hide the details grid |
197
+ | `panels.nowcast` | boolean | `true` | Show/hide the nowcast banner, and the status rail's `now` card at the lg tier |
198
+ | `panels.details` | boolean | `true` | Show/hide the details grid, and the status rail's `today` card at the lg tier (it repeats the grid's sunrise/sunset and UV) |
192
199
  | `panels.hourly` | boolean | `true` | Show/hide the hourly strip |
193
200
  | `panels.daily` | boolean | `true` | Show/hide the daily list |
194
201
 
@@ -216,6 +223,7 @@ Requires [Bun](https://bun.sh) >= 1.3.
216
223
  ```sh
217
224
  bun install
218
225
  bun run dev # run the TUI
226
+ bun run preview # offline interface demo with recorded Portland + Tokyo weather
219
227
  bun run test # unit + snapshot tests
220
228
  bun run typecheck # tsc --noEmit
221
229
  bun run lint # biome check
@@ -223,6 +231,15 @@ bun run lint # biome check
223
231
 
224
232
  See [AGENTS.md](AGENTS.md) for architecture and conventions, [CONTRIBUTING.md](CONTRIBUTING.md) for contribution workflow.
225
233
 
234
+ The interface adapts from a compact weather summary to an observatory with large temperatures,
235
+ weather artwork, an hourly chart, and seven forecast cards. Light and dark terminal appearances
236
+ both use contrast-adjusted text. Use `←` / `→` and `v` to inspect a day, `i` to inspect an hour,
237
+ and `?` for all shortcuts.
238
+
239
+ The preview uses a temporary config and recorded fixtures; it does not load or change your
240
+ normal locations. Try `bun run preview --light` for the light appearance. To export a terminal
241
+ frame as SVG, run `bun run preview --capture /tmp/weather.svg --width 120 --height 40`.
242
+
226
243
  ## License
227
244
 
228
245
  [MIT](LICENSE)