npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anonydev3/weather-cli

v1.0.7

Published

Node.js CLI app to check weather by location

Downloads

136

Readme

cli-weather

A beautiful, AI-powered weather CLI with smart fallbacks. Get instant weather insights for any city worldwide.

npm npm GitHub

⚡ Quick Start

Install globally:

npm install -g @anonydev3/weather-cli

Check weather instantly:

cli-weather "New York"
cli-weather "Tokyo"
cli-weather "London" --forecast

Ask AI questions:

cli-weather "Hanoi" --ask "Can I go for a walk tomorrow?"
cli-weather "Paris" --ask "Should I bring an umbrella?" --when tomorrow

That's it! No API keys or setup required. 🎉


Features

Instant weather - Current conditions for any city
3-day forecast - With -f or --forecast flag
AI insights - Smart recommendations via Gemini AI
Ask mode - Natural language weather questions
Smart fallbacks - Works even when AI quota is exceeded
Location aliases - Save favorites with --save home
No setup needed - Works out of the box
Cached responses - Faster repeat queries


Usage Examples

Basic Weather

cli-weather "Ho Chi Minh City"
cli-weather "Berlin" --units imperial

With Forecast

cli-weather "Tokyo" --forecast
cli-weather "Sydney" -f

Ask AI Questions

cli-weather "Hanoi" --ask "Can I go for a walk tomorrow?"
cli-weather "London" --ask "Should I bring an umbrella?" --when tomorrow
cli-weather "Paris" --ask "Is it good weather for cycling?" --date 2026-03-20

Quick Date Check

cli-weather "Bangkok" --date-check 2026-03-18
cli-weather "Seoul" --when tomorrow --date-check

Save Favorite Locations

cli-weather "Hanoi" --save home
cli-weather "home" --ask "Can I run outside?"
cli-weather --list-saved
cli-weather --remove home

Full Options

cli-weather --help

CLI Options

| Option | Description | |--------|-------------| | -a, --ask "question" | Ask Gemini a weather question | | --when <date> | Natural date: today, tomorrow, monday, or YYYY-MM-DD | | --date <YYYY-MM-DD> | Specific date for ask mode | | --date-check | Quick weather check for a date | | --save <alias> | Save location with alias (e.g., --save home) | | --list-saved | List all saved aliases | | --remove <alias> | Remove saved alias | | -u, --units | metric (default) or imperial | | -f, --forecast | Show 3-day forecast | | --no-color | Disable ANSI colors | | -h, --help | Show help |


Output Examples

Current Weather

[ Weather for Hanoi, Hanoi, Vietnam ]
----------------------------------------------------------------
Condition:         Overcast, warm, and humid
AI Summary:        Hanoi is experiencing warm, overcast conditions...
AI Recommendation: Stay hydrated and enjoy the comfortable weather.
AI Outfit Tip:     Wear light, breathable clothing.
Source:            AI
----------------------------------------------------------------
Temperature:       26.7 C
Feels like:        27.9 C
Humidity:          61%
Wind Speed:        17.4 km/h
...

AI Q&A

[ Gemini Q&A ]
----------------------------------------------------------------
Question:          Can I go for a walk tomorrow?
Target Date:       2026-03-18
Answer:            Yes, tomorrow looks suitable for a walk with 
                   overcast skies and temperatures from 20-28.5°C.
Source:            AI

For Contributors & Developers

Local Development

Clone and install:

git clone https://github.com/orinnz/weather-cli.git
cd weather-cli
pnpm install

Run locally:

pnpm start -- "London"
pnpm start -- "Tokyo" --forecast
pnpm start -- "Hanoi" --ask "Can I walk tomorrow?"

Development mode:

pnpm run dev        # Watch mode
pnpm run build      # Build only
pnpm run check      # Type check
pnpm test           # Run tests

Environment Variables (Optional)

Create a .env file for local development:

# Your Gemini API key (optional - has fallback mode)
GEMINI_API_KEY=your_api_key_here

# Custom AI proxy URL (optional)
WEATHER_API_BASE_URL=https://your-proxy.workers.dev
WEATHER_API_TOKEN=your_proxy_token

# Model override (optional)
GEMINI_MODEL=gemini-2.5-flash

Note: The CLI works without any env variables using the hosted proxy.

Deploy Your Own Proxy (Optional)

If you want to use your own Gemini API key:

  1. Setup Cloudflare Worker:
cd cloudflare-worker
npm i -g wrangler
wrangler login
wrangler secret put GEMINI_API_KEY
wrangler deploy
  1. Configure CLI:
# .env
WEATHER_API_BASE_URL=https://weather-cli-proxy.<your-subdomain>.workers.dev

Tech Stack

  • Runtime: Node.js 18+ (ESM)
  • Language: TypeScript
  • Weather API: Open-Meteo (free, no key required)
  • Geocoding: Open-Meteo Geocoding
  • AI: Google Gemini 2.5 Flash
  • Proxy: Cloudflare Workers
  • Caching: Local JSON cache

License

MIT © Phuoc