Overview
Ramadan CLI is built for both humans and agents. It can be installed as a skill package for coding agents and AI tools, providing programmatic access to Ramadan prayer times with multiple output formats.Installation
Installing as a Skill
Add ramadan-cli to your agent’s skill registry:Manual Installation
For direct integration:Agent-Friendly Features
JSON Output
Structured JSON format for parsing and processing
Status Line Mode
Single-line output perfect for status bars
Non-Interactive Config
Programmatic configuration without prompts
Isolated State
Environment variable for isolated config storage
Isolated Configuration
Always isolate config in automation to avoid polluting user or global state.
RAMADAN_CLI_CONFIG_DIR environment variable to specify an isolated config directory:
Reset Isolated State
Non-Interactive Configuration
Configure the CLI programmatically without interactive prompts:Config Management
Agent Usage Patterns
Query Without Saved Config
Agents can query specific cities without saving configuration:One-off city queries do not overwrite saved default location.
Handling Interactive Prompts
The CLI behavior depends on the output mode:- JSON Mode
- Status Mode
- Standard Mode
Automatically skips interactive setup:Falls back to IP geolocation if no config exists.
Exit Codes and Error Handling
The CLI uses standard exit codes for automation:| Exit Code | Meaning |
|---|---|
0 | Success |
1 | Runtime failure (network/API/validation/data) |
Error Handling in Scripts
JSON Error Format
When using--json, errors are written to stderr as structured JSON:
Error Codes Reference
Error Codes Reference
| Code | Description |
|---|---|
INVALID_FIRST_ROZA_DATE | Invalid date format for --first-roza-date |
INVALID_FLAG_COMBINATION | Conflicting flags (e.g., --all with --number) |
PRAYER_TIMES_FETCH_FAILED | Could not fetch prayer times from API |
RAMADAN_CALENDAR_FETCH_FAILED | Could not fetch Ramadan calendar |
LOCATION_DETECTION_FAILED | Could not detect or resolve location |
ROZA_NOT_FOUND | Specified roza number not found |
RAMADAN_CLI_ERROR | General error |
UNKNOWN_ERROR | Unexpected error occurred |
Example: Agent Integration
Here’s a complete example of integrating ramadan-cli into an agent workflow:Testing Agent Integration
Best Practices
Use Isolated Config Directories
Use Isolated Config Directories
Always set
RAMADAN_CLI_CONFIG_DIR to avoid interfering with user configuration:Prefer JSON Output
Prefer JSON Output
Use
--json for reliable parsing and to skip interactive prompts:Handle Errors Gracefully
Handle Errors Gracefully
Check exit codes and parse error JSON:
Use Status Mode for Display
Use Status Mode for Display
For status bars and simple displays, use
--status: