# pyxi1s/port-checker architecture

> Architecture diagram of the GitHub repository pyxi1s/port-checker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pyxi1s/port-checker
- Repository: https://github.com/pyxi1s/port-checker

## Overview

Port Checker is a small interactive Linux shell utility. The user runs one Bash script, which displays listening ports and accepts commands to refresh the list, inspect selected ports, or terminate their processes. Selection supports indexes or port numbers, ranges, lists, and exclusions. The README documents the external utilities used for discovery and process information; source excerpts were unavailable, so internal call order is not inferred.

Main entry points: [`port_checker.sh`](https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh) (Port Checker CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_cli["Port Checker CLI<br/>[port_checker.sh]"]
node_port_list["Listening Ports<br/>[port_checker.sh]"]
node_selection["Port Selection<br/>[port_checker.sh]"]
node_details["Port Details<br/>[port_checker.sh]"]
node_termination["Process Termination<br/>[port_checker.sh]"]
node_lsof["lsof"]
node_ss["ss"]
node_ps["ps"]
node_pstree["pstree"]

node_user -->|"runs"| node_cli
node_cli -->|"shows and refreshes"| node_port_list
node_cli -->|"accepts selection"| node_selection
node_cli -->|"handles detail"| node_details
node_cli -->|"handles kill"| node_termination
node_port_list -->|"gathers connections"| node_lsof
node_port_list -->|"detects protocol"| node_ss
node_details -->|"retrieves process info"| node_ps
node_details -->|"shows connections"| node_lsof
node_details -.->|"shows process tree"| node_pstree

click node_cli "https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh"
click node_port_list "https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh"
click node_selection "https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh"
click node_details "https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh"
click node_termination "https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh"

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_user toneBlue
class node_cli,node_port_list,node_selection,node_details,node_termination toneTeal
class node_lsof,node_ss,node_ps,node_pstree toneIndigo
```

## Components

### Other components

- **User**
- [Port Checker CLI](https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh): `port_checker.sh`
- [Listening Ports](https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh): `port_checker.sh`
- [Port Selection](https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh): `port_checker.sh`
- [Port Details](https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh): `port_checker.sh`
- [Process Termination](https://github.com/pyxi1s/port-checker/blob/main/port_checker.sh): `port_checker.sh`
- **lsof**
- **ss**
- **ps**
- **pstree**

## Connections

- User → Port Checker CLI: runs (evidence: `README.md`)
- Port Checker CLI → Listening Ports: shows and refreshes (evidence: `README.md`)
- Port Checker CLI → Port Selection: accepts selection (evidence: `README.md`)
- Port Checker CLI → Port Details: handles detail (evidence: `README.md`)
- Port Checker CLI → Process Termination: handles kill (evidence: `README.md`)
- Listening Ports → lsof: gathers connections (evidence: `README.md`)
- Listening Ports → ss: detects protocol (evidence: `README.md`)
- Port Details → ps: retrieves process info (evidence: `README.md`)
- Port Details → lsof: shows connections (evidence: `README.md`)
- Port Details → pstree: shows process tree (evidence: `README.md`)
