Skip to content

Go application provides a command-line interface (CLI) tool for retrieving weather information for a specified location using the Weather API

Notifications You must be signed in to change notification settings

Shreyank031/go_cli-weatherApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather CLI - Get Weather Information from the Command Line

This Go application provides a command-line interface (CLI) tool for retrieving weather information for a specified location using the Weather API

Features

  1. Fetches current weather conditions and hourly forecast for a location.

  2. Displays temperature, weather description, and chance of rain for upcoming hours.

  3. Highlights rainy hours.

Installation

Prerequisites:

  • Go should be installed on your system

Steps

Clone this repository

https://github.com/Shreyank031/go_cli-weatherApp.git

Navigate to the project directory:

cd go_cli-weatherApp

Setting up your .env file

This weather CLI application utilizes the godotenv package to manage the API key securely. Here's how to configure it:

  1. Create a .env file: Create a file named .env in the root directory of your project (where the main.go file resides).

  2. Add your API key:

Inside the .env file, add a line in the following format:

ApiKey=<your_api_key>

Replace <your_api_key> with the actual API key obtained from the Weather API website.

Download the dependencies

go mod download

Build the executable:

go build main.go

Usage

Run the application

./go_cli-weatherApp <location>

Replace <location> with desired location name(e.g., Bengaluru, Tokyo) Note: If you don't provide the location name, by default it will consider Bengaluru

Example Output

go-cli

About

Go application provides a command-line interface (CLI) tool for retrieving weather information for a specified location using the Weather API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages