tuiweather 0.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 brndnsh-labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,146 @@
1
+ # tuiweather
2
+
3
+ Keyboard-driven terminal weather app: Dark Sky-style rain nowcasting, hourly and daily forecasts, and fast location search in a responsive TUI. Powered by [Open-Meteo](https://open-meteo.com) — free, keyless weather data.
4
+
5
+ ## Features
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
9
+ - **Location search** — type `/`, search the Open-Meteo geocoder, enter to add; locations persist to config
10
+ - **Units** — metric/imperial toggle persisted across runs
11
+ - **Themes** — day, night, or auto (follows sunrise/sunset)
12
+ - **Responsive layout** — four breakpoint tiers down to 32 columns; clamps gracefully below that
13
+ - **One-line mode** — a single status line for tmux bars and prompts
14
+
15
+ ## Install
16
+
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.
20
+
21
+ ```sh
22
+ bun install -g tuiweather
23
+ ```
24
+
25
+ > Coming in v0.1.0. Pre-release; binaries are not being attached to releases yet.
26
+
27
+ Download a standalone binary from [GitHub Releases](https://github.com/brndnsh-labs/tuiweather/releases).
28
+
29
+ ### macOS Gatekeeper
30
+
31
+ Release binaries are unsigned, so macOS may refuse to open them with an "unidentified developer" warning. Remove the quarantine attribute after downloading:
32
+
33
+ ```sh
34
+ xattr -d com.apple.quarantine /path/to/tuiweather
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ Run `tuiweather` with no arguments for the full TUI.
40
+
41
+ Use `tuiweather --help` for command-line options and `tuiweather --version` to print the installed version.
42
+
43
+ | Key | Action |
44
+ | --- | --- |
45
+ | `r` | Refresh current location (bypasses cache) |
46
+ | `[` / `]` | Previous / next location |
47
+ | `u` | Toggle metric / imperial units |
48
+ | `/` | Search locations |
49
+ | `d` | Delete active location |
50
+ | `?` | Toggle help overlay |
51
+ | `esc` | Close help overlay; quits otherwise |
52
+ | `q` | Quit |
53
+
54
+ 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.
55
+
56
+ ### One-line mode
57
+
58
+ `tuiweather --one-line` prints a single line and exits — designed for tmux status bars and shell prompts:
59
+
60
+ ```
61
+ ☀ 72° fl70 · ☂ in 15min · 55°–79° · ↗7mph nw
62
+ ```
63
+
64
+ Segments: current condition with feels-like, umbrella nowcast (omitted when dry), today's low/high, wind arrow with speed and compass point. The middle segment only appears when rain is starting, ongoing, or stopping within the nowcast window. Pass `--location <slug>` to pin a configured location.
65
+
66
+ In tmux:
67
+
68
+ ```ini
69
+ set -g status-interval 600
70
+ set -g status-right "#(tuiweather --one-line)"
71
+ ```
72
+
73
+ Responses are cached on disk, so frequent invocations stay cheap; cached data older than `refresh_minutes` triggers a refetch.
74
+
75
+ ## Configuration
76
+
77
+ 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
+
79
+ ```toml
80
+ schema_version = 1
81
+ units = "imperial"
82
+ refresh_minutes = 10
83
+ theme = "auto"
84
+ daily_days = 7
85
+ hourly_hours = 24
86
+ default_location = "portland"
87
+
88
+ [panels]
89
+ nowcast = true
90
+ details = true
91
+ hourly = true
92
+ daily = true
93
+
94
+ [[locations]]
95
+ slug = "portland"
96
+ label = "Portland"
97
+ latitude = 45.5202
98
+ longitude = -122.6765
99
+ ```
100
+
101
+ | Field | Type | Default | Constraints |
102
+ | --- | --- | --- | --- |
103
+ | `schema_version` | integer | `1` | Required; currently always `1` |
104
+ | `units` | `metric` / `imperial` | `"imperial"` | |
105
+ | `refresh_minutes` | integer | `10` | Minimum `1` |
106
+ | `theme` | `day` / `night` / `auto` | `"auto"` | `auto` follows local sunrise/sunset |
107
+ | `daily_days` | integer | `7` | `1`–`16` forecast days |
108
+ | `hourly_hours` | integer | `24` | `12`–`48` forecast hours |
109
+ | `default_location` | string | none | Must match a `[[locations]]` slug |
110
+ | `panels.nowcast` | boolean | `true` | Show/hide the nowcast banner |
111
+ | `panels.details` | boolean | `true` | Show/hide the details grid |
112
+ | `panels.hourly` | boolean | `true` | Show/hide the hourly strip |
113
+ | `panels.daily` | boolean | `true` | Show/hide the daily list |
114
+
115
+ Each `[[locations]]` entry:
116
+
117
+ | Field | Type | Constraints |
118
+ | --- | --- | --- |
119
+ | `slug` | string | Required; lowercase kebab-case (`^[a-z0-9]+(-[a-z0-9]+)*$`) |
120
+ | `label` | string | Required; 1–80 chars, shown in header/sidebar |
121
+ | `latitude` | number | Required; `-90`–`90` |
122
+ | `longitude` | number | Required; `-180`–`180` |
123
+
124
+ Locations added through the search overlay are appended here automatically. Writes are atomic (temp file plus rename).
125
+
126
+ ## Data attribution
127
+
128
+ 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.
129
+
130
+ ## Development
131
+
132
+ Requires [Bun](https://bun.sh) >= 1.3.
133
+
134
+ ```sh
135
+ bun install
136
+ bun run dev # run the TUI
137
+ bun run test # unit + snapshot tests
138
+ bun run typecheck # tsc --noEmit
139
+ bun run lint # biome check
140
+ ```
141
+
142
+ See [AGENTS.md](AGENTS.md) for architecture and conventions, [CONTRIBUTING.md](CONTRIBUTING.md) for contribution workflow.
143
+
144
+ ## License
145
+
146
+ [MIT](LICENSE)
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ import "../dist/index.js";