tuiweather 0.3.7 → 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 +51 -16
  2. package/dist/index.js +6996 -3814
  3. package/package.json +11 -9
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
 
@@ -30,7 +32,20 @@ or with the Bun package manager:
30
32
  bun install --global tuiweather
31
33
  ```
32
34
 
33
- Standalone binaries for macOS and Linux are attached to each [GitHub release](https://github.com/brndnsh-labs/tuiweather/releases).
35
+ or run without installing:
36
+
37
+ ```sh
38
+ npx tuiweather --version
39
+ bunx tuiweather --version
40
+ ```
41
+
42
+ Standalone binaries for macOS, Linux, and Windows (x64) are attached to each [GitHub release](https://github.com/brndnsh-labs/tuiweather/releases). On Windows (no Node or Bun required), in cmd.exe or any shell with `curl.exe` on PATH:
43
+
44
+ ```sh
45
+ curl.exe -Lo tuiweather-windows-x64.tar.gz https://github.com/brndnsh-labs/tuiweather/releases/latest/download/tuiweather-windows-x64.tar.gz
46
+ tar -xzf tuiweather-windows-x64.tar.gz
47
+ .\tuiweather.exe --version
48
+ ```
34
49
 
35
50
  ### macOS Gatekeeper
36
51
 
@@ -45,8 +60,9 @@ xattr -d com.apple.quarantine /path/to/tuiweather
45
60
  Run `tuiweather` with no arguments for the full TUI.
46
61
 
47
62
  On the first run, tuiweather opens a short keyboard tour, asks for metric or imperial units, and
48
- lets you search for your first location. The completed setup is written atomically to the normal
49
- config path before weather data loads.
63
+ lets you search for your first location. Press `s` on the welcome step to skip for now and see the
64
+ empty main view, or `o` from the help overlay to re-run setup later. The completed setup is written
65
+ atomically to the normal config path before weather data loads.
50
66
 
51
67
  Use `tuiweather --help` for command-line options and `tuiweather --version` to print the installed version.
52
68
 
@@ -54,6 +70,9 @@ Use `tuiweather --help` for command-line options and `tuiweather --version` to p
54
70
  | --- | --- |
55
71
  | `r` | Refresh current location (bypasses cache) |
56
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 |
57
76
  | `l` | Open the locations overlay: switch, set default, delete, reorder |
58
77
  | `1`–`9` | Jump to location N by sidebar order (1-based; no-op out of range) |
59
78
  | `u` | Toggle metric / imperial units |
@@ -65,13 +84,16 @@ Use `tuiweather --help` for command-line options and `tuiweather --version` to p
65
84
  | `J` / `K` | Move focused location down/up in sidebar order (lg tier) |
66
85
  | `↑` / `↓` | Scroll the main panel when content overflows |
67
86
  | `?` | Toggle help overlay |
68
- | `esc` | Clear sidebar focus if set; otherwise close help overlay or quit |
87
+ | `o` | Re-run setup (from help overlay) |
88
+ | `esc` | Close day detail first; otherwise clear sidebar focus or close the help overlay |
69
89
  | `q` | Quit |
70
90
 
71
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`).
72
92
 
73
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.
74
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
+
75
97
  ### One-line mode
76
98
 
77
99
  `tuiweather --one-line` prints a single line and exits — designed for tmux status bars and shell prompts:
@@ -127,10 +149,11 @@ bell. The bell depends on the minute-level nowcast, which is Open-Meteo only: un
127
149
  Config lives at `~/.config/tuiweather/config.toml` (respects `XDG_CONFIG_HOME`). Every field is optional unless marked required; unknown fields are ignored.
128
150
 
129
151
  ```toml
130
- schema_version = 3
152
+ schema_version = 4
131
153
  time_format = "auto"
132
154
  refresh_minutes = 10
133
155
  theme = "auto"
156
+ ink = "auto"
134
157
  provider = "openmeteo"
135
158
  daily_days = 7
136
159
  hourly_hours = 24
@@ -157,24 +180,26 @@ longitude = -122.6765
157
180
 
158
181
  | Field | Type | Default | Constraints |
159
182
  | --- | --- | --- | --- |
160
- | `schema_version` | integer | `3` | Required; currently always `3`. Version 1 and 2 files are migrated in place on load |
183
+ | `schema_version` | integer | `4` | Required; currently always `4`. Version 1, 2, and 3 files are migrated in place on load |
161
184
  | `time_format` | `12h` / `24h` / `auto` | `"auto"` | `auto` picks 12h when temperature units are imperial, else 24h |
162
185
  | `refresh_minutes` | integer | `10` | Minimum `1` |
163
- | `theme` | `day` / `night` / `auto` | `"auto"` | Accent palette; `auto` follows the location's sunrise/sunset. Text ink always adapts to your terminal's background |
186
+ | `reduced_motion` | boolean | `false` | Replace the animated loading spinner with a static indicator |
187
+ | `theme` | `day` / `night` / `auto` | `"auto"` | Accent palette; `auto` follows the location's sunrise/sunset. Text ink adapts via `ink` |
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 |
164
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 |
165
- | `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 |
166
191
  | `hourly_hours` | integer | `24` | `12`–`48` forecast hours |
167
192
  | `default_location` | string | none | Must match a `[[locations]]` slug |
168
- | `units.temp` | `metric` / `imperial` | legacy `units` | Display unit for temperatures |
169
- | `units.wind` | `metric` / `imperial` | legacy `units` | Display unit for wind speed and visibility |
170
- | `units.precip` | `metric` / `imperial` | legacy `units` | Display unit for precipitation amounts |
171
- | `units.pressure` | `metric` / `imperial` | legacy `units` | Display unit for pressure; `metric` → hPa (rounded), `imperial` → inHg to 2 decimals; defaults via legacy `units` |
172
- | `panels.nowcast` | boolean | `true` | Show/hide the nowcast banner |
173
- | `panels.details` | boolean | `true` | Show/hide the details grid |
193
+ | `units.temp` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for temperatures |
194
+ | `units.wind` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for wind speed and visibility |
195
+ | `units.precip` | `metric` / `imperial` | legacy `units`, else `imperial` | Display unit for precipitation amounts |
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 |
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) |
174
199
  | `panels.hourly` | boolean | `true` | Show/hide the hourly strip |
175
200
  | `panels.daily` | boolean | `true` | Show/hide the daily list |
176
201
 
177
- Each `[units]` field can be set independently, so mixed display such as °C temperatures with mph wind works everywhere including one-line mode. The legacy top-level `units = "metric" | "imperial"` scalar is still accepted and acts as the fallback for any `[units]` field you omit; because TOML forbids a key and table with the same name, saved configs contain either the scalar (uniform prefs) or the full `[units]` table (mixed prefs), never both.
202
+ Each `[units]` field can be set independently, so mixed display such as °C temperatures with mph wind works everywhere including one-line mode. The legacy top-level `units = "metric" | "imperial"` scalar is still accepted and acts as the fallback for any `[units]` field you omit; when neither the field nor the legacy scalar is set, the unit falls back to `imperial`. Because TOML forbids a key and table with the same name, saved configs contain either the scalar (uniform prefs) or the full `[units]` table (mixed prefs), never both.
178
203
 
179
204
  Each `[[locations]]` entry:
180
205
 
@@ -198,6 +223,7 @@ Requires [Bun](https://bun.sh) >= 1.3.
198
223
  ```sh
199
224
  bun install
200
225
  bun run dev # run the TUI
226
+ bun run preview # offline interface demo with recorded Portland + Tokyo weather
201
227
  bun run test # unit + snapshot tests
202
228
  bun run typecheck # tsc --noEmit
203
229
  bun run lint # biome check
@@ -205,6 +231,15 @@ bun run lint # biome check
205
231
 
206
232
  See [AGENTS.md](AGENTS.md) for architecture and conventions, [CONTRIBUTING.md](CONTRIBUTING.md) for contribution workflow.
207
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
+
208
243
  ## License
209
244
 
210
245
  [MIT](LICENSE)