feat(weather): add weather search adapter#240
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
One major concern before the code-level issues:
Conflicts with PR #214
PR #214 (by 0xsline) already includes a full weather adapter with 11 commands (current, forecast, hourly, search, air, sunrise, etc.) using Open Meteo API — including the same file paths (src/clis/weather/search.yaml, docs/adapters/browser/weather.md). These two PRs can't both merge. Worth checking with the maintainer which direction to go.
URL encoding missing
${{ args.location }} is interpolated directly into the URL. Locations with spaces (e.g. "San Francisco") need encoding. Use ${{ args.location | urlencode }}.
location should be positional
Same issue as #241 — opencli weather search London is more natural than --location London.
config.mts not updated
PR checklist says sidebar was updated, but the diff doesn't include docs/.vitepress/config.mts.
Description
This PR introduces the new Weather adapter to OpenCLI. It leverages the completely free, lightning-fast
wttr.inJSON API to stream real-time global weather telemetry directly into the terminal without requiring browser sessions or API keys.Commands Added (
opencli weather):search- Instantly fetch live environmental conditions for any city or location (e.g.,opencli weather search --location "San Francisco").Note: Fully documented and structurally integrated into the VitePress website and project READMEs.
Related issue: N/A
Type of Change
Checklist
opencli validate)Documentation (if adding/modifying an adapter)
docs/adapters/(docs/adapters/browser/weather.md)docs/adapters/index.mdtabledocs/.vitepress/config.mtsScreenshots / Output
$ opencli weather search --location "San Francisco" weather/search ┌───────────┬──────┬───────┬──────────┬────────┐ │ Condition │ Temp │ Feels │ Humidity │ Wind │ ├───────────┼──────┼───────┼──────────┼────────┤ │ Clear │ 13°C │ 13°C │ 80% │ 5 km/h │ └───────────┴──────┴───────┴──────────┴────────┘ 1 items · 1.9s · weather/search