tuiweather 0.2.0 → 0.3.1

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 +47 -17
  2. package/dist/index.js +8120 -2015
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -4,26 +4,31 @@ Keyboard-driven terminal weather app: Dark Sky-style rain nowcasting, hourly and
4
4
 
5
5
  ## Features
6
6
 
7
- - **Rain nowcast** — minute-level "umbrella in N min" warnings derived from 15-minute precipitation buckets
8
- - **Hourly + daily forecast** — sparkline temperature strip, condition glyphs, precipitation probabilities
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
9
9
  - **Location search** — type `/`, search the Open-Meteo geocoder, enter to add; locations persist to config
10
10
  - **Guided first run** — choose units and find a location without editing a config file
11
11
  - **Units** — metric/imperial toggle persisted across runs
12
- - **Themes** — day, night, or auto (follows sunrise/sunset)
12
+ - **Themes** — day/night accent palettes follow the forecast location's sunrise/sunset; text ink adapts to your terminal's background
13
+ - **Air quality** — US AQI with category label in the details grid, from the Open-Meteo Air Quality API
13
14
  - **Responsive layout** — four breakpoint tiers down to 32 columns; clamps gracefully below that
14
15
  - **One-line mode** — a single status line for tmux bars and prompts
15
16
 
16
17
  ## Install
17
18
 
18
- The npm bootstrap package is available as `tuiweather@0.0.0` while the first supported release is prepared. Install the preview channel with Bun:
19
+ Install globally with npm:
19
20
 
20
21
  ```sh
21
- bun install --global tuiweather@next
22
+ npm install --global tuiweather
22
23
  ```
23
24
 
24
- Standalone binaries will be attached beginning with v0.1.0.
25
+ or with Bun:
25
26
 
26
- Download a standalone binary from [GitHub Releases](https://github.com/brndnsh-labs/tuiweather/releases).
27
+ ```sh
28
+ bun install --global tuiweather
29
+ ```
30
+
31
+ Standalone binaries for macOS and Linux are attached to each [GitHub release](https://github.com/brndnsh-labs/tuiweather/releases).
27
32
 
28
33
  ### macOS Gatekeeper
29
34
 
@@ -47,14 +52,20 @@ Use `tuiweather --help` for command-line options and `tuiweather --version` to p
47
52
  | --- | --- |
48
53
  | `r` | Refresh current location (bypasses cache) |
49
54
  | `[` / `]` | Previous / next location |
55
+ | `1`–`9` | Jump to location N by sidebar order (1-based; no-op out of range) |
50
56
  | `u` | Toggle metric / imperial units |
51
57
  | `/` | Search locations |
52
- | `d` | Delete active location |
58
+ | `d` | Delete active location (press twice to confirm) |
59
+ | `j` / `k` | Move sidebar focus down/up (lg tier only, wraps) |
60
+ | `enter` | Activate focused location (lg tier) |
61
+ | `s` | Set focused (or active when no focus) as default location |
62
+ | `J` / `K` | Move focused location down/up in sidebar order (lg tier) |
63
+ | `↑` / `↓` | Scroll the main panel when content overflows |
53
64
  | `?` | Toggle help overlay |
54
- | `esc` | Close help overlay; quits otherwise |
65
+ | `esc` | Clear sidebar focus if set; otherwise close help overlay or quit |
55
66
  | `q` | Quit |
56
67
 
57
- 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.
68
+ 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`).
58
69
 
59
70
  ### One-line mode
60
71
 
@@ -89,15 +100,33 @@ tuiweather --one-line --lat 45.52 --lon -122.67 --json | jq .temperatureC
89
100
  JSON values are always metric regardless of your configured units; the embedded `line` field
90
101
  matches the plain one-line output, which follows configured units.
91
102
 
103
+ ### Watch mode
104
+
105
+ `tuiweather watch` polls the nowcast on an interval and rings the terminal bell (`\a`) when rain
106
+ starts — leave it running in a pane and get pinged before you need the umbrella:
107
+
108
+ ```sh
109
+ tuiweather watch # poll every refresh_minutes
110
+ tuiweather watch --interval 5 # poll every 5 minutes (1–120)
111
+ tuiweather watch --location seattle
112
+ ```
113
+
114
+ Each poll prints the one-line status (prefixed with the location label). The bell rings only on a
115
+ dry → wet transition, not on every poll. Rain already in progress when the watch starts does not
116
+ bell. The bell depends on the minute-level nowcast, which is Open-Meteo only: under
117
+ `provider = "nws"` the nowcast panel hides and the bell stays inactive — nothing renders a false
118
+ "Dry". Desktop notifications are a planned follow-up.
119
+
92
120
  ## Configuration
93
121
 
94
- Config lives at `~/.config/tuiweather/config.toml` (respects `XDG_CONFIG_HOME`). Every field is optional unless marked required; unknown values fail validation with a descriptive error.
122
+ Config lives at `~/.config/tuiweather/config.toml` (respects `XDG_CONFIG_HOME`). Every field is optional unless marked required; unknown fields are ignored.
95
123
 
96
124
  ```toml
97
- schema_version = 2
125
+ schema_version = 3
98
126
  time_format = "auto"
99
127
  refresh_minutes = 10
100
128
  theme = "auto"
129
+ provider = "openmeteo"
101
130
  daily_days = 7
102
131
  hourly_hours = 24
103
132
  default_location = "portland"
@@ -123,17 +152,18 @@ longitude = -122.6765
123
152
 
124
153
  | Field | Type | Default | Constraints |
125
154
  | --- | --- | --- | --- |
126
- | `schema_version` | integer | `2` | Required; currently always `2`. Version 1 files are migrated in place on load |
155
+ | `schema_version` | integer | `3` | Required; currently always `3`. Version 1 and 2 files are migrated in place on load |
127
156
  | `time_format` | `12h` / `24h` / `auto` | `"auto"` | `auto` picks 12h when temperature units are imperial, else 24h |
128
157
  | `refresh_minutes` | integer | `10` | Minimum `1` |
129
- | `theme` | `day` / `night` / `auto` | `"auto"` | `auto` follows local sunrise/sunset |
158
+ | `theme` | `day` / `night` / `auto` | `"auto"` | Accent palette; `auto` follows the location's sunrise/sunset. Text ink always adapts to your terminal's background |
159
+ | `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 |
130
160
  | `daily_days` | integer | `7` | `1`–`16` forecast days |
131
161
  | `hourly_hours` | integer | `24` | `12`–`48` forecast hours |
132
162
  | `default_location` | string | none | Must match a `[[locations]]` slug |
133
163
  | `units.temp` | `metric` / `imperial` | legacy `units` | Display unit for temperatures |
134
164
  | `units.wind` | `metric` / `imperial` | legacy `units` | Display unit for wind speed and visibility |
135
165
  | `units.precip` | `metric` / `imperial` | legacy `units` | Display unit for precipitation amounts |
136
- | `units.pressure` | `metric` / `imperial` | legacy `units` | Reserved for future pressure display (pressure currently renders as hPa) |
166
+ | `units.pressure` | `metric` / `imperial` | legacy `units` | Display unit for pressure; `metric` → hPa (rounded), `imperial` inHg to 2 decimals; defaults via legacy `units` |
137
167
  | `panels.nowcast` | boolean | `true` | Show/hide the nowcast banner |
138
168
  | `panels.details` | boolean | `true` | Show/hide the details grid |
139
169
  | `panels.hourly` | boolean | `true` | Show/hide the hourly strip |
@@ -150,11 +180,11 @@ Each `[[locations]]` entry:
150
180
  | `latitude` | number | Required; `-90`–`90` |
151
181
  | `longitude` | number | Required; `-180`–`180` |
152
182
 
153
- Locations added through the search overlay are appended here automatically. Writes are atomic (temp file plus rename).
183
+ Locations added through the search overlay are appended here automatically. Press `s` (focused or active) to set `default_location` and `J`/`K` (lg tier, focused) to reorder `[[locations]]`. Writes are atomic (temp file plus rename).
154
184
 
155
185
  ## Data attribution
156
186
 
157
- Weather data by [Open-Meteo](https://open-meteo.com), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Open-Meteo's free tier is offered for non-commercial use; see [open-meteo.com/terms](https://open-meteo.com/terms) before relying on it commercially.
187
+ Weather data by [Open-Meteo](https://open-meteo.com), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Open-Meteo's free tier is offered for non-commercial use; see [open-meteo.com/terms](https://open-meteo.com/terms) before relying on it commercially. When `provider = "nws"` is configured, forecast data comes from the National Weather Service ([api.weather.gov](https://api.weather.gov)).
158
188
 
159
189
  ## Development
160
190