https://github.com/zoelabbb/gweather
This is a simple command-line tool ( CLI ) built with Golang that provides weather forecasts using the WeatherAPI from RapidAPI. The Weather CLI allows users to check the current weather and a three-day forecast for a specific location.
https://github.com/zoelabbb/gweather
cli forecast golang json rapidapi weather weather-app
Last synced: 4 months ago
JSON representation
This is a simple command-line tool ( CLI ) built with Golang that provides weather forecasts using the WeatherAPI from RapidAPI. The Weather CLI allows users to check the current weather and a three-day forecast for a specific location.
- Host: GitHub
- URL: https://github.com/zoelabbb/gweather
- Owner: zoelabbb
- Created: 2023-12-09T16:50:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-10T10:35:44.000Z (about 2 years ago)
- Last Synced: 2024-12-27T14:24:29.575Z (about 1 year ago)
- Topics: cli, forecast, golang, json, rapidapi, weather, weather-app
- Language: Go
- Homepage:
- Size: 1 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# 🌦 GWeather - A Golang Weather CLI
GWeather is a command-line interface (CLI) written in Golang that provides weather forecasts using the WeatherAPI from RapidAPI.
[](https://github.com/sponsors/zoelabbb)

[](https://github.com/zoelabbb)
## Installation
1. Clone the repository:
```bash
git clone https://github.com/zoelabbb/Gweather.git
```
2. Navigate to the project directory:
```bash
cd Gweather
```
3. Create a `.env` file with your RapidAPI key and host:
```env
RAPID_API_KEY=your-rapidapi-key
RAPID_API_HOST=weatherapi-com.p.rapidapi.com
```
Get your key and host from [RapidAPI Here](https://rapidapi.com/weatherapi/api/weatherapi-com)
4. Build the application:
```bash
go build -o Gweather
```
5. Move the executable to your path:
```bash
mv Gweather /usr/local/bin
```
6. Run the application:
```bash
Gweather {city}
```
## Usage
Run the application with an optional city parameter to get the weather forecast. If no city is provided, it defaults to **"Denpasar"**.
```bash
Gweather Denpasar
```

The percentage chance of rain can vary depending on the data source and specific geographic area. However, in general :
- Less than 40%: Low chance of rain. ( Green )
- Between 40% - 70%: Chance of rain. ( Yellow )
- Over 70%: High chance of rain. ( Red )
## Dependencies
- [github.com/fatih/color](https://pkg.go.dev/github.com/fatih/color)
- [github.com/joho/godotenv](https://pkg.go.dev/github.com/joho/godotenv)
## Configuration
Configure the application by setting your RapidAPI key and host in the `.env` file.
## Contributing
1. Fork the repository (https://github.com/zoelabbb/Gweather/fork)
2. Create a new branch (`git checkout -b feature-new`)
3. Commit your changes (`git commit -am 'Add new feature'`)
4. Push to the branch (`git push origin feature-new`)
5. Create a new Pull Request
## Contact
For questions or suggestions, feel free to contact me:
- [Ryu as a Dev](mailto:alifryuuofficial@gmail.com)