# kevincrrl/kpa architecture

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

- Interactive diagram: https://gitdiagram.com/kevincrrl/kpa
- Repository: https://github.com/kevincrrl/kpa

## Overview

KPA is a Python AUR helper CLI. Its principal workflow manages AUR package repositories, reviews PKGBUILDs and safety warnings, resolves dependencies, and invokes package building/installation; it also supports updates, removal, cache cleanup, and configuration. The graph separates command orchestration from AUR/Git access and shared configuration and safety utilities. Some command-handler excerpts omit the calls connecting these stages, so those links are dashed rather than asserted as verified.

Main entry points: [`kpa/funciones.py`](https://github.com/kevincrrl/kpa/blob/main/kpa/funciones.py) (Command handlers), [`kpa/extra_utils.py`](https://github.com/kevincrrl/kpa/blob/main/kpa/extra_utils.py) (Safety and cache utilities), [`kpa/aurapi.py`](https://github.com/kevincrrl/kpa/blob/main/kpa/aurapi.py) (AUR metadata), [`kpa/colorprints.py`](https://github.com/kevincrrl/kpa/blob/main/kpa/colorprints.py) (Terminal formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_entrypoint["Application entry<br/>[kpa.py]"]
end

subgraph group_package["Package management"]
  node_commands["Command handlers<br/>[funciones.py]"]
end

subgraph group_services["External access"]
  node_aur["AUR metadata<br/>[aurapi.py]"]
  node_git_ops["Git operations<br/>[git.py]"]
end

subgraph group_support["Shared support"]
  node_config["Configuration<br/>[parser.py]"]
  node_utilities["Safety and cache utilities<br/>[extra_utils.py]"]
  node_output["Terminal formatting<br/>[colorprints.py]"]
end

node_user(("CLI user"))
node_aur_service{{"AUR RPC"}}
node_git_service{{"Git remotes"}}
node_system_pkg{{"System package tools"}}

node_user -->|"runs CLI"| node_entrypoint
node_entrypoint -->|"starts commands"| node_commands
node_commands -.->|"checks packages"| node_aur
node_aur -->|"queries metadata"| node_aur_service
node_commands -.->|"manages repositories"| node_git_ops
node_git_ops -->|"clones and fetches"| node_git_service
node_commands -.->|"builds and manages packages"| node_system_pkg
node_commands -->|"checks safety and cleans cache"| node_utilities
node_utilities -->|"gets package warnings"| node_aur
node_commands -->|"reads and updates settings"| node_config
node_commands -->|"prints status"| node_output
node_utilities -->|"prints prompts and warnings"| node_output
node_config -->|"reports config issues"| node_output

click node_entrypoint "https://github.com/kevincrrl/kpa/blob/main/kpa/kpa.py"
click node_commands "https://github.com/kevincrrl/kpa/blob/main/kpa/funciones.py"
click node_aur "https://github.com/kevincrrl/kpa/blob/main/kpa/aurapi.py"
click node_git_ops "https://github.com/kevincrrl/kpa/blob/main/kpa/git.py"
click node_config "https://github.com/kevincrrl/kpa/blob/main/kpa/parser.py"
click node_utilities "https://github.com/kevincrrl/kpa/blob/main/kpa/extra_utils.py"
click node_output "https://github.com/kevincrrl/kpa/blob/main/kpa/colorprints.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_entrypoint,node_user toneBlue
class node_commands toneAmber
class node_aur,node_git_ops toneMint
class node_config,node_utilities,node_output toneRose
class node_aur_service,node_git_service,node_system_pkg toneIndigo
```

## Components

### CLI entry

- [Application entry](https://github.com/kevincrrl/kpa/blob/main/kpa/kpa.py): `kpa/kpa.py`

### Package management

- [Command handlers](https://github.com/kevincrrl/kpa/blob/main/kpa/funciones.py): `kpa/funciones.py`

### External access

- [AUR metadata](https://github.com/kevincrrl/kpa/blob/main/kpa/aurapi.py): `kpa/aurapi.py`
- [Git operations](https://github.com/kevincrrl/kpa/blob/main/kpa/git.py): `kpa/git.py`

### Shared support

- [Configuration](https://github.com/kevincrrl/kpa/blob/main/kpa/parser.py): `kpa/parser.py`
- [Safety and cache utilities](https://github.com/kevincrrl/kpa/blob/main/kpa/extra_utils.py): `kpa/extra_utils.py`
- [Terminal formatting](https://github.com/kevincrrl/kpa/blob/main/kpa/colorprints.py): `kpa/colorprints.py`

### Other components

- **CLI user**
- **AUR RPC**
- **Git remotes**
- **System package tools**

## Connections

- CLI user → Application entry: runs CLI (evidence: `kpa/kpa.py`)
- Application entry → Command handlers: starts commands (evidence: `kpa/kpa.py`)
- Command handlers → AUR metadata: checks packages (evidence: `kpa/funciones.py`)
- AUR metadata → AUR RPC: queries metadata (evidence: `kpa/aurapi.py`)
- Command handlers → Git operations: manages repositories (evidence: `kpa/funciones.py`)
- Git operations → Git remotes: clones and fetches (evidence: `kpa/git.py`)
- Command handlers → System package tools: builds and manages packages
- Command handlers → Safety and cache utilities: checks safety and cleans cache (evidence: `kpa/funciones.py`)
- Safety and cache utilities → AUR metadata: gets package warnings (evidence: `kpa/extra_utils.py`)
- Command handlers → Configuration: reads and updates settings (evidence: `kpa/funciones.py`)
- Command handlers → Terminal formatting: prints status (evidence: `kpa/funciones.py`)
- Safety and cache utilities → Terminal formatting: prints prompts and warnings (evidence: `kpa/extra_utils.py`)
- Configuration → Terminal formatting: reports config issues (evidence: `kpa/parser.py`)
