Skip to content

Saile-14/go-weather-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather CLI

A simple Go command-line application that fetches and displays the current weather for a specified location using the Weatherstack API.

Features

  • Fetches current weather conditions (temperature, description).
  • Displays the local time at the queried location.
  • If no location is provided, Tokyo is used by default 💯.
  • Colored console output for fun :)

Requirements

  1. Go installed on your system (1.16+ recommended).
  2. A Weatherstack API key (free tier available).
  3. A .env file containing your API key, or an environment variable.

Setup

  1. Clone or download this repository.

  2. Install dependencies:

    go get github.com/fatih/color
    go get github.com/joho/godotenv
    
  3. Create a .env file at the root of your project with the following content:

WEATHER_API_KEY=your_weatherstack_api_key_here

Usage

By running go run ./main.go, it will by default give you the weather, current time and current temperature of Tokyo. If you run go run ./main.go , you can check your own location 🔥 😄

enjoyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages