Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedayismyenemy/weathercli
Weather Command-Line Interface
https://github.com/thedayismyenemy/weathercli
cli command-line-interface dotnet-cli openweathermap weather weather-cli
Last synced: 6 days ago
JSON representation
Weather Command-Line Interface
- Host: GitHub
- URL: https://github.com/thedayismyenemy/weathercli
- Owner: TheDayIsMyEnemy
- License: mit
- Created: 2020-11-06T14:17:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-02T17:29:09.000Z (9 months ago)
- Last Synced: 2024-10-07T18:18:55.481Z (about 1 month ago)
- Topics: cli, command-line-interface, dotnet-cli, openweathermap, weather, weather-cli
- Language: C#
- Homepage:
- Size: 57.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WeatherCli
WeatherCli is a simple tool that allows you to retrieve weather data using the [OpenWeatherMap API](https://openweathermap.org), displaying the current weather in your terminal.
## Installation
To install WeatherCli, you need to download the [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0). Once installed, run the following command:
```bash
dotnet tool install -g weathercli
```Obtain a free API key [here](https://openweathermap.org/appid).
## Usage
### Current weather command
```bash
Usage: weather current [options]Arguments:
CityName You can call by city name or city name, state code and country codeOptions:
-d|--default Sets a default city name
-k|--apikey Sets an OpenWeatherMap API key
```Example using the current weather command:
```bash
weather current sofia -k YOUR_API_KEY
```Example of successful response:
> Sofia\
Mist -2°C\
Feels like -5°C. mist\
Wind 1.0m/s N, 1021hPa, Humidity: 92%\
Visibility: 2.8kmOptionally, you can omit the API key. To do that, you need to set the environment variable.
Windows command:
```bash
setx OPENWEATHERMAP_APIKEY YOUR_API_KEY
```Linux command:
```bash
export OPENWEATHERMAP_APIKEY=YOUR_API_KEY
```## Contribution
* If you want to contribute to this project, create a pull request
* If you find any bugs or error, create an issue## License
Distributed under the MIT License. See [LICENSE](https://github.com/TheDayIsMyEnemy/WeatherCli/blob/main/LICENSE) for more information.