Skip to content

myntdeveloper/weather-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather CLI

A simple, colorized command-line weather checker written in Go.

Features

  • Get current weather for any city
  • Displays temperature, feels-like, humidity, wind speed and advice based on conditions
  • Unicode weather icons and colorized terminal output for clarity

Usage

Quick Start

  1. Clone this repository

    git clone https://github.com/myntdeveloper/weather-cli.git
    cd weather-cli
  2. Set the API key

    Get your API key from OpenWeatherMap and set it as an environment variable.
    Example:

    export WEATHER_API_KEY=your_api_key

    (You must set this environment variable before running the CLI.)

  3. Build the binary

    go build -o weather ./cmd
  4. Get weather for a city

    ./weather -city London

    (By default, the city is set to "Tokyo" if you don't provide the flag.)

Example .env file

WEATHER_API_KEY=your_api_key

CLI Options

Flag Description Default
-city City to check weather for Tokyo

Example Output

When you run:

./weather -city Moscow

You might see output like:

image image image

Directory Structure

weather-cli/
├── cmd/
│   └── main.go             # Entrypoint, CLI logic
├── internal/
│   ├── commands/           # CLI command handling
│   │   └── root.go
│   └── logic/              # Core logic (fetching, models, pretty print)
│       ├── models.go
│       └── weather.go
├── go.mod
└── README.md

Prerequisites


Built with ❤️ by mynt

About

simple command-line weather checker written in Go

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages