# nithishduda-ai/pagerduty-oncall-ack architecture

> Architecture diagram of the GitHub repository nithishduda-ai/pagerduty-oncall-ack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nithishduda-ai/pagerduty-oncall-ack
- Repository: https://github.com/nithishduda-ai/pagerduty-oncall-ack

## Overview

PagerDuty On-Call Ack is a narrow CLI and optional terminal dashboard for checking a configured user’s on-call status and acknowledging only their triggered incidents. The main workflow validates configuration and PagerDuty access, checks on-call eligibility, lists assigned open incidents, then acknowledges eligible incidents only in apply mode; it also supports dry runs and watch mode. The dashboard polls and presents the same state. The implementation is concentrated in cli.py and tui.py; unsampled command details are represented only where the README documents them.

Main entry points: [`src/pagerduty_oncall_ack/cli.py`](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py) (CLI commands), [`src/pagerduty_oncall_ack/tui.py`](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/tui.py) (Polling dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and setup"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_configuration["Configuration<br/>[cli.py]"]
  node_access_check["Access validation<br/>[cli.py]"]
end

subgraph group_runtime["Incident workflow"]
  node_api_client["PagerDuty client<br/>[cli.py]"]
  node_oncall["On-call eligibility<br/>[cli.py]"]
  node_incident_listing["Assigned incidents<br/>[cli.py]"]
  node_acknowledgement["Safe acknowledgement<br/>[cli.py]"]
end

subgraph group_dashboard["Terminal dashboard"]
  node_dashboard["Polling dashboard<br/>[tui.py]"]
  node_snapshot["Dashboard snapshot<br/>[tui.py]"]
end

node_operator(("Operator"))
node_pagerduty{{"PagerDuty REST API"}}

node_operator -->|"runs commands"| node_cli
node_operator -->|"opens dashboard"| node_dashboard
node_cli -->|"loads settings"| node_configuration
node_cli -->|"dispatches doctor"| node_access_check
node_cli -->|"creates client"| node_api_client
node_access_check -->|"validates access"| node_api_client
node_api_client -->|"sends API requests"| node_pagerduty
node_cli -->|"checks schedule"| node_oncall
node_oncall -->|"fetches on-calls"| node_api_client
node_cli -->|"lists incidents"| node_incident_listing
node_incident_listing -->|"fetches incidents"| node_api_client
node_cli -->|"runs eligible ack"| node_acknowledgement
node_acknowledgement -->|"acknowledges incident"| node_api_client
node_dashboard -->|"collects state"| node_api_client
node_dashboard -->|"builds snapshot"| node_snapshot
node_snapshot -->|"includes status"| node_oncall
node_snapshot -->|"includes incidents"| node_incident_listing
node_dashboard -->|"acknowledges eligible"| node_acknowledgement

click node_cli "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_configuration "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_access_check "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_api_client "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_oncall "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_incident_listing "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_acknowledgement "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py"
click node_dashboard "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/tui.py"
click node_snapshot "https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/tui.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_configuration,node_access_check toneBlue
class node_api_client,node_oncall,node_incident_listing,node_acknowledgement toneAmber
class node_dashboard,node_snapshot,node_pagerduty toneMint
class node_operator toneIndigo
```

## Components

### CLI and setup

- [CLI commands](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`
- [Configuration](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`
- [Access validation](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`

### Incident workflow

- [PagerDuty client](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`
- [On-call eligibility](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`
- [Assigned incidents](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`
- [Safe acknowledgement](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/cli.py): `src/pagerduty_oncall_ack/cli.py`

### Terminal dashboard

- [Polling dashboard](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/tui.py): `src/pagerduty_oncall_ack/tui.py`
- [Dashboard snapshot](https://github.com/nithishduda-ai/pagerduty-oncall-ack/blob/main/src/pagerduty_oncall_ack/tui.py): `src/pagerduty_oncall_ack/tui.py`

### Other components

- **Operator**
- **PagerDuty REST API**

## Connections

- Operator → CLI commands: runs commands (evidence: `README.md`)
- Operator → Polling dashboard: opens dashboard (evidence: `README.md`)
- CLI commands → Configuration: loads settings (evidence: `README.md`)
- CLI commands → Access validation: dispatches doctor (evidence: `README.md`)
- CLI commands → PagerDuty client: creates client (evidence: `src/pagerduty_oncall_ack/cli.py`)
- Access validation → PagerDuty client: validates access (evidence: `src/pagerduty_oncall_ack/cli.py`)
- PagerDuty client → PagerDuty REST API: sends API requests (evidence: `src/pagerduty_oncall_ack/cli.py`)
- CLI commands → On-call eligibility: checks schedule (evidence: `src/pagerduty_oncall_ack/cli.py`)
- On-call eligibility → PagerDuty client: fetches on-calls (evidence: `README.md`)
- CLI commands → Assigned incidents: lists incidents (evidence: `src/pagerduty_oncall_ack/cli.py`)
- Assigned incidents → PagerDuty client: fetches incidents (evidence: `src/pagerduty_oncall_ack/cli.py`)
- CLI commands → Safe acknowledgement: runs eligible ack (evidence: `src/pagerduty_oncall_ack/cli.py`)
- Safe acknowledgement → PagerDuty client: acknowledges incident (evidence: `src/pagerduty_oncall_ack/cli.py`)
- Polling dashboard → PagerDuty client: collects state (evidence: `src/pagerduty_oncall_ack/tui.py`)
- Polling dashboard → Dashboard snapshot: builds snapshot (evidence: `src/pagerduty_oncall_ack/tui.py`)
- Dashboard snapshot → On-call eligibility: includes status (evidence: `src/pagerduty_oncall_ack/tui.py`)
- Dashboard snapshot → Assigned incidents: includes incidents (evidence: `src/pagerduty_oncall_ack/tui.py`)
- Polling dashboard → Safe acknowledgement: acknowledges eligible (evidence: `src/pagerduty_oncall_ack/tui.py`)
