Skip to main content

Overview

Ramadan CLI saves your configuration to avoid re-entering location and prayer settings every time. Configuration includes:
  • Location: City, country, latitude, longitude
  • Prayer Settings: Calculation method, juristic school, timezone
  • Custom Overrides: First roza date (optional)

First-Run Setup

When you run the CLI for the first time in a terminal (TTY), you’ll see an interactive setup:

Interactive Setup Flow

The setup uses Clack prompts to guide you through configuration:
  1. Location Detection
    • Automatically detects your location via IP geolocation
    • Shows detected city and country
    • Asks for confirmation
    • Allows manual entry if auto-detection fails
  2. Calculation Method
    • Recommends a method based on your country
    • Shows available methods (0-23)
    • You can accept recommendation or choose manually
  3. Juristic School
    • Recommends school based on your country
    • Options: Shafi (0) or Hanafi (1)
    • Affects Asr prayer time calculation
  4. Timezone
    • Auto-detects timezone from location
    • Can be manually set if needed
    • Ensures accurate countdown times

Auto-Detection

The CLI uses multiple IP geolocation providers with fallbacks:
If auto-detection succeeds:
If auto-detection fails:

When Interactive Setup Runs

Interactive setup runs when:
  • First time using the CLI
  • After roza reset
  • After roza config --clear
  • Running in a TTY (terminal)
  • No saved configuration exists
Passing a city as an argument temporarily bypasses your saved config for that run only.

Non-Interactive Configuration

Use the config command to manage settings without prompts.

Setting Configuration

Example: Complete Setup
Output:

Viewing Configuration

Example Output:

Updating Specific Settings

Update individual settings while keeping others:

Clearing Configuration

Or use the reset command:
Both commands clear all saved settings.

Configuration Options

Location Settings

string
City name for prayer time calculationExamples:
  • "San Francisco"
  • "Lahore"
  • "Vancouver"
Set via:
string
Country name for prayer time calculationExamples:
  • "United States"
  • "Pakistan"
  • "Canada"
Set via:
number
Geographic latitude (-90 to 90)Examples:
  • 37.7749 (San Francisco)
  • 31.5497 (Lahore)
  • 49.2827 (Vancouver)
Set via:
number
Geographic longitude (-180 to 180)Examples:
  • -122.4194 (San Francisco)
  • 74.3436 (Lahore)
  • -123.1207 (Vancouver)
Set via:

Prayer Calculation Settings

number
Calculation method ID (0-23)Determines how Fajr and Isha times are calculated. Each Islamic organization uses different angles.Common Methods:
  • 0 - Shia Ithna-Ashari
  • 1 - University of Islamic Sciences, Karachi
  • 2 - Islamic Society of North America (ISNA)
  • 3 - Muslim World League
  • 4 - Umm Al-Qura University, Makkah
  • 5 - Egyptian General Authority of Survey
  • 15 - Institute of Geophysics, University of Tehran
See Aladhan API Methods for complete list.Set via:
number
Juristic school for Asr calculation (0 or 1)Values:
  • 0 - Shafi, Maliki, Hanbali, Jafari (standard)
  • 1 - Hanafi (earlier Asr time)
Set via:
string
IANA timezone identifierEnsures accurate countdowns and times for your location.Examples:
  • America/Los_Angeles
  • America/New_York
  • Asia/Karachi
  • Asia/Dubai
  • Europe/London
  • America/Vancouver
Set via:

Custom First Roza Date

By default, Ramadan CLI uses the Hijri calendar from the Aladhan API to determine Ramadan dates. You can override this with a custom first roza date.

Setting Custom Date

This setting persists across runs:

Clearing Custom Date

Revert to API-provided Ramadan dates:

Date Format

Must use ISO 8601 date format:
Valid Examples:
  • 2026-02-19
  • 2026-03-01
  • 2027-02-08
Invalid Examples:
  • 19-02-2026
  • 02/19/2026
  • 2026/02/19

Use Cases

Your local community starts Ramadan based on local moonsighting:

How It Works

When a custom first roza date is set:
  1. Roza 1 = Your specified date
  2. Roza 2 = Your specified date + 1 day
  3. Roza 3 = Your specified date + 2 days
  4. … and so on for all 30 days
The CLI fetches prayer times for each calculated date from the API.
The custom date takes precedence over the API’s Hijri calendar. Make sure your date is accurate!

Country-Aware Recommendations

Ramadan CLI automatically recommends calculation methods and schools based on your country.

How Recommendations Work

The CLI:
  1. Detects country is Pakistan
  2. Recommends method 1 (University of Islamic Sciences, Karachi)
  3. Recommends school 1 (Hanafi)
  4. Auto-applies recommendations if using default settings

When Recommendations Apply

Recommendations auto-apply when:
  • Using default/unset method or school
  • First-run interactive setup
  • No explicit config override
You can always override recommendations by explicitly setting your preferred method and school in the config.

Configuration Precedence

Ramadan CLI resolves configuration in this order (highest to lowest priority):
  1. Command-line arguments/flags
  2. Saved configuration
  3. Auto-detected location
  4. Interactive setup (if TTY available)
  5. Error (if all else fails)

Examples


Configuration Storage

Configuration is stored in a local file on your system.

Default Location

  • macOS/Linux: ~/.config/ramadan-cli/config.json
  • Windows: %APPDATA%\ramadan-cli\config.json

Custom Storage Location

Override the storage directory:
Use Cases:
  • Testing with isolated configs
  • Multiple user profiles
  • Agent skill packages
  • CI/CD environments

What’s Stored

The config file contains:
The config file is created automatically. You don’t need to create or edit it manually.

Configuration for Different Use Cases

Personal Use

Scripts and Automation

CI/CD Environments

Status Bars (tmux, i3, waybar)

Coding Agents


Troubleshooting Configuration

Check Current Configuration

Test Different Locations

Reset and Reconfigure

Verify Configuration Works


Next Steps

Commands

Learn about all available commands

Flags and Options

Complete reference of command-line flags