tuiweather 0.0.0 → 0.1.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 +38 -9
  2. package/dist/index.js +3533 -2999
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -7,6 +7,7 @@ Keyboard-driven terminal weather app: Dark Sky-style rain nowcasting, hourly and
7
7
  - **Rain nowcast** — minute-level "umbrella in N min" warnings derived from 15-minute precipitation buckets
8
8
  - **Hourly + daily forecast** — sparkline temperature strip, condition glyphs, precipitation probabilities
9
9
  - **Location search** — type `/`, search the Open-Meteo geocoder, enter to add; locations persist to config
10
+ - **Guided first run** — choose units and find a location without editing a config file
10
11
  - **Units** — metric/imperial toggle persisted across runs
11
12
  - **Themes** — day, night, or auto (follows sunrise/sunset)
12
13
  - **Responsive layout** — four breakpoint tiers down to 32 columns; clamps gracefully below that
@@ -14,15 +15,13 @@ Keyboard-driven terminal weather app: Dark Sky-style rain nowcasting, hourly and
14
15
 
15
16
  ## Install
16
17
 
17
- The npm package and standalone binaries are planned for v0.1.0 and are **not yet available** — this is a pre-release repository. Until then, run from source (see Development).
18
-
19
- > Coming in v0.1.0. Pre-release; package not published yet.
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:
20
19
 
21
20
  ```sh
22
- bun install -g tuiweather
21
+ bun install --global tuiweather@next
23
22
  ```
24
23
 
25
- > Coming in v0.1.0. Pre-release; binaries are not being attached to releases yet.
24
+ Standalone binaries will be attached beginning with v0.1.0.
26
25
 
27
26
  Download a standalone binary from [GitHub Releases](https://github.com/brndnsh-labs/tuiweather/releases).
28
27
 
@@ -38,6 +37,10 @@ xattr -d com.apple.quarantine /path/to/tuiweather
38
37
 
39
38
  Run `tuiweather` with no arguments for the full TUI.
40
39
 
40
+ On the first run, tuiweather opens a short keyboard tour, asks for metric or imperial units, and
41
+ lets you search for your first location. The completed setup is written atomically to the normal
42
+ config path before weather data loads.
43
+
41
44
  Use `tuiweather --help` for command-line options and `tuiweather --version` to print the installed version.
42
45
 
43
46
  | Key | Action |
@@ -71,20 +74,40 @@ set -g status-right "#(tuiweather --one-line)"
71
74
  ```
72
75
 
73
76
  Responses are cached on disk, so frequent invocations stay cheap; cached data older than `refresh_minutes` triggers a refetch.
77
+ One-line mode is non-interactive; if no location is configured yet, run `tuiweather` once to
78
+ complete setup.
79
+
80
+ For scripting without a configured location, pass explicit coordinates instead of `--location`
81
+ (`--lat` −90..90 and `--lon` −180..180, required together). Add `--json` to print one line of
82
+ compact JSON — temperatures, wind, nowcast, today's low/high, and the status line itself — for
83
+ piping into `jq`:
84
+
85
+ ```sh
86
+ tuiweather --one-line --lat 45.52 --lon -122.67 --json | jq .temperatureC
87
+ ```
88
+
89
+ JSON values are always metric regardless of your configured units; the embedded `line` field
90
+ matches the plain one-line output, which follows configured units.
74
91
 
75
92
  ## Configuration
76
93
 
77
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.
78
95
 
79
96
  ```toml
80
- schema_version = 1
81
- units = "imperial"
97
+ schema_version = 2
98
+ time_format = "auto"
82
99
  refresh_minutes = 10
83
100
  theme = "auto"
84
101
  daily_days = 7
85
102
  hourly_hours = 24
86
103
  default_location = "portland"
87
104
 
105
+ [units]
106
+ temp = "metric"
107
+ wind = "imperial"
108
+ precip = "metric"
109
+ pressure = "metric"
110
+
88
111
  [panels]
89
112
  nowcast = true
90
113
  details = true
@@ -100,18 +123,24 @@ longitude = -122.6765
100
123
 
101
124
  | Field | Type | Default | Constraints |
102
125
  | --- | --- | --- | --- |
103
- | `schema_version` | integer | `1` | Required; currently always `1` |
104
- | `units` | `metric` / `imperial` | `"imperial"` | |
126
+ | `schema_version` | integer | `2` | Required; currently always `2`. Version 1 files are migrated in place on load |
127
+ | `time_format` | `12h` / `24h` / `auto` | `"auto"` | `auto` picks 12h when temperature units are imperial, else 24h |
105
128
  | `refresh_minutes` | integer | `10` | Minimum `1` |
106
129
  | `theme` | `day` / `night` / `auto` | `"auto"` | `auto` follows local sunrise/sunset |
107
130
  | `daily_days` | integer | `7` | `1`–`16` forecast days |
108
131
  | `hourly_hours` | integer | `24` | `12`–`48` forecast hours |
109
132
  | `default_location` | string | none | Must match a `[[locations]]` slug |
133
+ | `units.temp` | `metric` / `imperial` | legacy `units` | Display unit for temperatures |
134
+ | `units.wind` | `metric` / `imperial` | legacy `units` | Display unit for wind speed and visibility |
135
+ | `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) |
110
137
  | `panels.nowcast` | boolean | `true` | Show/hide the nowcast banner |
111
138
  | `panels.details` | boolean | `true` | Show/hide the details grid |
112
139
  | `panels.hourly` | boolean | `true` | Show/hide the hourly strip |
113
140
  | `panels.daily` | boolean | `true` | Show/hide the daily list |
114
141
 
142
+ 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.
143
+
115
144
  Each `[[locations]]` entry:
116
145
 
117
146
  | Field | Type | Constraints |