# CLI-Mate

CLI-mate is a high-accuracy, command-line weather forecast utility styled with the Gruvbox color palette. It features a local JSON database for city caching, automatic day/night emoji rendering based on real-time sunrise/sunset calculations, and four custom display modes.

---

## Features

- Local Database Caching (`database.json`): Saves your cities and their coordinates so you can query them instantly.
- Dynamic Day/Night Emoji Cycle: Automatically determines if it is day or night at the forecast time using local sunrise/sunset values, switching between sun ☀️ and moon 🌙 icons.
- Chronological Timeline Sorting: Seamlessly merges and sorts weather forecasts, sunrise, and sunset times in chronological order.
- Four Display Modes:
  - Short: Just the current temperature, weather conditions, and a custom weather ASCII art.
  - Default: Current weather plus upcoming 3-hour interval forecasts and tomorrow's midday outlook.
  - Detailed: Comprehensive, scroll-safe 42-hour vertical forecast timeline.
  - Daily: Multi-day weekly forecast summary with customizable metrics.

---

## Libraries Used (Dependencies)

The application is written in Python 3 and utilizes the following libraries:

- `requests`: For making HTTP requests to meteorological APIs.
- `rich`: For building color-coded tables, borders, and styled CLI layouts.

---

## Installation and Setup

You can install climate on your system using one of the following methods:

### Method 1: Install via .deb Package (Recommended for Ubuntu/Debian)
This automatically registers the global climate command and resolves all system-wide dependencies.

1. Go to the [Releases](https://github.com/kamilyarkaev/CLI-mate/releases) page of this repository.
2. Download the latest .deb package (e.g., climate_1.4_all.deb).
3. Open your terminal in the directory where the file was downloaded and run:
   ```bash
   sudo apt install ./climate_1.4_all.deb
   ```
4. Run the application from anywhere by typing:
   ```bash
   climate
   ```

### Method 2: Setup from Source Code (For testing or non-Debian systems)
1. Clone the repository:
   ```bash
   git clone https://github.com/kamilyarkaev/CLI-mate.git
   cd CLI-mate
   ```
2. Set up a virtual environment:
   ```bash
   python3 -m venv venv
   source venv/bin/activate
   ```
3. Install the dependencies inside the virtual environment:
   ```bash
   pip install requests rich
   ```
4. Run the application:
   ```bash
   python3 main.py
   ```