# ryanmferreira/pig-appimage-manager-cpp architecture

> Architecture diagram of the GitHub repository ryanmferreira/pig-appimage-manager-cpp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ryanmferreira/pig-appimage-manager-cpp
- Repository: https://github.com/ryanmferreira/pig-appimage-manager-cpp

## Overview

PIG is a command-line AppImage manager. A user invokes the CLI, which validates commands and dispatches copying, opening, creating an app-specific .home directory, deleting a file, or listing installed apps. On startup it ensures the default ~/Programs/AppImages/ directory exists. Copying creates an app subdirectory, copies the binary, and adds owner execute permission; listing scans that storage. The README describes desktop integration and other future capabilities, but these are not implemented in the sampled runtime. The graph reflects the available source; custom storage-path selection is not evident.

Main entry points: [`src/arguments.cpp`](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/arguments.cpp) (Command router), [`src/fileManagement.cpp`](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp) (AppImage copy), [`src/main.cpp`](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/main.cpp) (CLI entry), [`src/scanApps.cpp`](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/scanApps.cpp) (Installed app listing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_entry["CLI entry<br/>[main.cpp]"]
  node_router["Command router<br/>[arguments.cpp]"]
end

subgraph group_management["App management"]
  node_file_ops["File operations<br/>[fileManagement.cpp]"]
  node_app_folder["App folder creation<br/>[fileManagement.cpp]"]
  node_copy["AppImage copy<br/>[fileManagement.cpp]"]
  node_permissions["Execute permissions<br/>[fileManagement.cpp]"]
  node_launch["App launch<br/>[fileManagement.cpp]"]
  node_home["Home directory creation<br/>[fileManagement.cpp]"]
  node_delete["File deletion<br/>[fileManagement.cpp]"]
end

subgraph group_catalog["App catalog"]
  node_listing["Installed app listing<br/>[scanApps.cpp]"]
  node_scanner["App directory scan<br/>[scanApps.cpp]"]
end

node_user(("User"))
node_store[("AppImage storage")]

node_user -->|"runs command"| node_entry
node_entry -->|"validates arguments"| node_router
node_entry -->|"ensures default directory"| node_store
node_router -->|"dispatches copy"| node_copy
node_router -->|"dispatches open"| node_launch
node_router -->|"dispatches home"| node_home
node_router -->|"dispatches delete"| node_delete
node_router -->|"dispatches show"| node_listing
node_copy -->|"creates directory"| node_app_folder
node_app_folder -->|"creates in storage"| node_store
node_copy -->|"copies binary"| node_store
node_copy -->|"adds permission"| node_permissions
node_permissions -->|"updates binary"| node_store
node_launch -->|"executes path"| node_store
node_home -->|"creates directory"| node_app_folder
node_delete -->|"removes file"| node_store
node_listing -->|"requests scan"| node_scanner
node_scanner -->|"scans directories"| node_store

click node_entry "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/main.cpp"
click node_router "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/arguments.cpp"
click node_file_ops "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_app_folder "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_copy "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_permissions "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_launch "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_home "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_delete "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp"
click node_listing "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/scanApps.cpp"
click node_scanner "https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/scanApps.cpp"

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_entry,node_router,node_user toneBlue
class node_file_ops,node_app_folder,node_copy,node_permissions,node_launch,node_home,node_delete,node_store toneAmber
class node_listing,node_scanner toneMint
```

## Components

### CLI

- [CLI entry](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/main.cpp): `src/main.cpp`
- [Command router](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/arguments.cpp): `src/arguments.cpp`

### App management

- [File operations](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`
- [App folder creation](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`
- [AppImage copy](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`
- [Execute permissions](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`
- [App launch](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`
- [Home directory creation](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`
- [File deletion](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/fileManagement.cpp): `src/fileManagement.cpp`

### App catalog

- [Installed app listing](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/scanApps.cpp): `src/scanApps.cpp`
- [App directory scan](https://github.com/ryanmferreira/pig-appimage-manager-cpp/blob/main/src/scanApps.cpp): `src/scanApps.cpp`

### Other components

- **User**
- **AppImage storage**

## Connections

- User → CLI entry: runs command
- CLI entry → Command router: validates arguments
- CLI entry → AppImage storage: ensures default directory
- Command router → AppImage copy: dispatches copy
- Command router → App launch: dispatches open
- Command router → Home directory creation: dispatches home
- Command router → File deletion: dispatches delete
- Command router → Installed app listing: dispatches show
- AppImage copy → App folder creation: creates directory
- App folder creation → AppImage storage: creates in storage
- AppImage copy → AppImage storage: copies binary
- AppImage copy → Execute permissions: adds permission
- Execute permissions → AppImage storage: updates binary
- App launch → AppImage storage: executes path
- Home directory creation → App folder creation: creates directory
- File deletion → AppImage storage: removes file
- Installed app listing → App directory scan: requests scan
- App directory scan → AppImage storage: scans directories
